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
  • Constructor Details

  • Method Details

    • getTableDataServiceConfig

      @Nullable public TableDataServiceConfig getTableDataServiceConfig(@NotNull String name)
      Create a TableDataServiceConfig that 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

      protected DataRoutingService getLocalRoutingService()
    • createTableDataService

      @Nullable public TableDataService createTableDataService(@NotNull String tdsName, boolean allowIOMessageFlush, boolean forProducer) throws IOException
      Get a TableDataService based on the routing instructions provided by the DataRoutingService 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 create
      allowIOMessageFlush - pass-through to RemoteTableDataService: allow synchronous flush of message buffers
      forProducer - if the resultant TableDataService is for a producer such as a TDCP
      Returns:
      a TableDataService which 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.
      use createTableDataService(String, boolean, boolean) instead. This method does not produce a dynamic TableDataService.
      Parameters:
      tableDataServiceConfig - used only to get the name of the service
      allowIOMessageFlush - 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 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 DataRoutingService.PropertyProvider properties, boolean allowIOMessageFlush, @NotNull RoundRobinDeferredEndpointFunction roundRobinDeferredEndpointFunction)
      Create a new RemoteTableDataService, allowing for subclass overrides for testing. This override assumes some of the parameters needed to construct a RemoteTableDataService.
      Parameters:
      serviceName - The name to give the remote service
      properties - provider of property values that might be used by TDS implementations
      allowIOMessageFlush - passthru to RemoteTableDataService: allow synchronous flush of message buffers
      roundRobinDeferredEndpointFunction - the address function to use for connecting
      Returns:
      a new RemoteTableDataService, ready to be connected
    • forTesting

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