Class RestoreCommand
- java.lang.Object
-
- org.nuxeo.lib.stream.tools.command.Command
-
- org.nuxeo.lib.stream.tools.command.RestoreCommand
-
public class RestoreCommand extends Command
Restore consumer positions using the latency tracker Log.- Since:
- 10.1
-
-
Constructor Summary
Constructors Constructor Description RestoreCommand()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected LatencydecodeLatency(byte[] data)protected LogOffsetfindOffset(LogManager manager, LogPartitionGroup key, Latency latency)protected List<Name>getLogNames(LogManager manager, String names)Stringname()protected Map<LogPartitionGroup,Latency>readLatencies(LogManager manager)protected booleanrestorePosition(LogManager manager)booleanrun(LogManager manager, org.apache.commons.cli.CommandLine cmd)protected Map<LogPartitionGroup,LogOffset>searchOffsets(LogManager manager, Map<LogPartitionGroup,Latency> latencies)voidupdateOptions(org.apache.commons.cli.Options options)protected voidupdatePosition(LogManager manager, LogPartitionGroup key, LogOffset offset)protected voidupdatePositions(LogManager manager, Map<LogPartitionGroup,LogOffset> offsets)-
Methods inherited from class org.nuxeo.lib.stream.tools.command.Command
getRecordCodec, getRecordRenderer
-
-
-
-
Field Detail
-
NAME
protected static final String NAME
- See Also:
- Constant Field Values
-
GROUP
protected static final Name GROUP
-
verbose
protected boolean verbose
-
input
protected Name input
-
date
protected long date
-
dryRun
protected boolean dryRun
-
codec
protected String codec
-
-
Method Detail
-
updateOptions
public void updateOptions(org.apache.commons.cli.Options options)
- Specified by:
updateOptionsin classCommand
-
run
public boolean run(LogManager manager, org.apache.commons.cli.CommandLine cmd) throws InterruptedException
- Specified by:
runin classCommand- Throws:
InterruptedException
-
restorePosition
protected boolean restorePosition(LogManager manager) throws InterruptedException
- Throws:
InterruptedException
-
updatePositions
protected void updatePositions(LogManager manager, Map<LogPartitionGroup,LogOffset> offsets)
-
updatePosition
protected void updatePosition(LogManager manager, LogPartitionGroup key, LogOffset offset)
-
searchOffsets
protected Map<LogPartitionGroup,LogOffset> searchOffsets(LogManager manager, Map<LogPartitionGroup,Latency> latencies) throws InterruptedException
- Throws:
InterruptedException
-
findOffset
protected LogOffset findOffset(LogManager manager, LogPartitionGroup key, Latency latency) throws InterruptedException
- Throws:
InterruptedException
-
readLatencies
protected Map<LogPartitionGroup,Latency> readLatencies(LogManager manager) throws InterruptedException
- Throws:
InterruptedException
-
decodeLatency
protected Latency decodeLatency(byte[] data)
-
getLogNames
protected List<Name> getLogNames(LogManager manager, String names)
-
-