public abstract class ReadFilter extends Object
FileReader.
This class is experimental is still expanding.
See StreamDataFileWriter for the file format.
The methods on this class will be called in the following sequence:
reset() - Called before filtering a new data block acceptTimestamp() - Called when the timestamp of a data block is read getNextTimestampHint() - Called if acceptTimestamp() return false acceptOffset() - Called at each stream event begin offset
| Modifier and Type | Field and Description |
|---|---|
static ReadFilter |
ALWAYS_ACCEPT
Always accept what it sees.
|
static ReadFilter |
ALWAYS_REJECT_OFFSET
Always reject offset.
|
| Constructor and Description |
|---|
ReadFilter() |
| Modifier and Type | Method and Description |
|---|---|
boolean |
acceptOffset(long offset)
Accept or reject based on file offset.
|
boolean |
acceptTimestamp(long timestamp)
Accept or reject based on event timestamp.
|
long |
getNextTimestampHint()
If the
acceptTimestamp(long) returns false, the filter can provide a hint for the next
timestamp the reader should start reading from. |
void |
reset()
Invoked before filtering a new data block.
|
public static final ReadFilter ALWAYS_ACCEPT
public static final ReadFilter ALWAYS_REJECT_OFFSET
public void reset()
public boolean acceptOffset(long offset)
offset - The file offset.true to accept, false to reject.public boolean acceptTimestamp(long timestamp)
timestamp - The timestamp of the event.true to accept, false to reject.public long getNextTimestampHint()
acceptTimestamp(long) returns false, the filter can provide a hint for the next
timestamp the reader should start reading from.Copyright © 2016 Cask Data, Inc. Licensed under the Apache License, Version 2.0.