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 Latency
decodeLatency(byte[] data)
protected LogOffset
findOffset(LogManager manager, LogPartitionGroup key, Latency latency)
protected List<Name>
getLogNames(LogManager manager, String names)
String
name()
protected Map<LogPartitionGroup,Latency>
readLatencies(LogManager manager)
protected boolean
restorePosition(LogManager manager)
boolean
run(LogManager manager, org.apache.commons.cli.CommandLine cmd)
protected Map<LogPartitionGroup,LogOffset>
searchOffsets(LogManager manager, Map<LogPartitionGroup,Latency> latencies)
void
updateOptions(org.apache.commons.cli.Options options)
protected void
updatePosition(LogManager manager, LogPartitionGroup key, LogOffset offset)
protected void
updatePositions(LogManager manager, Map<LogPartitionGroup,LogOffset> offsets)
-
Methods inherited from class org.nuxeo.lib.stream.tools.command.Command
getRecordCodec, getRecordRenderer
-
-
-
-
Constructor Detail
-
RestoreCommand
public RestoreCommand()
-
-
Method Detail
-
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
-
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)
-
-