Package io.deephaven.configuration
Class DataRoutingConfigurationImpl
java.lang.Object
io.deephaven.configuration.ConfigurationImplBase
io.deephaven.configuration.DataRoutingConfigurationImpl
Tool for importing and exporting the routing configuration file.
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionprotected voidAdd the common authentication options to the option set field.protected void@Nullable StringeditString(@NotNull String input) Invoke an editor, such as vi, to edit the input string and "save" the output string.protected voidenforceAggregateKeyIssues(@NotNull List<String> errors) If any DIS location-key filters were flagged byfindAggregateKeyIssues(java.util.Collection<com.illumon.iris.db.v2.routing.DataImportServiceConfig>), log a warning for each.protected com.fishlib.configuration.ConfigurationDelay construction - in some cases (e.g.protected @NotNull WritableDataRoutingServicegetDataRoutingService(@NotNull org.apache.commons.cli.CommandLine commandLine) protected com.fishlib.io.logger.LoggerProvide access to the user-facing Logger as currently configured.protected voidprotected voidrequireSingular(@NotNull String option) Require that the option have a single value.protected StringrequireSingular(@NotNull String option, @NotNull List<String> values) Return the single value in the list, or throw an exception.intrun()protected voidsetConfiguration(com.fishlib.configuration.Configuration newConfiguration) Set the Configuration field.protected voidsetupRawConfig(@NotNull String appName, boolean diskProps, boolean etcdProps) Methods inherited from class io.deephaven.configuration.ConfigurationImplBase
setupConfiguration
-
Field Details
-
options
protected final org.apache.commons.cli.Options options -
cmdLineSyntax
-
action
-
commandLine
protected org.apache.commons.cli.CommandLine commandLine -
configuration
protected volatile com.fishlib.configuration.Configuration configuration -
commandLineArgs
-
-
Method Details
-
supportedActions
-
run
public int run() throws HelpExceptions.CommandLineException, ClientConnectionConfigProvider.ProviderException -
enforceAggregateKeyIssues
protected void enforceAggregateKeyIssues(@NotNull @NotNull List<String> errors) throws HelpExceptions.CommandLineException If any DIS location-key filters were flagged byfindAggregateKeyIssues(java.util.Collection<com.illumon.iris.db.v2.routing.DataImportServiceConfig>), log a warning for each. Each command will be failed unless--ignore-errorswas given ortransientIgnoreErrorsis set.- Parameters:
errors- a list of messages for filters that referenceInternalPartitionwithout handling theAggregateTableLocationKeyplaceholder- Throws:
HelpExceptions.CommandLineException- if any errors were found and neither--ignore-errorsnortransientIgnoreErrorsis set
-
getDataRoutingService
@NotNull protected @NotNull WritableDataRoutingService getDataRoutingService(@NotNull @NotNull org.apache.commons.cli.CommandLine commandLine) throws ClientConnectionConfigProvider.ProviderException -
getUserLog
protected com.fishlib.io.logger.Logger getUserLog()Provide access to the user-facing Logger as currently configured. An interactive user should see messages logged here.- Returns:
- the Logger
-
getConfiguration
protected com.fishlib.configuration.Configuration getConfiguration()Delay construction - in some cases (e.g. using etcd) the Configuration.getInstance() call needs to be managed to avoid the default use of configuration service.- Returns:
- the Configuration to use
-
setConfiguration
protected void setConfiguration(com.fishlib.configuration.Configuration newConfiguration) Set the Configuration field. This allows control of the implementation and sane error reporting. -
addAuthenticationOptions
protected void addAuthenticationOptions()Add the common authentication options to the option set field. -
addEditorOptions
protected void addEditorOptions() -
logAuditAction
protected void logAuditAction() -
setupRawConfig
protected void setupRawConfig(@NotNull @NotNull String appName, boolean diskProps, boolean etcdProps) -
requireSingular
protected void requireSingular(@NotNull @NotNull String option) throws HelpExceptions.CommandLineException Require that the option have a single value.- Parameters:
option- the option to check- Throws:
HelpExceptions.CommandLineException- if the option has multiple values
-
requireSingular
protected String requireSingular(@NotNull @NotNull String option, @NotNull @NotNull List<String> values) throws HelpExceptions.CommandLineException Return the single value in the list, or throw an exception.- Parameters:
option- the option to checkvalues- the values that were given for the option- Throws:
HelpExceptions.CommandLineException- if the option has multiple values or none
-
editString
@Nullable public @Nullable String editString(@NotNull @NotNull String input) throws HelpExceptions.HelpException Invoke an editor, such as vi, to edit the input string and "save" the output string.- Parameters:
input- the string to edit- Returns:
- the possibly-modified string, or null if the editor failed or was canceled
- Throws:
HelpExceptions.HelpException
-