Class PositionCommand
java.lang.Object
org.nuxeo.lib.stream.tools.command.Command
org.nuxeo.lib.stream.tools.command.PositionCommand
Manipulates the consumer position to the beginning, end or a specific timestamp
- Since:
- 10.1
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected <T extends Externalizable>
LogTailer<T>createTailer
(LogManager manager, Name name, int partition, Name group) protected LogLag
getLag
(LogManager manager, Name group, Name name, int partition) protected static long
getTimestampFromDate
(String dateIso8601) protected String
labelFor
(int partition) protected String
name()
protected boolean
positionAfterDate
(LogManager manager, Name group, Name name, int partition, long timestamp) protected boolean
positionToOffset
(LogManager manager, Name group, Name name, int partition, long offset) protected boolean
positionToWatermark
(LogManager manager, Name group, Name name, int partition, long timestamp, String codec) protected boolean
reset
(LogManager manager, Name group, Name name, int partition) boolean
run
(LogManager manager, org.apache.commons.cli.CommandLine cmd) protected LogOffset
searchWatermarkOffset
(LogTailer<Record> tailer, long timestamp) protected boolean
toEnd
(LogManager manager, Name group, Name name, int partition) void
updateOptions
(org.apache.commons.cli.Options options) Methods inherited from class org.nuxeo.lib.stream.tools.command.Command
getRecordCodec, getRecordRenderer
-
Field Details
-
FIRST_READ_TIMEOUT
-
READ_TIMEOUT
-
NAME
- See Also:
-
AFTER_DATE_OPT
- See Also:
-
TO_WATERMARK_OPT
- See Also:
-
TO_OFFSET_OPT
- See Also:
-
-
Constructor Details
-
PositionCommand
public PositionCommand()
-
-
Method Details
-
getTimestampFromDate
-
name
-
updateOptions
public void updateOptions(org.apache.commons.cli.Options options) - Specified by:
updateOptions
in classCommand
-
run
public boolean run(LogManager manager, org.apache.commons.cli.CommandLine cmd) throws InterruptedException - Specified by:
run
in classCommand
- Throws:
InterruptedException
-
toEnd
-
labelFor
-
labelFor
-
getLag
-
createTailer
protected <T extends Externalizable> LogTailer<T> createTailer(LogManager manager, Name name, int partition, Name group) -
reset
-
positionAfterDate
protected boolean positionAfterDate(LogManager manager, Name group, Name name, int partition, long timestamp) -
positionToWatermark
protected boolean positionToWatermark(LogManager manager, Name group, Name name, int partition, long timestamp, String codec) throws InterruptedException - Throws:
InterruptedException
-
searchWatermarkOffset
protected LogOffset searchWatermarkOffset(LogTailer<Record> tailer, long timestamp) throws InterruptedException - Throws:
InterruptedException
-
positionToOffset
protected boolean positionToOffset(LogManager manager, Name group, Name name, int partition, long offset)
-