Package org.logstash.beats
Class V2Batch
- java.lang.Object
-
- org.logstash.beats.V2Batch
-
-
Constructor Summary
Constructors Constructor Description V2Batch()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
getBatchSize()
Number of messages that the batch is expected to contain.int
getHighestSequence()
Returns the highest sequence number of the batch.byte
getProtocol()
Returns the protocol of the sent messages that this batch was constructed fromboolean
isComplete()
Is the batch complete?boolean
isEmpty()
Is the batch currently empty?Iterator<Message>
iterator()
void
release()
Release the resources associated with the batch.void
setBatchSize(int batchSize)
Set the number of messages that the batch is expected to contain.void
setProtocol(byte protocol)
int
size()
Current number of messages in the batch-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface java.lang.Iterable
forEach, spliterator
-
-
-
-
Method Detail
-
setProtocol
public void setProtocol(byte protocol)
-
getProtocol
public byte getProtocol()
Description copied from interface:Batch
Returns the protocol of the sent messages that this batch was constructed from- Specified by:
getProtocol
in interfaceBatch
- Returns:
- byte - either '1' or '2'
-
getBatchSize
public int getBatchSize()
Description copied from interface:Batch
Number of messages that the batch is expected to contain.- Specified by:
getBatchSize
in interfaceBatch
- Returns:
- int - number of messages
-
setBatchSize
public void setBatchSize(int batchSize)
Description copied from interface:Batch
Set the number of messages that the batch is expected to contain.- Specified by:
setBatchSize
in interfaceBatch
- Parameters:
batchSize
- int - number of messages
-
size
public int size()
Description copied from interface:Batch
Current number of messages in the batch
-
isEmpty
public boolean isEmpty()
Description copied from interface:Batch
Is the batch currently empty?
-
isComplete
public boolean isComplete()
Description copied from interface:Batch
Is the batch complete?- Specified by:
isComplete
in interfaceBatch
- Returns:
- boolean
-
getHighestSequence
public int getHighestSequence()
Description copied from interface:Batch
Returns the highest sequence number of the batch.- Specified by:
getHighestSequence
in interfaceBatch
- Returns:
-
-