Package org.apache.flink.runtime.io
Class AvailabilityProvider.AvailabilityHelper
- java.lang.Object
-
- org.apache.flink.runtime.io.AvailabilityProvider.AvailabilityHelper
-
- All Implemented Interfaces:
AvailabilityProvider
- Enclosing interface:
- AvailabilityProvider
public static final class AvailabilityProvider.AvailabilityHelper extends Object implements AvailabilityProvider
A availability implementation for providing the helpful functions of resetting the available/unavailable states.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.apache.flink.runtime.io.AvailabilityProvider
AvailabilityProvider.AvailabilityHelper
-
-
Field Summary
-
Fields inherited from interface org.apache.flink.runtime.io.AvailabilityProvider
AVAILABLE
-
-
Constructor Summary
Constructors Constructor Description AvailabilityHelper()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description CompletableFuture<?>
and(CompletableFuture<?> other)
CompletableFuture<?>
and(AvailabilityProvider other)
CompletableFuture<?>
getAvailableFuture()
CompletableFuture<?>
getUnavailableToResetAvailable()
Returns the previously not completed future and resets the constant completedAvailabilityProvider.AVAILABLE
as the current state.CompletableFuture<?>
getUnavailableToResetUnavailable()
Creates a new uncompleted future as the current state and returns the previous uncompleted one.CompletableFuture<?>
or(CompletableFuture<?> other)
CompletableFuture<?>
or(AvailabilityProvider other)
void
resetAvailable()
Resets the constant completedAvailabilityProvider.AVAILABLE
as the current state.void
resetUnavailable()
Judges to reset the current available state as unavailable.String
toString()
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.apache.flink.runtime.io.AvailabilityProvider
isApproximatelyAvailable, isAvailable
-
-
-
-
Method Detail
-
and
public CompletableFuture<?> and(CompletableFuture<?> other)
-
and
public CompletableFuture<?> and(AvailabilityProvider other)
-
or
public CompletableFuture<?> or(CompletableFuture<?> other)
-
or
public CompletableFuture<?> or(AvailabilityProvider other)
-
resetUnavailable
public void resetUnavailable()
Judges to reset the current available state as unavailable.
-
resetAvailable
public void resetAvailable()
Resets the constant completedAvailabilityProvider.AVAILABLE
as the current state.
-
getUnavailableToResetAvailable
public CompletableFuture<?> getUnavailableToResetAvailable()
Returns the previously not completed future and resets the constant completedAvailabilityProvider.AVAILABLE
as the current state.
-
getUnavailableToResetUnavailable
public CompletableFuture<?> getUnavailableToResetUnavailable()
Creates a new uncompleted future as the current state and returns the previous uncompleted one.
-
getAvailableFuture
public CompletableFuture<?> getAvailableFuture()
- Specified by:
getAvailableFuture
in interfaceAvailabilityProvider
- Returns:
- a future that is completed if the respective provider is available.
-
-