/** * Flushes this output stream and forces any buffered output bytes to be written out. * * @throws IOException if an I/O error occurs. */ @Override public void flush() throws IOException { synchronized (mux) { checkClosed(null, 0); sendBufferIfNotEmpty(); flushRemainder(); awaitAcks(); // Update file length if needed. if (igfsCtx.configuration().isUpdateFileLengthOnFlush() && space > 0) { try { IgfsEntryInfo fileInfo0 = igfsCtx.meta().reserveSpace(fileInfo.id(), space, streamRange); if (fileInfo0 == null) throw new IOException("File was concurrently deleted: " + path); else fileInfo = fileInfo0; streamRange = initialStreamRange(fileInfo); space = 0; } catch (IgniteCheckedException e) { throw new IOException("Failed to update file length data [path=" + path + ", space=" + space + ']', e); } } } }
/** * Create data transfer object for IGFS configuration properties. * @param igfs IGFS configuration. */ public VisorIgfsConfiguration(FileSystemConfiguration igfs) { name = igfs.getName(); metaCacheName = igfs.getMetaCacheConfiguration().getName(); dataCacheName = igfs.getDataCacheConfiguration().getName(); blockSize = igfs.getBlockSize(); prefetchBlocks = igfs.getPrefetchBlocks(); streamBufSize = igfs.getBufferSize(); perNodeBatchSize = igfs.getPerNodeBatchSize(); perNodeParallelBatchCnt = igfs.getPerNodeParallelBatchCount(); dfltMode = igfs.getDefaultMode(); pathModes = igfs.getPathModes(); maxTaskRangeLen = igfs.getMaximumTaskRangeLength(); fragmentizerConcurrentFiles = igfs.getFragmentizerConcurrentFiles(); fragmentizerEnabled = igfs.isFragmentizerEnabled(); fragmentizerThrottlingBlockLen = igfs.getFragmentizerThrottlingBlockLength(); fragmentizerThrottlingDelay = igfs.getFragmentizerThrottlingDelay(); IgfsIpcEndpointConfiguration endpointCfg = igfs.getIpcEndpointConfiguration(); ipcEndpointCfg = endpointCfg != null ? endpointCfg.toString() : null; ipcEndpointEnabled = igfs.isIpcEndpointEnabled(); mgmtPort = igfs.getManagementPort(); seqReadsBeforePrefetch = igfs.getSequentialReadsBeforePrefetch(); colocateMeta = igfs.isColocateMetadata(); relaxedConsistency = igfs.isRelaxedConsistency(); updateFileLenOnFlush = igfs.isUpdateFileLengthOnFlush(); }
relaxedConsistency = cfg.isRelaxedConsistency(); seqReadsBeforePrefetch = cfg.getSequentialReadsBeforePrefetch(); updateFileLenOnFlush = cfg.isUpdateFileLengthOnFlush();
/** * Flushes this output stream and forces any buffered output bytes to be written out. * * @throws IOException if an I/O error occurs. */ @Override public void flush() throws IOException { synchronized (mux) { checkClosed(null, 0); sendBufferIfNotEmpty(); flushRemainder(); awaitAcks(); // Update file length if needed. if (igfsCtx.configuration().isUpdateFileLengthOnFlush() && space > 0) { try { IgfsEntryInfo fileInfo0 = igfsCtx.meta().reserveSpace(fileInfo.id(), space, streamRange); if (fileInfo0 == null) throw new IOException("File was concurrently deleted: " + path); else fileInfo = fileInfo0; streamRange = initialStreamRange(fileInfo); space = 0; } catch (IgniteCheckedException e) { throw new IOException("Failed to update file length data [path=" + path + ", space=" + space + ']', e); } } } }
relaxedConsistency = cfg.isRelaxedConsistency(); seqReadsBeforePrefetch = cfg.getSequentialReadsBeforePrefetch(); updateFileLenOnFlush = cfg.isUpdateFileLengthOnFlush();
/** * Create data transfer object for IGFS configuration properties. * @param igfs IGFS configuration. */ public VisorIgfsConfiguration(FileSystemConfiguration igfs) { name = igfs.getName(); metaCacheName = igfs.getMetaCacheConfiguration().getName(); dataCacheName = igfs.getDataCacheConfiguration().getName(); blockSize = igfs.getBlockSize(); prefetchBlocks = igfs.getPrefetchBlocks(); streamBufSize = igfs.getBufferSize(); perNodeBatchSize = igfs.getPerNodeBatchSize(); perNodeParallelBatchCnt = igfs.getPerNodeParallelBatchCount(); dfltMode = igfs.getDefaultMode(); pathModes = igfs.getPathModes(); maxTaskRangeLen = igfs.getMaximumTaskRangeLength(); fragmentizerConcurrentFiles = igfs.getFragmentizerConcurrentFiles(); fragmentizerEnabled = igfs.isFragmentizerEnabled(); fragmentizerThrottlingBlockLen = igfs.getFragmentizerThrottlingBlockLength(); fragmentizerThrottlingDelay = igfs.getFragmentizerThrottlingDelay(); IgfsIpcEndpointConfiguration endpointCfg = igfs.getIpcEndpointConfiguration(); ipcEndpointCfg = endpointCfg != null ? endpointCfg.toString() : null; ipcEndpointEnabled = igfs.isIpcEndpointEnabled(); mgmtPort = igfs.getManagementPort(); seqReadsBeforePrefetch = igfs.getSequentialReadsBeforePrefetch(); colocateMeta = igfs.isColocateMetadata(); relaxedConsistency = igfs.isRelaxedConsistency(); updateFileLenOnFlush = igfs.isUpdateFileLengthOnFlush(); }