Module org.elasticsearch.server
Class ContinuousComputation<T>
java.lang.Object
org.elasticsearch.cluster.routing.allocation.allocator.ContinuousComputation<T>
Asynchronously runs some computation using at most one thread but expects the input value changes over time as it's running. Newer input
values are assumed to be fresher and trigger a recomputation. If a computation never starts before a fresher value arrives then it is
skipped.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected boolean
void
onNewInput
(T input) Called when the input value has changed.protected abstract void
processInput
(T input) Process the given input.
-
Constructor Details
-
ContinuousComputation
- Parameters:
executor
- theExecutor
with which to execute the computation
-
-
Method Details
-
onNewInput
Called when the input value has changed. If no newer value is received then eventually either the computation will run on this value. -
isFresh
- Returns:
true
iff the giveninput
is the latest known input.
-
processInput
Process the given input.- Parameters:
input
- the value that was last received byonNewInput(T)
before invocation.
-