Class RemoteTableDataService.TableLocationProviderImpl
- All Implemented Interfaces:
- com.fishlib.base.log.LogOutputAppendable,- RequestResultHandler,- TableKey,- TableLocationProvider,- NamedImplementation
- Enclosing class:
- RemoteTableDataService
public class RemoteTableDataService.TableLocationProviderImpl extends AbstractTableLocationProvider implements RequestResultHandler
- 
Nested Class SummaryNested classes/interfaces inherited from interface com.illumon.iris.db.v2.locations.TableKeyTableKey.KeyedObjectKeyImpl<VALUE_TYPE>, TableKey.SelfKeyedObjectKeyImpl<VALUE_TYPE extends TableKey>Nested classes/interfaces inherited from interface com.illumon.iris.db.v2.locations.TableLocationProviderTableLocationProvider.Listener, TableLocationProvider.Null
- 
Field Summary
- 
Method SummaryModifier and Type Method Description protected voidactivateUnderlyingDataSource()Refresh and activate update pushing from the implementing class.booleancheckHasSubscribers()Check if this subscription aggregator still has any valid subscribers - useful if there may have been no notifications delivered for some time, as a test to determine whether work should be done to maintain the underlying subscription.protected voiddeactivateUnderlyingDataSource()Deactivate pushed updates from the implementing class.StringgetImplementationName()Get a name for the implementing class.StringgetName()allow TableLocationProvider instances to have names.protected TableLocationmakeTableLocation(TableLocationKey locationKey)Make a new implementation-appropriate TableLocation from the supplied key.protected <T> booleanmatchSubscriptionToken(T token)Verify that a notification pertains to a currently-active subscription.voidonComplete(TableDataRequest request)Invoked when the request completed successfully.voidonRejection(TableDataRequest request, String rejectionMessage, TableDataProtocol.RequestRejectionType requestRejectionType)Invoked when the specified request was rejected.voidonTableLocationKey(TableLocationKey locationKey)Invoked in response to atable locations requestfor each discoveredTableLocationKey.voidonTableLocationState(TableLocationState state)Invoked in response to alocation refresh request.voidonTimeout(TableDataRequest request)Invoked when the specified request timed out before a response was received.protected voidpostActivationHook()Method to override in order to observe successful activation.voidrefresh()Initialize or refresh state information about the list of existing locations.StringtoStringDetailed()Optional toString path with more implementation detail.Methods inherited from class com.illumon.iris.db.v2.locations.AbstractTableLocationProviderdeliverInitialSnapshot, doInitialization, ensureInitialized, getLog, getNamespace, getTableKey, getTableLocationIfPresent, getTableLocations, getTableName, getTableType, handleTableLocationKey, handleTableLocationKey, isInitialized, mark, maybeReloadLocation, refreshAndRescan, removeTableLocationKey, removeUnvisited, setInitialized, toStringMethods inherited from class com.illumon.iris.db.v2.locations.SubscriptionAggregatoractivationFailed, activationSuccessful, subscribe, supportsSubscriptions, unsubscribeMethods inherited from class java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface com.illumon.iris.db.v2.locations.TableKeyappend, asTableIdentifier, toStringHelper, toStringSimple, writeToMethods inherited from interface com.illumon.iris.db.v2.locations.TableLocationProvidergetTableLocation, getTableLocation, refreshAndRescan, subscribe, supportsSubscriptions, unsubscribe
- 
Method Details- 
getImplementationNameDescription copied from interface:NamedImplementationGet a name for the implementing class. Useful for abstract classes that implement LogOutputAppendableor overridetoString.The default implementation is correct, but not suitable for high-frequency usage. - Specified by:
- getImplementationNamein interface- NamedImplementation
- Returns:
- A name for the implementing class
 
- 
activateUnderlyingDataSourceprotected void activateUnderlyingDataSource()Description copied from class:SubscriptionAggregatorRefresh and activate update pushing from the implementing class. If the implementation will deliver notifications in a different thread than the one that calls this method, then this method must be asynchronous - that is, it must not block pending delivery of results. This requirement holds even if that other thread has nothing to do with the initial activation request! Listeners should guard against duplicate notifications, especially if the implementation delivers synchronous notifications. The implementation should call activationSuccessful() when done activating and delivering initial refresh results, unless activationFailed() was called instead. Must be called under the subscription lock. - Overrides:
- activateUnderlyingDataSourcein class- SubscriptionAggregator<TableLocationProvider.Listener>
 
