Class DataRoutingServiceYmlImpl
java.lang.Object
com.illumon.iris.db.v2.routing.impl.yaml.DataRoutingServiceYmlImpl
- All Implemented Interfaces:
DataRoutingService
,EndpointResolver
,SafeCloseable
,NamedImplementation
,AutoCloseable
- Direct Known Subclasses:
DataRoutingServiceYmlImpl.ResolvingImpl
public abstract class DataRoutingServiceYmlImpl extends Object implements DataRoutingService
Reads data routing instructions from a YAML file.
This class parses and manages configuration, but does not know how to resolve client or server endpoints.
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
DataRoutingServiceYmlImpl.ResolvingImpl
Nested classes/interfaces inherited from interface com.illumon.iris.db.v2.routing.DataRoutingService
DataRoutingService.DeferredEndpoint, DataRoutingService.Delegating, DataRoutingService.Endpoint, DataRoutingService.EndpointConfig, DataRoutingService.NotReadyException, DataRoutingService.NullPropertyProvider, DataRoutingService.PropertyProvider
-
Field Summary
Fields inherited from interface com.illumon.iris.db.v2.routing.DataRoutingService
DEFAULT_LOCAL_TABLE_DATA_SERVICE, DEFAULT_QUERY_SERVER_TABLE_DATA_SERVICE, DEFAULT_SELECTION_TAG, HOST_TAG, MERGE_QUERY_TDS_TAG, NULL_PROPERTY_PROVIDER, PORT_TAG, QUERY_QUERY_TDS_TAG, SERVICE_REGISTRY_NONE, SERVICE_REGISTRY_SERVICE, TABLE_DATA_PORT_TAG, TABLE_DATA_SERVICE_CONFIG_PROP, TABLE_DATA_SERVICE_CONFIG_PROPS_WITH_LEGACY, TAILER_PORT_TAG, VALIDATE_QUERY_TDS_TAG
-
Constructor Summary
Constructors Modifier Constructor Description protected
DataRoutingServiceYmlImpl(String sourceIdentifier)
Protected constructor.protected
DataRoutingServiceYmlImpl(String originalInput, InputStream ymlStream)
This is useful for testing. -
Method Summary
Modifier and Type Method Description String
about()
Information about a DataRoutingService instance.String
asYamlString()
This gets the input YAML, saved so it can be sent via grpc.void
close()
static Filter
createFilter(Object ymlFilterSpecObj, String context)
Factory method for creating aFilter
from yml input.Collection<? extends DataImportServiceConfig.EndpointConfig>
getAllDataImportServiceDestinationConfigs()
Get all known DataImportServer destination configs.Collection<? extends LogAggregatorConfig>
getAllLogAggregatorServiceConfigs()
Return all log aggregator configurations.DataImportServiceConfig
getDataImportServiceConfig(String name)
Get DIS parameters for this named DIS instance.Collection<? extends DataImportServiceConfig.EndpointConfig>
getDataImportServiceDestinationConfigs(TableIdentifier tableIdentifier)
Get DIS destination configs for a table key.String
getImplementationName()
Get a name for the implementing class.LogAggregatorConfig
getLogAggregatorConfig(String name)
Get configuration for the named log aggregator service instance.LogAggregatorConfig.EndpointConfig
getLogAggregatorDestinationConfig(TableIdentifier tableIdentifier)
Get the single LAS destination configuration for the given table key.TableDataServiceConfig
getTableDataServiceConfig(String name)
Information needed to configure a table data service server.Collection<? extends TableDataServiceConfig>
getTableDataServiceConfigs()
Get all known table data service configurations.void
parseFile(String filename)
Open a file and delegate to the stream parser.String
toString()
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface com.illumon.iris.db.v2.routing.DataRoutingService
authenticate, authenticate, authenticate, getAllDataImportServiceDeferredDestinations, getAllDataImportServiceDestinations, getDataImportServiceDeferredDestinations, getDataImportServiceDestinations, getLogAggregatorDeferredDestination, getLogAggregatorDestination
Methods inherited from interface com.illumon.iris.db.v2.routing.endpoint.EndpointResolver
resolveLogAggregatorEndpoint, resolveTableDataEndpoint, resolveTailerEndpoint
-
Constructor Details
-
DataRoutingServiceYmlImpl
Protected constructor. Subclasses must call parse() in their constructors.- Parameters:
sourceIdentifier
- identifier for this instance
-
DataRoutingServiceYmlImpl
This is useful for testing. It's only called from a factory method.- Parameters:
originalInput
- the input data, to be returned from asYamlStringymlStream
- the stream to parse.
-
-
Method Details
-
createFilter
@NotNull public static Filter createFilter(@Nullable Object ymlFilterSpecObj, @NotNull String context)Factory method for creating aFilter
from yml input.- Parameters:
ymlFilterSpecObj
- the raw yml chunk.context
- string for context in the possible exception- Returns:
- a valid
Filter
based on the yml spec.
-
about
Description copied from interface:DataRoutingService
Information about a DataRoutingService instance. Useful for debugging.- Specified by:
about
in interfaceDataRoutingService
- Returns:
- a string containing information about the instance
-
getDataImportServiceConfig
Description copied from interface:DataRoutingService
Get DIS parameters for this named DIS instance. For consumption by a DIS instance or TableDataService consumer.- Specified by:
getDataImportServiceConfig
in interfaceDataRoutingService
- Parameters:
name
- DIS configuration name- Returns:
- the configuration for the named DIS, or null if it does not exist.
-
getDataImportServiceDestinationConfigs
@NotNull public Collection<? extends DataImportServiceConfig.EndpointConfig> getDataImportServiceDestinationConfigs(@NotNull TableIdentifier tableIdentifier)Description copied from interface:DataRoutingService
Get DIS destination configs for a table key. For consumption by a Tailer.- Specified by:
getDataImportServiceDestinationConfigs
in interfaceDataRoutingService
- 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.
-
getAllDataImportServiceDestinationConfigs
@NotNull public Collection<? extends DataImportServiceConfig.EndpointConfig> getAllDataImportServiceDestinationConfigs()Description copied from interface:DataRoutingService
Get all known DataImportServer destination configs. For consumption by a Tailer.- Specified by:
getAllDataImportServiceDestinationConfigs
in interfaceDataRoutingService
- Returns:
- a possibly null collection of all known DIS destinations.
-
getLogAggregatorConfig
Description copied from interface:DataRoutingService
Get configuration for the named log aggregator service instance.- Specified by:
getLogAggregatorConfig
in interfaceDataRoutingService
- Parameters:
name
- the LAS configuration name- Returns:
- the configuration for the named log aggregator, no null if it does not exist
-
getLogAggregatorDestinationConfig
@Nullable public LogAggregatorConfig.EndpointConfig getLogAggregatorDestinationConfig(@NotNull TableIdentifier tableIdentifier)Description copied from interface:DataRoutingService
Get the single LAS destination configuration for the given table key.- Specified by:
getLogAggregatorDestinationConfig
in interfaceDataRoutingService
- Parameters:
tableIdentifier
- the identifier of the data to be logged- Returns:
- the LogAggregatorEndpoint for the given tableIdentifier, or null if none match the key.
-
getAllLogAggregatorServiceConfigs
Description copied from interface:DataRoutingService
Return all log aggregator configurations.- Specified by:
getAllLogAggregatorServiceConfigs
in interfaceDataRoutingService
- Returns:
- a collection of all configured log aggregators.
-
getTableDataServiceConfig
Description copied from interface:DataRoutingService
Information needed to configure a table data service server. For use by a TableDataService provider (LocalTableDataServer
,TableDataCacheProxy
).- Specified by:
getTableDataServiceConfig
in interfaceDataRoutingService
- Parameters:
name
- configuration name- Returns:
- the named TableDataServiceConfig, or null if not found.
-
getTableDataServiceConfigs
Description copied from interface:DataRoutingService
Get all known table data service configurations. The data includes name description and tags.- Specified by:
getTableDataServiceConfigs
in interfaceDataRoutingService
- Returns:
- all known TableDataServiceConfigs
-
asYamlString
This gets the input YAML, saved so it can be sent via grpc.- Specified by:
asYamlString
in interfaceDataRoutingService
- Returns:
- YAML representation of the configuration
-
getImplementationName
Description copied from interface:NamedImplementation
Get a name for the implementing class. Useful for abstract classes that implement
LogOutputAppendable
or overridetoString
.The default implementation is correct, but not suitable for high-frequency usage.
- Specified by:
getImplementationName
in interfaceNamedImplementation
- Returns:
- A name for the implementing class
-
close
public void close()- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceSafeCloseable
-
parseFile
Open a file and delegate to the stream parser.- Parameters:
filename
- the filename to read. Resources on the classpath will be searched.- Throws:
IOException
- if the file can't be found or processed.
-
toString
-