Class PositionCommand
- java.lang.Object
-
- org.nuxeo.lib.stream.tools.command.Command
-
- org.nuxeo.lib.stream.tools.command.PositionCommand
-
public class PositionCommand extends Command
Manipulates the consumer position to the beginning, end or a specific timestamp- Since:
- 10.1
-
-
Field Summary
Fields Modifier and Type Field Description static String
AFTER_DATE_OPT
static Duration
FIRST_READ_TIMEOUT
protected static String
NAME
static Duration
READ_TIMEOUT
static String
TO_OFFSET_OPT
static String
TO_WATERMARK_OPT
-
Constructor Summary
Constructors Constructor Description PositionCommand()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected <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
labelFor(Name name, int partition)
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 Detail
-
FIRST_READ_TIMEOUT
public static final Duration FIRST_READ_TIMEOUT
-
READ_TIMEOUT
public static final Duration READ_TIMEOUT
-
NAME
protected static final String NAME
- See Also:
- Constant Field Values
-
AFTER_DATE_OPT
public static final String AFTER_DATE_OPT
- See Also:
- Constant Field Values
-
TO_WATERMARK_OPT
public static final String TO_WATERMARK_OPT
- See Also:
- Constant Field Values
-
TO_OFFSET_OPT
public static final String TO_OFFSET_OPT
- See Also:
- Constant Field Values
-
-
Method Detail
-
getTimestampFromDate
protected static long getTimestampFromDate(String dateIso8601)
-
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
protected boolean toEnd(LogManager manager, Name group, Name name, int partition)
-
labelFor
protected String labelFor(int partition)
-
getLag
protected LogLag getLag(LogManager manager, Name group, Name name, int partition)
-
createTailer
protected <T extends Externalizable> LogTailer<T> createTailer(LogManager manager, Name name, int partition, Name group)
-
reset
protected boolean reset(LogManager manager, Name group, Name name, int partition)
-
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)
-
-