Package com.illumon.iris.db.schema
Class SchemaServiceFactory
java.lang.Object
com.illumon.iris.db.schema.SchemaServiceFactory
Factory class providing access to the schema service to allow retrieval and manipulation of table schemata.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enum
Relationship of the current code with the Deephaven system. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic SchemaService
Create a new system default SchemaService, based on the default Configuration.static SchemaService
getDefault
(com.fishlib.configuration.Configuration configuration) Create a new system default SchemaService, based on the given Configuration.Return a cached and settable default ConnectionMode.getDefaultConnectionMode
(com.fishlib.configuration.Configuration configuration) Determine the connection mode to a Deephaven system, based on the given Configuration.static SchemaService
getEmptyTransientInstance
(com.fishlib.configuration.Configuration configuration) Create a service that will accept schemas and return them, but will not persist anything.Get the default etcd-backed SchemaService singleton.getEtcdInstance
(com.fishlib.configuration.Configuration configuration) Create an etcd-backed SchemaService singleton using the given configuration.static Schema
getImmutable
(Schema schema) Factory method that allows the implementation class to stay private.static Schema
getImmutable
(Schema schema, boolean alreadyDetached) Factory method that allows the implementation class to stay private.static SchemaService
getLocalInstance
(com.fishlib.configuration.Configuration configuration, String directory) Create a read-only service.static SchemaService
Get a new client for Schema Service.static SchemaService
getServiceInstance
(com.fishlib.configuration.Configuration configuration) Get a new client for Schema Service.static SchemaService
getTransientInstance
(com.fishlib.configuration.Configuration configuration) Create a read-only service initialized with schema files from the legacy configuration settings.static void
setDefaultConnectionMode
(SchemaServiceFactory.ConnectionMode newConnectionMode) Delegate togetDefault(Configuration)
with the default Configuration.
-
Constructor Details
-
SchemaServiceFactory
public SchemaServiceFactory()
-
-
Method Details
-
getDefaultConnectionMode
Return a cached and settable default ConnectionMode. By default, set by delegating togetDefault(Configuration)
with the default Configuration.- Returns:
- the default ConnectionMode of the system
-
setDefaultConnectionMode
public static void setDefaultConnectionMode(@NotNull SchemaServiceFactory.ConnectionMode newConnectionMode) Delegate togetDefault(Configuration)
with the default Configuration.- Parameters:
newConnectionMode
- a new default ConnectionMode for the system
-
getDefaultConnectionMode
public static SchemaServiceFactory.ConnectionMode getDefaultConnectionMode(@NotNull com.fishlib.configuration.Configuration configuration) Determine the connection mode to a Deephaven system, based on the given Configuration.- Parameters:
configuration
- the Configuration to use- Returns:
- the default ConnectionMode of the system
-
getDefault
Create a new system default SchemaService, based on the default Configuration.- Returns:
- a default SchemaService instance
-
getDefault
public static SchemaService getDefault(@NotNull com.fishlib.configuration.Configuration configuration) Create a new system default SchemaService, based on the given Configuration.- Parameters:
configuration
- the Configuration to use- Returns:
- a default SchemaService instance
-
getEtcdInstance
Get the default etcd-backed SchemaService singleton.- Returns:
- a SchemaService
-
getEtcdInstance
public static SchemaServiceAuthenticatedMutator getEtcdInstance(@NotNull com.fishlib.configuration.Configuration configuration) Create an etcd-backed SchemaService singleton using the given configuration.- Parameters:
configuration
- the configuration to use- Returns:
- a SchemaService
-
getServiceInstance
Get a new client for Schema Service.- Returns:
- a SchemaService
-
getServiceInstance
public static SchemaService getServiceInstance(@NotNull com.fishlib.configuration.Configuration configuration) Get a new client for Schema Service.- Parameters:
configuration
- the configuration to use- Returns:
- a SchemaService
-
getTransientInstance
public static SchemaService getTransientInstance(@NotNull com.fishlib.configuration.Configuration configuration) Create a read-only service initialized with schema files from the legacy configuration settings. All mutating methods will throw an UnsupportedOperationException.- Parameters:
configuration
- the configuration to use- Returns:
- a SchemaService
-
getEmptyTransientInstance
public static SchemaService getEmptyTransientInstance(@NotNull com.fishlib.configuration.Configuration configuration) Create a service that will accept schemas and return them, but will not persist anything. Do not initialize it with any schemas.- Parameters:
configuration
- the configuration to use- Returns:
- a SchemaService
-
getLocalInstance
public static SchemaService getLocalInstance(@NotNull com.fishlib.configuration.Configuration configuration, @Nullable String directory) Create a read-only service. Initialize with schema files from a single location, and throw a runtime exception if any of those files have errors.- Parameters:
configuration
- the configuration to usedirectory
- the single directory to search for schema files (if null, use the value of the LocalTransientSchemaService#SOURCE_DIRECTORY_PROPERTY property- Returns:
- a SchemaService
-
getImmutable
Factory method that allows the implementation class to stay private.- Parameters:
schema
- source schema to make immutable- Returns:
- an immutable schema, per
Schema.getImmutable()
rules.
-
getImmutable
Factory method that allows the implementation class to stay private.- Parameters:
schema
- source schema to make immutablealreadyDetached
- true indicates that the source schema is safe to use as-is- Returns:
- an immutable schema, per
Schema.getImmutable()
rules.
-