Interface DataRoutingService

All Superinterfaces:
AutoCloseable, EndpointResolver, NamedImplementation, SafeCloseable
All Known Subinterfaces:
WritableDataRoutingService, WritableDataRoutingServiceImpl
All Known Implementing Classes:
DataRoutingService.Delegating, DataRoutingServiceK8sImpl, DataRoutingServiceKvEtcdImpl, DataRoutingServiceKvImpl, DataRoutingServiceKvInMemImpl, DataRoutingServiceYmlImpl, DataRoutingServiceYmlImpl.ResolvingImpl

public interface DataRoutingService extends EndpointResolver, NamedImplementation, SafeCloseable
Interfaces for a Data Routing Service. This service provides configuration for:
  • DataImportService servers
  • Tailers
  • Loggers
  • TableDataService Proxies
  • Workers
  • Field Details

    • DEFAULT_LOCAL_TABLE_DATA_SERVICE

      static final String DEFAULT_LOCAL_TABLE_DATA_SERVICE
      This TableDataService name is guaranteed to exist if storage is configured on the requesting host.
      See Also:
    • DEFAULT_QUERY_SERVER_TABLE_DATA_SERVICE

      static final String DEFAULT_QUERY_SERVER_TABLE_DATA_SERVICE
      This TableDataService name represents the default TableDataService configuration name for (remote) query servers.
      See Also:
    • TABLE_DATA_SERVICE_CONFIG_PROP

      static final String TABLE_DATA_SERVICE_CONFIG_PROP
      This property will override the table data service configuration name requested by most processes.
      See Also:
    • TABLE_DATA_SERVICE_CONFIG_PROPS_WITH_LEGACY

      static final String[] TABLE_DATA_SERVICE_CONFIG_PROPS_WITH_LEGACY
      This array of property names can be used to bridge between previous and current property names.
    • MERGE_QUERY_TDS_TAG

      static final String MERGE_QUERY_TDS_TAG
      Table data services marked with this tag will be presented as choices in the Merge Persistent Query Configuration editor.
      See Also:
    • VALIDATE_QUERY_TDS_TAG

      static final String VALIDATE_QUERY_TDS_TAG
      Table data services marked with this tag will be presented as choices in the Validate Persistent Query Configuration editor.
      See Also:
    • QUERY_QUERY_TDS_TAG

      static final String QUERY_QUERY_TDS_TAG
      Table data services marked with this tag are suitable as choices in query contexts (no UI tie-in at this point).
      See Also:
    • DEFAULT_SELECTION_TAG

      static final String DEFAULT_SELECTION_TAG
      Default configuration entry
      See Also:
    • SERVICE_REGISTRY_NONE

      static final String SERVICE_REGISTRY_NONE
      No service registry is in use
      See Also:
    • SERVICE_REGISTRY_SERVICE

      static final String SERVICE_REGISTRY_SERVICE
      Use the service registry service to register services and resolve service addresses
      See Also:
    • HOST_TAG

      static final String HOST_TAG
      See Also:
    • PORT_TAG

      static final String PORT_TAG
      See Also:
    • TAILER_PORT_TAG

      static final String TAILER_PORT_TAG
      See Also:
    • TABLE_DATA_PORT_TAG

      static final String TABLE_DATA_PORT_TAG
      See Also:
    • NULL_PROPERTY_PROVIDER

      static final DataRoutingService.NullPropertyProvider NULL_PROPERTY_PROVIDER
      Singleton "no properties" provider.
  • Method Details

    • about

      String about()
      Information about a DataRoutingService instance. Useful for debugging.
      Returns:
      a string containing information about the instance
    • authenticate

      default boolean authenticate()
      Authenticate using default authentication. This will be using the default private key or however AuthenticationClientManager.getDefault() has been authenticated.
      Returns:
      true only if the authentication succeeded
    • authenticate

      default boolean authenticate(@NotNull String user, @NotNull String password)
      Authenticate using the given user and password. Implementations are not required to allow re-authentication.
      Parameters:
      user - the user to authenticate
      password - the password for the user
      Returns:
      true only if the authentication succeeded
    • authenticate

      default boolean authenticate(@NotNull String user, @NotNull String password, @NotNull String operateAs)
      Authenticate using the given user and password, operating as the operateAs user. Implementations are not required to allow re-authentication.
      Parameters:
      user - the user to authenticate
      password - the password for the user
      operateAs - attempt to operate as this effective user
      Returns:
      true only if the authentication succeeded
    • getDataImportServiceConfig

      @Nullable DataImportServiceConfig getDataImportServiceConfig(@NotNull String name)
      Get DIS parameters for this named DIS instance. For consumption by a DIS instance or TableDataService consumer.
      Parameters:
      name - DIS configuration name
      Returns:
      the configuration for the named DIS, or null if it does not exist.
    • getDataImportServiceConfigWithStorage

      @Nullable default DataImportServiceConfig getDataImportServiceConfigWithStorage(@NotNull String name, @NotNull String storageRoot)
      Get DIS parameters for this named DIS instance, providing a storage location. For consumption by a DIS instance or TableDataService consumer.
      This method expects the named DIS configuration to have storage specified as "private", indicating the consumer will configure and provide the storage location.
      Parameters:
      name - DIS configuration name
      storageRoot - the storage root supplied by the consumer instead of
      Returns:
      the configuration for the named DIS, or null if it does not exist.
      Throws:
      DataRoutingConfigurationException - if the named DIS config has storage configured
    • getDataImportServiceDestinations

      @NotNull default Collection<? extends DataImportServiceConfig.Endpoint> getDataImportServiceDestinations(@NotNull TableIdentifier tableIdentifier) throws IOException
      Get DIS destinations for a table key. For consumption by a Tailer.
      Parameters:
      tableIdentifier - the identifier of the data to be logged
      Returns:
      a possibly empty collection of DIS destinations that should receive data for the given table.
      Throws:
      IOException - or DataRoutingService.NotReadyException if any destination cannot be fully resolved
      ImplNote:
      : this delegates to EndpointResolver.resolveTailerEndpoint(DataImportServiceConfig.EndpointConfig) to resolve the EndpointConfig into an Endpoint.
    • getDataImportServiceDeferredDestinations

      @NotNull default Collection<? extends DataImportServiceConfig.DeferredEndpoint> getDataImportServiceDeferredDestinations(@NotNull TableIdentifier tableIdentifier)
      Get Deferred DIS destinations for a table key. For consumption by a Tailer.
      Parameters:
      tableIdentifier - the identifier of the data to be logged
      Returns:
      a possibly empty collection of Deferred DIS destinations that should receive data for the given table.
      ImplNote:
      : this delegates to EndpointResolver.resolveTailerEndpoint(DataImportServiceConfig.EndpointConfig) to resolve the EndpointConfig into a DeferredEndpoint.
    • getDataImportServiceDestinationConfigs

      @NotNull Collection<? extends DataImportServiceConfig.EndpointConfig> getDataImportServiceDestinationConfigs(@NotNull TableIdentifier tableIdentifier)
      Get DIS destination configs for a table key. For consumption by a Tailer.
      Parameters:
      tableIdentifier - the identifier of the data to be logged
      Returns:
      a possibly empty collection of DIS destinations that should receive data for the given table.
    • getAllDataImportServiceDestinations

      @NotNull default Collection<? extends DataImportServiceConfig.Endpoint> getAllDataImportServiceDestinations() throws IOException
      Get all known DataImportServer destinations. All destinations will have an enabled tailer port. For consumption by a Tailer.
      Returns:
      a possibly null collection of all known DIS destinations.
      Throws:
      IOException - or DataRoutingService.NotReadyException if any destination cannot be fully resolved
      ImplNote:
      by default, this delegates to EndpointResolver.resolveTailerEndpoint(DataImportServiceConfig.EndpointConfig) to resolve the EndpointConfig into an Endpoint.
    • getAllDataImportServiceDeferredDestinations

      @NotNull default Collection<? extends DataImportServiceConfig.DeferredEndpoint> getAllDataImportServiceDeferredDestinations()
      Get all known DataImportServer destinations as Deferred Endpoints. For consumption by a Tailer. All destinations will have an enabled tailer port.
      Returns:
      a possibly null collection of all known Deferred DIS destinations.
      ImplNote:
      by default, this delegates to EndpointResolver.resolveTailerEndpoint(DataImportServiceConfig.EndpointConfig) to resolve the EndpointConfig into a DeferredEndpoint.
    • getAllDataImportServiceDestinationConfigs

      @NotNull Collection<? extends DataImportServiceConfig.EndpointConfig> getAllDataImportServiceDestinationConfigs()
      Get all known DataImportServer destination configs. This includes destination configs with disabled tailer ports. For consumption by a Tailer.
      Returns:
      a possibly null collection of all known DIS destinations.
      ImplNote:
      by default, this delegates to EndpointResolver.resolveTailerEndpoint(DataImportServiceConfig.EndpointConfig) to resolve the EndpointConfig into an Endpoint.
    • getLogAggregatorConfig

      @Nullable LogAggregatorConfig getLogAggregatorConfig(@NotNull String configName)
      Get configuration for the named log aggregator service instance.
      Parameters:
      configName - the LAS configuration name
      Returns:
      the configuration for the named log aggregator, no null if it does not exist
    • getAllLogAggregatorServiceConfigs

      @NotNull Collection<? extends LogAggregatorConfig> getAllLogAggregatorServiceConfigs()
      Return all log aggregator configurations.
      Returns:
      a collection of all configured log aggregators.
    • getLogAggregatorDestination

      @Nullable default LogAggregatorConfig.Endpoint getLogAggregatorDestination(@NotNull TableIdentifier tableIdentifier) throws IOException
      Get the single LAS destination for the given table key.
      Parameters:
      tableIdentifier - the identifier of the data to be logged
      Returns:
      the LogAggregatorEndpointConfig for the given tableIdentifier, or null if none match the key.
      Throws:
      IOException - or DataRoutingService.NotReadyException if the destination cannot be fully resolved
      ImplNote:
      by default, this delegates to EndpointResolver.resolveLogAggregatorEndpoint(LogAggregatorConfig.EndpointConfig) to resolve the EndpointConfig into an Endpoint.
    • getLogAggregatorDeferredDestination

      @Nullable default LogAggregatorConfig.DeferredEndpoint getLogAggregatorDeferredDestination(@NotNull TableIdentifier tableIdentifier)
      Get the single Deferred LAS destination for the given table key.
      Parameters:
      tableIdentifier - the identifier of the data to be logged
      Returns:
      the LogAggregatorEndpointConfig for the given tableIdentifier, or null if none match the key.
      ImplNote:
      by default, this delegates to EndpointResolver.resolveLogAggregatorEndpoint(LogAggregatorConfig.EndpointConfig) to resolve the EndpointConfig into a DeferredEndpoint.
    • getLogAggregatorDestinationConfig

      @Nullable LogAggregatorConfig.EndpointConfig getLogAggregatorDestinationConfig(@NotNull TableIdentifier tableIdentifier)
      Get the single LAS destination configuration for the given table key.
      Parameters:
      tableIdentifier - the identifier of the data to be logged
      Returns:
      the LogAggregatorEndpoint for the given tableIdentifier, or null if none match the key.
    • getTableDataServiceConfig

      @Nullable TableDataServiceConfig getTableDataServiceConfig(@NotNull String name)
      Information needed to configure a table data service server. For use by a TableDataService provider (LocalTableDataServer, TableDataCacheProxy).
      Parameters:
      name - configuration name
      Returns:
      the named TableDataServiceConfig, or null if not found.
    • getTableDataServiceConfigs

      @NotNull Collection<? extends TableDataServiceConfig> getTableDataServiceConfigs()
      Get all known table data service configurations. The data includes name description and tags.
      Returns:
      all known TableDataServiceConfigs
    • asYamlString

      @NotNull String asYamlString()
      Serialize the data routing as a YAML string. Internal use only.
      Returns:
      YAML representation of the configuration
    • getLocalInstance

      default DataRoutingService getLocalInstance()
      This is a workaround for TableDataService construction. The TableDataServiceFactory makes a bunch of recursive calls to get all the constituent TableDataService parts, and it is not desirable or correct to send all those requests to a remote service.
      Returns:
      a local DataRoutingService
    • getCollectedClaims

      CollectedClaims getCollectedClaims()