T - public class BasicMemoryBuffer<T> extends Object implements IBuffer<T>
| Constructor and Description |
|---|
BasicMemoryBuffer(KinesisConnectorConfiguration configuration) |
BasicMemoryBuffer(KinesisConnectorConfiguration configuration,
List<T> buffer) |
| Modifier and Type | Method and Description |
|---|---|
void |
clear()
Clears the buffer
|
void |
consumeRecord(T record,
int recordSize,
String sequenceNumber)
Stores the record in the buffer
|
long |
getBytesToBuffer()
Get the byte size limit of data stored in the buffer before the records are flushed to the
emitter
|
protected long |
getCurrentTimeMilliseconds() |
String |
getFirstSequenceNumber()
Get the sequence number of the first record stored in the buffer.
|
String |
getLastSequenceNumber()
Get the sequence number of the last record stored in the buffer.
|
long |
getMillisecondsToBuffer()
Get the time limit in milliseconds before the records are flushed to the emitter
|
long |
getNumRecordsToBuffer()
Get the record number limit of data stored in the buffer before the records are flushed to
the emitter
|
List<T> |
getRecords()
Get the records stored in the buffer
|
boolean |
shouldFlush()
By default, we flush once we have exceeded the number of messages or maximum bytes to buffer.
|
public BasicMemoryBuffer(KinesisConnectorConfiguration configuration, List<T> buffer)
public BasicMemoryBuffer(KinesisConnectorConfiguration configuration)
public long getBytesToBuffer()
IBuffergetBytesToBuffer in interface IBuffer<T>public long getNumRecordsToBuffer()
IBuffergetNumRecordsToBuffer in interface IBuffer<T>public long getMillisecondsToBuffer()
IBuffergetMillisecondsToBuffer in interface IBuffer<T>public void consumeRecord(T record, int recordSize, String sequenceNumber)
IBufferconsumeRecord in interface IBuffer<T>record - record to be processedrecordSize - size of the record data in bytessequenceNumber - Amazon Kinesis sequence identifierpublic void clear()
IBufferpublic String getFirstSequenceNumber()
IBuffergetFirstSequenceNumber in interface IBuffer<T>public String getLastSequenceNumber()
IBuffergetLastSequenceNumber in interface IBuffer<T>public boolean shouldFlush()
shouldFlush in interface IBuffer<T>public List<T> getRecords()
IBuffergetRecords in interface IBuffer<T>protected long getCurrentTimeMilliseconds()
Copyright © 2016. All rights reserved.