Package com.illumon.iris.db.v2.routing
Interface DataRoutingService
- All Superinterfaces:
AutoCloseable
,ClaimsProvider
,EndpointResolver
,NamedImplementation
,SafeCloseable
,StorageLookup
- All Known Subinterfaces:
DataRoutingService.NonListening
,WritableDataRoutingService
,WritableDataRoutingServiceInternal
- All Known Implementing Classes:
DataRoutingService.Delegating
,DataRoutingServiceCachingImpl
,DataRoutingServiceK8sImpl
,DataRoutingServiceKvEtcdImpl
,DataRoutingServiceKvImpl
,DataRoutingServiceKvInMemImpl
,DataRoutingServiceYmlImpl
,DataRoutingServiceYmlImpl.ResolvingImpl
,InvalidDataRoutingService
public interface DataRoutingService
extends EndpointResolver, NamedImplementation, SafeCloseable, StorageLookup, ClaimsProvider
Interfaces for a Data Routing Service. This service provides configuration for:
- DataImportService servers
- Tailers
- Loggers
- TableDataService Proxies
- Workers
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic interface
Interface that defines an endpoint that if not currently realized will be realized in futurestatic class
Delegate method calls to an implementation object.static interface
Defines a usable network addressstatic interface
Configuration for resolving an endpoint.static interface
A DataRoutingService that implements the change listening methods, does publish configuration changes to listeners.static class
Exception used to indicate that a dynamic endpoint is not ready.static class
Implementation of "no properties".static interface
Provides access to "other" configuration properties for several interfaces. -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final String
This TableDataService name is guaranteed to exist if storage is configured on the requesting host.static final String
This TableDataService name represents the default TableDataService configuration name for (remote) query servers.static final String
Default configuration entrystatic final String
static final String
Table data services marked with this tag will be presented as choices in the Merge Persistent Query Configuration editor.static final DataRoutingService.NullPropertyProvider
Singleton "no properties" provider.static final String
static final String
Table data services marked with this tag are suitable as choices in query contexts (no UI tie-in at this point).static final String
No service registry is in usestatic final String
Use the service registry service to register services and resolve service addressesstatic final String
static final String
This property will override the table data service configuration name requested by most processes.static final String[]
This array of property names can be used to bridge between previous and current property names.static final String
static final String
Table data services marked with this tag will be presented as choices in the Validate Persistent Query Configuration editor. -
Method Summary
Modifier and TypeMethodDescriptionabout()
Information about a DataRoutingService instance.Serialize the data routing as a YAML string.default boolean
Authenticate using default authentication.default boolean
authenticate
(String user, String password) Authenticate using the given user and password.default boolean
authenticate
(String user, String password, String operateAs) Authenticate using the given user and password, operating as the operateAs user.default Collection<? extends DataImportServiceConfig>
Get all DIS configs.getAllDataImportServiceConfigs
(boolean excludeCoreConfigs) Get all DIS configs, optionally excluding core configs (those defined in the main routing yml file) For consumption by administrative tools.default Collection<? extends DataImportServiceConfig.DeferredEndpoint>
Get all known DataImportServer destinations as Deferred Endpoints.Collection<? extends DataImportServiceConfig.EndpointConfig>
Get all known DataImportServer destination configs.default Collection<? extends DataImportServiceConfig.Endpoint>
Get all known DataImportServer destinations.Collection<? extends LogAggregatorConfig>
Return all log aggregator configurations.Get DIS parameters for this named DIS instance.default DataImportServiceConfig
getDataImportServiceConfigWithStorage
(String name, String storageRoot) Get DIS parameters for this named DIS instance, providing a storage location.default Collection<? extends DataImportServiceConfig.DeferredEndpoint>
getDataImportServiceDeferredDestinations
(TableIdentifier tableIdentifier) Get Deferred DIS destinations for a table key.Collection<? extends DataImportServiceConfig.EndpointConfig>
getDataImportServiceDestinationConfigs
(TableIdentifier tableIdentifier) Get DIS destination configs for a table key.default Collection<? extends DataImportServiceConfig.Endpoint>
getDataImportServiceDestinations
(TableIdentifier tableIdentifier) Get DIS destinations for a table key.default DataRoutingService
This is a workaround for TableDataService construction.getLogAggregatorConfig
(String configName) Get configuration for the named log aggregator service instance.getLogAggregatorDeferredDestination
(TableIdentifier tableIdentifier) Get the single Deferred LAS destination for the given table key.default LogAggregatorConfig.Endpoint
getLogAggregatorDestination
(TableIdentifier tableIdentifier) Get the single LAS destination for the given table key.getLogAggregatorDestinationConfig
(TableIdentifier tableIdentifier) Get the single LAS destination configuration for the given table key.Information needed to configure a table data service server.Collection<? extends TableDataServiceConfig>
Get all known table data service configurations.static boolean
isServiceRegistryTypeValid
(String serviceRegistryType) Verify that a string represents a valid service registry type.long
listen
(DataRoutingConfigListener listener) Add a listener for changes to the DataRoutingService configuration.boolean
removeListener
(DataRoutingConfigListener listener) Remove the given listener from the list of listeners.boolean
Probe the implementation to find out if change notification is supported.Methods inherited from interface com.illumon.iris.db.v2.routing.filter.claims.ClaimsProvider
getCollectedClaims, registerClaims
Methods inherited from interface com.illumon.iris.db.v2.routing.endpoint.EndpointResolver
resolveLogAggregatorEndpoint, resolveTableDataEndpoint, resolveTailerEndpoint
Methods inherited from interface com.illumon.util.type.NamedImplementation
getImplementationName
Methods inherited from interface com.illumon.util.SafeCloseable
close
Methods inherited from interface com.illumon.iris.db.v2.routing.dynamicdis.StorageLookup
getStorage
-
Field Details
-
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
This TableDataService name represents the default TableDataService configuration name for (remote) query servers.- See Also:
-
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
This array of property names can be used to bridge between previous and current property names. -
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
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
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
Default configuration entry- See Also:
-
SERVICE_REGISTRY_NONE
No service registry is in use- See Also:
-
SERVICE_REGISTRY_SERVICE
Use the service registry service to register services and resolve service addresses- See Also:
-
HOST_TAG
- See Also:
-
PORT_TAG
- See Also:
-
TAILER_PORT_TAG
- See Also:
-
TABLE_DATA_PORT_TAG
- See Also:
-
NULL_PROPERTY_PROVIDER
Singleton "no properties" provider.
-
-
Method Details
-
isServiceRegistryTypeValid
Verify that a string represents a valid service registry type.- Parameters:
serviceRegistryType
- the service registry type string to check- Returns:
- true if the string is a registry type
-
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 howeverAuthenticationClientManager.getDefault()
has been authenticated.- Returns:
- true only if the authentication succeeded
-
authenticate
Authenticate using the given user and password. Implementations are not required to allow re-authentication.- Parameters:
user
- the user to authenticatepassword
- 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 authenticatepassword
- the password for the useroperateAs
- attempt to operate as this effective user- Returns:
- true only if the authentication succeeded
-
getDataImportServiceConfig
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 namestorageRoot
- 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
- orDataRoutingService.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.
-
getAllDataImportServiceConfigs
Get all DIS configs. For consumption by administrative tools.- Returns:
- a collection of all DIS configs
-
getAllDataImportServiceConfigs
@NotNull Map<String,DataImportServiceConfig> getAllDataImportServiceConfigs(boolean excludeCoreConfigs) Get all DIS configs, optionally excluding core configs (those defined in the main routing yml file) For consumption by administrative tools.- Parameters:
excludeCoreConfigs
- if true, exclude core configs- Returns:
- a possibly empty collection of all/non-core DIS configs
-
getAllDataImportServiceDestinations
@NotNull default Collection<? extends DataImportServiceConfig.Endpoint> getAllDataImportServiceDestinations() throws IOExceptionGet 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
- orDataRoutingService.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
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
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
- orDataRoutingService.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
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
Get all known table data service configurations. The data includes name description and tags.- Returns:
- all known TableDataServiceConfigs
-
asYamlString
Serialize the data routing as a YAML string. Internal use only.- Returns:
- YAML representation of the configuration
-
supportsChangeNotification
boolean supportsChangeNotification()Probe the implementation to find out if change notification is supported.- Returns:
- true if change notifications are supported.
-
listen
Add a listener for changes to the DataRoutingService configuration.- Parameters:
listener
- configuration change notices will be published to this listener- Returns:
- the current configuration version
- Throws:
UnsupportedOperationException
- if this implementation does not support change notification
-
removeListener
Remove the given listener from the list of listeners.- Parameters:
listener
- the listener to remove- Returns:
- true if a listener was removed, false if it could not be found or could not be removed
-
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
-