Class TableDataServiceFactory

java.lang.Object
com.illumon.iris.db.v2.tabledataservice.TableDataServiceFactory
All Implemented Interfaces:
DynamicResolverMixin, EndpointResolver

public class TableDataServiceFactory extends Object implements DynamicResolverMixin
A factory for creating TableDataService instances.
  • 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 testMode
      In test mode, ignore remote connections; used for testing.
  • Constructor Details

  • Method Details

    • getLocalRoutingService

      protected DataRoutingService getLocalRoutingService()
    • createTableDataService

      @Nullable public TableDataService createTableDataService(@NotNull String tdsName, boolean allowIOMessageFlush, boolean forProducer) throws IOException
      Create a TableDataService by name, starting by getting the named configuration from the DataRoutingService.
      Parameters:
      tdsName - the name of the TableDataService to create
      allowIOMessageFlush - 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 TableDataService as configured
      Throws:
      DataRoutingConfigurationException - if the configuration is invalid
      IOException - if there is an error connecting to a remote service
    • makeRemoteTableDataService

      protected RemoteTableDataService makeRemoteTableDataService(@NotNull String serviceName, @NotNull RemoteTableDataServiceDescriptor rtdsConfiguration) throws IOException
      Create a new RemoteTableDataService, allowing for subclass overrides for testing. This override assumes some of the parameters needed to construct a RemoteTableDataService. Connect to the remote service if not in test mode.
      Parameters:
      serviceName - the name to give the remote service
      rtdsConfiguration - all information required to configure and connect this RTDS
      Returns:
      a new, possibly connected, RemoteTableDataService
      Throws:
      IOException
    • forTesting

      public TableDataServiceFactory 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