public abstract class AbstractIndexStatusWatcher<R,S extends AbstractIndexStatusWatcher<R,S>> extends Object implements Callable<R>
Modifier and Type | Field and Description |
---|---|
protected JanusGraph |
g |
protected java.time.Duration |
poll |
protected SchemaStatus |
status |
protected java.time.Duration |
timeout |
Constructor and Description |
---|
AbstractIndexStatusWatcher(JanusGraph g) |
Modifier and Type | Method and Description |
---|---|
S |
pollInterval(long poll,
java.time.temporal.TemporalUnit pollUnit)
Set the index information polling interval.
|
protected abstract S |
self() |
S |
status(SchemaStatus status)
Set the target index status.
|
S |
timeout(long timeout,
java.time.temporal.TemporalUnit timeoutUnit)
Set the maximum amount of wallclock time that
Callable.call() will
wait for the index to reach the target status. |
protected JanusGraph g
protected SchemaStatus status
protected java.time.Duration timeout
protected java.time.Duration poll
public AbstractIndexStatusWatcher(JanusGraph g)
protected abstract S self()
public S status(SchemaStatus status)
Callable.call()
will repeatedly
poll the graph passed into this instance during construction to
see whether the index (also passed in during construction) has
the supplied status.status
- public S timeout(long timeout, java.time.temporal.TemporalUnit timeoutUnit)
Callable.call()
will
wait for the index to reach the target status. If the index does
not reach the target state in this interval, then Callable.call()
will return a report value indicating failure.
A negative timeout
is interpreted to mean "wait forever"
(no timeout). In this case, the timeoutUnit
is ignored.
timeout
- the time duration scalartimeoutUnit
- the time unitpublic S pollInterval(long poll, java.time.temporal.TemporalUnit pollUnit)
Callable.call()
waits
at least this long between repeated attempts to read schema information
and determine whether the index has reached its target state.Copyright © 2012–2017. All rights reserved.