- 
deactivateUnderlyingDataSourceprotected void deactivateUnderlyingDataSource()Description copied from class:SubscriptionAggregatorDeactivate pushed updates from the implementing class. Must be called under the subscription lock.- Overrides:
- deactivateUnderlyingDataSourcein class- SubscriptionAggregator<TableLocationProvider.Listener>
 
- 
matchSubscriptionTokenprotected <T> boolean matchSubscriptionToken(T token)Description copied from class:SubscriptionAggregatorVerify that a notification pertains to a currently-active subscription. Must be called under the subscription lock.- Overrides:
- matchSubscriptionTokenin class- SubscriptionAggregator<TableLocationProvider.Listener>
- Parameters:
- token- A subscription-related object that the subclass can use to match a notification
- Returns:
- True iff notification delivery should proceed
 
- 
postActivationHookprotected void postActivationHook()Description copied from class:SubscriptionAggregatorMethod to override in order to observe successful activation.- Overrides:
- postActivationHookin class- SubscriptionAggregator<TableLocationProvider.Listener>
 
- 
refreshpublic void refresh()Description copied from interface:TableLocationProviderInitialize or refresh state information about the list of existing locations.- Specified by:
- refreshin interface- TableLocationProvider
 
- 
makeTableLocationDescription copied from class:AbstractTableLocationProviderMake a new implementation-appropriate TableLocation from the supplied key.- Specified by:
- makeTableLocationin class- AbstractTableLocationProvider
- Parameters:
- locationKey- The table location key
- Returns:
- The new TableLocation
 
- 
getNameDescription copied from interface:TableLocationProviderallow TableLocationProvider instances to have names.- Specified by:
- getNamein interface- TableLocationProvider
 
- 
toStringDetailedDescription copied from interface:TableKeyOptional toString path with more implementation detail.- Specified by:
- toStringDetailedin interface- TableKey
- Returns:
- detailed conversion to string
 
- 
onTimeoutDescription copied from interface:RequestResultHandlerInvoked when the specified request timed out before a response was received.- Specified by:
- onTimeoutin interface- RequestResultHandler
- Parameters:
- request- the request object.
 
- 
onRejectionpublic void onRejection(@NotNull TableDataRequest request, String rejectionMessage, TableDataProtocol.RequestRejectionType requestRejectionType)Description copied from interface:RequestResultHandlerInvoked when the specified request was rejected. This typically happens during subscription to a location- Specified by:
- onRejectionin interface- RequestResultHandler
- Parameters:
- request- the request object.
- rejectionMessage- a message for context about the rejection
- requestRejectionType- what type of rejection was received
 
- 
onCompleteDescription copied from interface:RequestResultHandlerInvoked when the request completed successfully.- Specified by:
- onCompletein interface- RequestResultHandler
- Parameters:
- request- the request object
 
- 
onTableLocationKeyDescription copied from interface:RequestResultHandlerInvoked in response to atable locations requestfor each discoveredTableLocationKey.- Specified by:
- onTableLocationKeyin interface- RequestResultHandler
- Parameters:
- locationKey- the discovered- TableLocationKey
 
- 
onTableLocationStateDescription copied from interface:RequestResultHandlerInvoked in response to alocation refresh request.- Specified by:
- onTableLocationStatein interface- RequestResultHandler
- Parameters:
- state- the updated- TableLocationStatefor the location requested
 
- 
checkHasSubscriberspublic boolean checkHasSubscribers()Description copied from class:SubscriptionAggregatorCheck if this subscription aggregator still has any valid subscribers - useful if there may have been no notifications delivered for some time, as a test to determine whether work should be done to maintain the underlying subscription.- Specified by:
- checkHasSubscribersin interface- RequestResultHandler
- Overrides:
- checkHasSubscribersin class- SubscriptionAggregator<TableLocationProvider.Listener>
- Returns:
- true if there are valid subscribers, else false
 
 
-