Class TableDataServiceFactory
java.lang.Object
com.illumon.iris.db.v2.tabledataservice.TableDataServiceFactory
- All Implemented Interfaces:
DynamicResolverMixin,EndpointResolver
A factory for creating
TableDataService instances.-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classEach top level creation of a TableDataService requires recursive calls with access to a consistent context.static classEncapsulate all the information needed to uniquely identify a TableDataServiceNested classes/interfaces inherited from interface com.illumon.iris.db.v2.routing.endpoint.DynamicResolverMixin
DynamicResolverMixin.DeferredDISEndpointServiceRegistryImpl, DynamicResolverMixin.DeferredEndpointServiceRegistryImpl, DynamicResolverMixin.DeferredLASEndpointServiceRegistryImpl -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final longprotected final com.fishlib.io.logger.Logger -
Constructor Summary
ConstructorsConstructorDescriptionTableDataServiceFactory(DataRoutingService routingService) Create a non-dynamicTableDataServiceFactoryusing theDataRoutingServiceas configuration.TableDataServiceFactory(DataRoutingService routingService, boolean dynamic) Create aTableDataServiceFactoryusing theDataRoutingServiceas configuration. -
Method Summary
Modifier and TypeMethodDescriptioncreateTableDataService(TableDataServiceConfig tableDataServiceConfig, boolean allowIOMessageFlush, boolean forProducer) Deprecated.createTableDataService(String tdsName, boolean allowIOMessageFlush, boolean forProducer) Get aTableDataServicebased on the routing instructions provided by theDataRoutingServiceprovided at construction time.Make TableDataServices for testing - do not make remote connections, and ignore the "RTDS" aspec of composing TDSs (i.e.protected DataRoutingServiceCreate aTableDataServiceConfigthat is fully formed and functional (i.e.protected RemoteTableDataServicemakeRemoteTableDataService(String serviceName, DataRoutingService.PropertyProvider properties, boolean allowIOMessageFlush, RoundRobinDeferredEndpointFunction roundRobinDeferredEndpointFunction) Create a newRemoteTableDataService, allowing for subclass overrides for testing.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.illumon.iris.db.v2.routing.endpoint.DynamicResolverMixin
resolveLogAggregatorEndpoint, resolveTableDataEndpoint, resolveTailerEndpoint
-
Field Details
-
DEFAULT_TABLE_DATA_SERVICE_REQUEST_TIMEOUT_MILLIS
public static final long DEFAULT_TABLE_DATA_SERVICE_REQUEST_TIMEOUT_MILLIS- See Also:
-
log
protected final com.fishlib.io.logger.Logger log
-
-
Constructor Details
-
TableDataServiceFactory
Create aTableDataServiceFactoryusing theDataRoutingServiceas configuration.- Parameters:
routingService- theDataRoutingServicedynamic- if true, listen for changes to the routing service and update dynamic TableDataServices
-
TableDataServiceFactory
Create a non-dynamicTableDataServiceFactoryusing theDataRoutingServiceas configuration.- Parameters:
routingService- theDataRoutingService
-
-
Method Details
-
getTableDataServiceConfig
Create aTableDataServiceConfigthat is fully formed and functional (i.e. also a valid TableDataService) For internal use only.- Parameters:
name- the name of the config to load- Returns:
- the named TableDataServiceConfig, or null if it does not exist.
-
getLocalRoutingService
-
createTableDataService
@Nullable public TableDataService createTableDataService(@NotNull String tdsName, boolean allowIOMessageFlush, boolean forProducer) throws IOException Get aTableDataServicebased on the routing instructions provided by theDataRoutingServiceprovided at construction time. The returned service may be new, or it may be a cached, previously created one.- Parameters:
tdsName- the name of the table data service to createallowIOMessageFlush- pass-through toRemoteTableDataService: allow synchronous flush of message buffersforProducer- if the resultantTableDataServiceis for a producer such as aTDCP- Returns:
- a
TableDataServicewhich may or may not be a complex composition of other services, or null if the named service does not exist. - Throws:
IOException- if there is an error connecting to a remote service
-
createTableDataService
@Deprecated @NotNull public TableDataService createTableDataService(@NotNull TableDataServiceConfig tableDataServiceConfig, boolean allowIOMessageFlush, boolean forProducer) throws IOException Deprecated.usecreateTableDataService(String, boolean, boolean)instead. This method does not produce a dynamic TableDataService.- Parameters:
tableDataServiceConfig- used only to get the name of the serviceallowIOMessageFlush- boolean to be passed to Remote TDS. Should be false for queries. This is needed because this method is called recursively.forProducer- the caller is a producer if true, else consumer. Consumers just connect to the config, producers connect to the embedded services and provide a remote TDS endpoint.- Returns:
- a
TableDataServiceas configured - Throws:
DataRoutingConfigurationException- if the configuration is invalidIOException- if there is an error connecting to a remote service
-
makeRemoteTableDataService
protected RemoteTableDataService makeRemoteTableDataService(@NotNull String serviceName, @NotNull DataRoutingService.PropertyProvider properties, boolean allowIOMessageFlush, @NotNull RoundRobinDeferredEndpointFunction roundRobinDeferredEndpointFunction) Create a newRemoteTableDataService, allowing for subclass overrides for testing. This override assumes some of the parameters needed to construct aRemoteTableDataService.- Parameters:
serviceName- The name to give the remote serviceproperties- provider of property values that might be used by TDS implementationsallowIOMessageFlush- passthru toRemoteTableDataService: allow synchronous flush of message buffersroundRobinDeferredEndpointFunction- the address function to use for connecting- Returns:
- a new
RemoteTableDataService, ready to be connected
-
forTesting
Make TableDataServices for testing - do not make remote connections, and ignore the "RTDS" aspec of composing TDSs (i.e. TDCP). For Deephaven internal use only.- Returns:
- this, for chaining
-
createTableDataService(String, boolean, boolean)instead.