Class TableDataServiceFactory
java.lang.Object
com.illumon.iris.db.v2.tabledataservice.TableDataServiceFactory
- All Implemented Interfaces:
DynamicResolverMixin
,EndpointResolver
public class TableDataServiceFactory extends Object implements DynamicResolverMixin
The standard factory for creating
TableDataService
instances using a DataRoutingService
instance-
Nested Class Summary
Nested classes/interfaces inherited from interface com.illumon.iris.db.v2.routing.endpoint.DynamicResolverMixin
DynamicResolverMixin.DeferredDISEndpointServiceRegistryImpl, DynamicResolverMixin.DeferredEndpointServiceRegistryImpl, DynamicResolverMixin.DeferredLASEndpointServiceRegistryImpl
-
Field Summary
Fields Modifier and Type Field Description static long
DEFAULT_TABLE_DATA_SERVICE_REQUEST_TIMEOUT_MILLIS
protected com.fishlib.io.logger.Logger
log
-
Constructor Summary
Constructors Constructor Description TableDataServiceFactory(DataRoutingService routingService)
Create aTableDataServiceFactory
using theDataRoutingService
as configuration. -
Method Summary
Modifier and Type Method Description TableDataService
getOrCreateTableDataService(TableDataServiceConfig tableDataServiceConfig, boolean forProducer, boolean allowIOMessageFlush)
Create the TableDataService starting with an actualTableDataServiceConfig
instanceTableDataService
getOrCreateTableDataService(String tdsName, boolean allowIOMessageFlush, boolean forProducer)
Get aTableDataService
based on the routing instructions provided by theDataRoutingService
provided at construction time.protected RemoteTableDataService
makeRemoteTableDataService(com.fishlib.io.sched.Scheduler scheduler, com.fishlib.io.logger.Logger log, String name, long requestTimeoutMillis, boolean supportsSubscriptions, boolean allowIOMessageFlush)
Create a newRemoteTableDataService
, allowing for subclass overrides for testing.protected RemoteTableDataService
makeRemoteTableDataService(String serviceName, DataRoutingService.PropertyProvider properties, boolean allowIOMessageFlush)
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, wait
Methods 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:
- Constant Field Values
-
log
protected final com.fishlib.io.logger.Logger log
-
-
Constructor Details
-
TableDataServiceFactory
Create aTableDataServiceFactory
using theDataRoutingService
as configuration.- Parameters:
routingService
- theDataRoutingService
-
-
Method Details
-
getOrCreateTableDataService
public TableDataService getOrCreateTableDataService(@NotNull String tdsName, boolean allowIOMessageFlush, boolean forProducer) throws IOExceptionGet aTableDataService
based on the routing instructions provided by theDataRoutingService
provided 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 resultantTableDataService
is for a producer such as aTDCP
- Returns:
- a
TableDataService
which may or may not be a complex composition of other services. - Throws:
IOException
-
getOrCreateTableDataService
@NotNull public TableDataService getOrCreateTableDataService(@NotNull TableDataServiceConfig tableDataServiceConfig, boolean forProducer, boolean allowIOMessageFlush) throws IOExceptionCreate the TableDataService starting with an actualTableDataServiceConfig
instance- Parameters:
tableDataServiceConfig
- theTableDataServiceConfig
instance (from the map)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.allowIOMessageFlush
- boolean to be passed to Remote TDS. Should be false for queries. This is needed because this method is called recursively.- Returns:
- a
TableDataService
as configured - Throws:
DataRoutingConfigurationException
- if the configuration is invalidIOException
-
makeRemoteTableDataService
@TestUseOnly protected RemoteTableDataService makeRemoteTableDataService(@NotNull com.fishlib.io.sched.Scheduler scheduler, @NotNull com.fishlib.io.logger.Logger log, @NotNull String name, long requestTimeoutMillis, boolean supportsSubscriptions, boolean allowIOMessageFlush)Create a newRemoteTableDataService
, allowing for subclass overrides for testing.- Parameters:
scheduler
- Job schedulerlog
- Logger for outputname
- Remote service namerequestTimeoutMillis
- The timeout value to use for all requestssupportsSubscriptions
- Whether the service underlying the theTableDataServiceExporter
we connect to supports subscriptionsallowIOMessageFlush
- allow synchronous flush of message buffers- Returns:
- a new
RemoteTableDataService
, ready to be connected
-
makeRemoteTableDataService
protected RemoteTableDataService makeRemoteTableDataService(@NotNull String serviceName, @NotNull DataRoutingService.PropertyProvider properties, boolean allowIOMessageFlush)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 buffers- Returns:
- a new
RemoteTableDataService
, ready to be connected
-