public abstract class AbstractRecordSink extends Object implements RecordSink
DataVisitor
and SubscriptionVisitor
APIs
to RecordSink
API. All you have to do is to implement append(RecordCursor)
method,
while all the methods of DataVisitor
and SubscriptionVisitor
interfaces are
already implemented and invoke append(RecordCursor)
implementation.VOID
Constructor and Description |
---|
AbstractRecordSink() |
Modifier and Type | Method and Description |
---|---|
abstract void |
append(RecordCursor cursor)
Adds a record to this sink from the specified
RecordCursor . |
void |
flush()
Signal that it is safe to flush
appended records to disk,
e.g. |
boolean |
hasCapacity()
Returns whether sink has capacity to efficiently
append next record. |
void |
visitIntField(DataIntField field,
int value)
Deprecated.
Use
append(RecordCursor) . |
void |
visitObjField(DataObjField field,
Object value)
Deprecated.
Use
append(RecordCursor) . |
void |
visitRecord(DataRecord record,
int cipher,
String symbol)
Deprecated.
Use
append(RecordCursor) . |
void |
visitRecord(DataRecord record,
int cipher,
String symbol,
long time)
Deprecated.
Use
append(RecordCursor) . |
public boolean hasCapacity()
append
next record.
This method may be used to advise RecordProvider
that it is desirable
to stop current batch and keep remaining records. However,
record provider is not obliged to adhere to this method contract.
NOTE: sink must process all records that are passed to it
via append
method calls no matter whether it
has capacity to do it efficiently.
This implementation returns true
.
hasCapacity
in interface DataVisitor
hasCapacity
in interface RecordSink
hasCapacity
in interface SubscriptionVisitor
public abstract void append(RecordCursor cursor)
RecordCursor
.append
in interface RecordSink
public void flush()
appended
records to disk,
e.g. no locks are currently held.
This implementation does nothing.
flush
in interface RecordSink
public final void visitRecord(DataRecord record, int cipher, String symbol)
append(RecordCursor)
.visitRecord
in interface DataVisitor
visitRecord
in interface RecordSink
public final void visitRecord(DataRecord record, int cipher, String symbol, long time)
append(RecordCursor)
.visitRecord
in interface RecordSink
visitRecord
in interface SubscriptionVisitor
public final void visitIntField(DataIntField field, int value)
append(RecordCursor)
.visitIntField
in interface DataVisitor
visitIntField
in interface RecordSink
public final void visitObjField(DataObjField field, Object value)
append(RecordCursor)
.visitObjField
in interface DataVisitor
visitObjField
in interface RecordSink
Copyright © 2002–2025 Devexperts LLC. All rights reserved.