Package org.apache.druid.rpc.indexing
Class SpecificTaskServiceLocator
- java.lang.Object
-
- org.apache.druid.rpc.indexing.SpecificTaskServiceLocator
-
- All Implemented Interfaces:
Closeable,AutoCloseable,ServiceLocator
public class SpecificTaskServiceLocator extends Object implements ServiceLocator
Service locator for a specific task. Uses theOverlordClient.taskStatus(java.lang.String)API to locate tasks. This locator has an internal cache that is updated if the last check has been overLOCATION_CACHE_MSago. This locator is Closeable, like all ServiceLocators, but it is not essential that you actually close it. Closing does not free any resources: it merely makes future calls tolocate()returnServiceLocations.closed().
-
-
Constructor Summary
Constructors Constructor Description SpecificTaskServiceLocator(String taskId, OverlordClient overlordClient)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()com.google.common.util.concurrent.ListenableFuture<ServiceLocations>locate()Returns a future that resolves to a set ofServiceLocation.
-
-
-
Constructor Detail
-
SpecificTaskServiceLocator
public SpecificTaskServiceLocator(String taskId, OverlordClient overlordClient)
-
-
Method Detail
-
locate
public com.google.common.util.concurrent.ListenableFuture<ServiceLocations> locate()
Description copied from interface:ServiceLocatorReturns a future that resolves to a set ofServiceLocation. If the returned object returns true fromServiceLocations.isClosed(), it means the service has closed permanently. Otherwise, any of the returned locations inServiceLocations.getLocations()is a viable selection. It is possible for the list of locations to be empty. This means that the service is not currently available, but also has not been closed, so it may become available at some point in the future.- Specified by:
locatein interfaceServiceLocator
-
close
public void close()
- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Specified by:
closein interfaceServiceLocator
-
-