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.Nested 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.Loggerprotected booleanIn test mode, ignore remote connections; used for testing. -
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(String tdsName, boolean allowIOMessageFlush, boolean forProducer) Create aTableDataServiceby name, starting by getting the named configuration from theDataRoutingService.Make TableDataServices for testing - do not make remote connections, and ignore the "RTDS" aspect of composing TDSs (i.e.protected DataRoutingServiceprotected RemoteTableDataServicemakeRemoteTableDataService(String serviceName, RemoteTableDataServiceDescriptor rtdsConfiguration) 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 -
testMode
protected volatile boolean testModeIn test mode, ignore remote connections; used for testing.
-
-
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
-
getLocalRoutingService
-
createTableDataService
@Nullable public TableDataService createTableDataService(@NotNull String tdsName, boolean allowIOMessageFlush, boolean forProducer) throws IOException Create aTableDataServiceby name, starting by getting the named configuration from theDataRoutingService.- Parameters:
tdsName- the name of theTableDataServiceto createallowIOMessageFlush- boolean to be passed to Remote TDS. Should be false for queries (because interruptions are expected).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 RemoteTableDataServiceDescriptor rtdsConfiguration) throws IOException Create a newRemoteTableDataService, allowing for subclass overrides for testing. This override assumes some of the parameters needed to construct aRemoteTableDataService. Connect to the remote service if not in test mode.- Parameters:
serviceName- the name to give the remote servicertdsConfiguration- all information required to configure and connect this RTDS- Returns:
- a new, possibly connected,
RemoteTableDataService - Throws:
IOException
-
forTesting
Make TableDataServices for testing - do not make remote connections, and ignore the "RTDS" aspect of composing TDSs (i.e. TDCP). For Deephaven internal use only.- Returns:
- this, for chaining
-