Package io.activej.aggregation
Class ActiveFsChunkStorage<C>
java.lang.Object
io.activej.aggregation.ActiveFsChunkStorage<C>
- All Implemented Interfaces:
AggregationChunkStorage<C>,io.activej.async.service.EventloopService,io.activej.common.initializer.WithInitializer<ActiveFsChunkStorage<C>>,io.activej.eventloop.jmx.EventloopJmxBean,io.activej.eventloop.jmx.EventloopJmxBeanWithStats,IdGenerator<C>
public final class ActiveFsChunkStorage<C>
extends Object
implements AggregationChunkStorage<C>, io.activej.async.service.EventloopService, io.activej.common.initializer.WithInitializer<ActiveFsChunkStorage<C>>, io.activej.eventloop.jmx.EventloopJmxBeanWithStats
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionio.activej.promise.Promise<Void>io.activej.promise.Promise<Void>checkRequiredChunks(Set<C> requiredChunks) io.activej.promise.Promise<Void>io.activej.promise.Promise<Void>static <C> ActiveFsChunkStorage<C>create(io.activej.eventloop.Eventloop eventloop, ChunkIdCodec<C> chunkIdCodec, IdGenerator<C> idGenerator, io.activej.csp.process.frames.FrameFormat frameFormat, ActiveFs fs) io.activej.promise.Promise<C>createId()io.activej.promise.Promise<Void>io.activej.jmx.stats.ExceptionStatsio.activej.jmx.stats.ValueStatsintintintintint@NotNull io.activej.eventloop.Eventloopintio.activej.promise.jmx.PromiseStatsio.activej.promise.jmx.PromiseStatsio.activej.promise.jmx.PromiseStatsio.activej.promise.jmx.PromiseStatsio.activej.promise.jmx.PromiseStatsio.activej.promise.jmx.PromiseStatsio.activej.promise.jmx.PromiseStatsio.activej.promise.jmx.PromiseStatslist(Predicate<C> chunkIdPredicate, LongPredicate lastModifiedPredicate) <T> io.activej.promise.Promise<StreamSupplier<T>>read(AggregationStructure aggregation, List<String> fields, Class<T> recordClass, C chunkId, DefiningClassLoader classLoader) Creates aStreamSupplierthat streams records contained in the chunk.void@NotNull io.activej.promise.Promise<Void>start()void@NotNull io.activej.promise.Promise<Void>stop()voidwithBackupPath(String path) withBufferSize(io.activej.common.MemSize bufferSize) withChunksPath(String path) withTempPath(String path) <T> io.activej.promise.Promise<StreamConsumer<T>>write(AggregationStructure aggregation, List<String> fields, Class<T> recordClass, C chunkId, DefiningClassLoader classLoader) Creates aStreamConsumerthat persists streamed records.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface io.activej.eventloop.jmx.EventloopJmxBeanWithStats
getSmoothingWindow, setSmoothingWindowMethods inherited from interface io.activej.async.service.EventloopService
startFuture, stopFutureMethods inherited from interface io.activej.common.initializer.WithInitializer
withInitializer
-
Field Details
-
DEFAULT_BUFFER_SIZE
public static final io.activej.common.MemSize DEFAULT_BUFFER_SIZE -
DEFAULT_SMOOTHING_WINDOW
-
DEFAULT_BACKUP_PATH
- See Also:
-
SUCCESSFUL_BACKUP_FILE
- See Also:
-
LOG
- See Also:
-
TEMP_LOG
- See Also:
-
-
Method Details
-
create
public static <C> ActiveFsChunkStorage<C> create(io.activej.eventloop.Eventloop eventloop, ChunkIdCodec<C> chunkIdCodec, IdGenerator<C> idGenerator, io.activej.csp.process.frames.FrameFormat frameFormat, ActiveFs fs) -
withBufferSize
-
withChunksPath
-
withTempPath
-
withBackupPath
-
read
public <T> io.activej.promise.Promise<StreamSupplier<T>> read(AggregationStructure aggregation, List<String> fields, Class<T> recordClass, C chunkId, DefiningClassLoader classLoader) Description copied from interface:AggregationChunkStorageCreates aStreamSupplierthat streams records contained in the chunk. The chunk to read is determined byaggregationIdandid.- Specified by:
readin interfaceAggregationChunkStorage<C>recordClass- class of chunk recordchunkId- id of chunk- Returns:
- StreamSupplier, which will stream read records to its wired consumer.
-
write
public <T> io.activej.promise.Promise<StreamConsumer<T>> write(AggregationStructure aggregation, List<String> fields, Class<T> recordClass, C chunkId, DefiningClassLoader classLoader) Description copied from interface:AggregationChunkStorageCreates aStreamConsumerthat persists streamed records. The chunk to write is determined byaggregationIdandid.- Specified by:
writein interfaceAggregationChunkStorage<C>fields- fields of chunk recordrecordClass- class of chunk recordchunkId- id of chunk
-
finish
- Specified by:
finishin interfaceAggregationChunkStorage<C>
-
createId
- Specified by:
createIdin interfaceIdGenerator<C>
-
backup
-
cleanup
-
cleanup
-
list
public io.activej.promise.Promise<Set<C>> list(Predicate<C> chunkIdPredicate, LongPredicate lastModifiedPredicate) -
checkRequiredChunks
-
getEventloop
@NotNull public @NotNull io.activej.eventloop.Eventloop getEventloop()- Specified by:
getEventloopin interfaceio.activej.eventloop.jmx.EventloopJmxBean- Specified by:
getEventloopin interfaceio.activej.async.service.EventloopService
-
start
- Specified by:
startin interfaceio.activej.async.service.EventloopService
-
stop
- Specified by:
stopin interfaceio.activej.async.service.EventloopService
-
getPromiseIdGenerator
public io.activej.promise.jmx.PromiseStats getPromiseIdGenerator() -
getPromiseFinishChunks
public io.activej.promise.jmx.PromiseStats getPromiseFinishChunks() -
getPromiseBackup
public io.activej.promise.jmx.PromiseStats getPromiseBackup() -
getPromiseCleanup
public io.activej.promise.jmx.PromiseStats getPromiseCleanup() -
getPromiseList
public io.activej.promise.jmx.PromiseStats getPromiseList() -
getPromiseOpenR
public io.activej.promise.jmx.PromiseStats getPromiseOpenR() -
getPromiseOpenW
public io.activej.promise.jmx.PromiseStats getPromiseOpenW() -
getReadFile
-
getReadDecompress
-
getReadDeserialize
-
getReadDeserializeDetailed
-
getWriteSerialize
-
getWriteSerializeDetailed
-
getWriteCompress
-
getWriteChunker
-
getWriteFile
-
getFinishChunks
public int getFinishChunks() -
getChunkNameWarnings
public io.activej.jmx.stats.ExceptionStats getChunkNameWarnings() -
getCleanupPreservedFiles
public int getCleanupPreservedFiles() -
getCleanupDeletedFiles
public int getCleanupDeletedFiles() -
getCleanupDeletedFilesTotal
public int getCleanupDeletedFilesTotal() -
getCleanupSkippedFiles
public int getCleanupSkippedFiles() -
getCleanupSkippedFilesTotal
public int getCleanupSkippedFilesTotal() -
getChunksCount
public io.activej.jmx.stats.ValueStats getChunksCount() -
getPromiseCleanupCheckRequiredChunks
public io.activej.promise.jmx.PromiseStats getPromiseCleanupCheckRequiredChunks() -
startDetailedMonitoring
public void startDetailedMonitoring() -
stopDetailedMonitoring
public void stopDetailedMonitoring() -
resetStats
public void resetStats()- Specified by:
resetStatsin interfaceio.activej.eventloop.jmx.EventloopJmxBeanWithStats
-