Package ai.pipestream.common.util
Class NoOpProcessingBuffer<T extends com.google.protobuf.Message>
java.lang.Object
ai.pipestream.common.util.NoOpProcessingBuffer<T>
- Type Parameters:
T- the type of protobuf message
- All Implemented Interfaces:
ProcessingBuffer<T>
public class NoOpProcessingBuffer<T extends com.google.protobuf.Message>
extends Object
implements ProcessingBuffer<T>
A no-op implementation of the ProcessingBuffer interface.
This implementation doesn't actually store or save any messages.
It's used in production environments where we don't want to incur the overhead
of storing and saving protobuf messages.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidDoes nothing.voidclear()Does nothing.voidDoes nothing on shutdown.voidDoes nothing.voidsaveToDisk(String fileNamePrefix, int numberPrecision) Saves all messages in the buffer to disk to "voidsaveToDisk(Path location, String fileNamePrefix, int numberPrecision) Does nothing.intsize()Always returns 0.snapshot()Always returns an empty list since this is a no-op buffer.
-
Constructor Details
-
NoOpProcessingBuffer
public NoOpProcessingBuffer()Default constructor for NoOpProcessingBuffer. Creates an empty buffer that doesn't store any messages.
-
-
Method Details
-
add
Does nothing.- Specified by:
addin interfaceProcessingBuffer<T extends com.google.protobuf.Message>- Parameters:
message- the message to add (ignored)
-
saveToDisk
public void saveToDisk()Does nothing.- Specified by:
saveToDiskin interfaceProcessingBuffer<T extends com.google.protobuf.Message>
-
saveToDisk
Description copied from interface:ProcessingBufferSaves all messages in the buffer to disk to "./
" directory.- Specified by:
saveToDiskin interfaceProcessingBuffer<T extends com.google.protobuf.Message>- Parameters:
fileNamePrefix- the prefix to use for the file namesnumberPrecision- the number of digits to use for the file name suffix
-
saveToDisk
Does nothing.- Specified by:
saveToDiskin interfaceProcessingBuffer<T extends com.google.protobuf.Message>- Parameters:
location- the directory to save the files to (ignored)fileNamePrefix- the prefix to use for the file names (ignored)numberPrecision- the number of digits to use for the file name suffix (ignored)
-
size
public int size()Always returns 0.- Specified by:
sizein interfaceProcessingBuffer<T extends com.google.protobuf.Message>- Returns:
- 0
-
clear
public void clear()Does nothing.- Specified by:
clearin interfaceProcessingBuffer<T extends com.google.protobuf.Message>
-
saveOnShutdown
@PreDestroy public void saveOnShutdown()Does nothing on shutdown. -
snapshot
Always returns an empty list since this is a no-op buffer.- Specified by:
snapshotin interfaceProcessingBuffer<T extends com.google.protobuf.Message>- Returns:
- an empty list
-