Class SchemaServiceFactory

java.lang.Object
com.illumon.iris.db.schema.SchemaServiceFactory

public class SchemaServiceFactory extends Object
Factory class providing access to the schema service to allow retrieval and manipulation of table schemata.
  • Constructor Details

    • SchemaServiceFactory

      public SchemaServiceFactory()
  • Method Details

    • getDefaultConnectionMode

      public static SchemaServiceFactory.ConnectionMode getDefaultConnectionMode()
      Return a cached and settable default ConnectionMode. By default, set by delegating to getDefault(Configuration) with the default Configuration.
      Returns:
      the default ConnectionMode of the system
    • setDefaultConnectionMode

      public static void setDefaultConnectionMode(@NotNull SchemaServiceFactory.ConnectionMode newConnectionMode)
      Delegate to getDefault(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

      public static SchemaService 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

      public static SchemaServiceAuthenticatedMutator 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

      public static 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 use
      directory - the single directory to search for schema files (if null, use the value of the LocalTransientSchemaService#SOURCE_DIRECTORY_PROPERTY property
      Returns:
      a SchemaService
    • getImmutable

      public static Schema getImmutable(Schema schema)
      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

      public static Schema getImmutable(Schema schema, boolean alreadyDetached)
      Factory method that allows the implementation class to stay private.
      Parameters:
      schema - source schema to make immutable
      alreadyDetached - true indicates that the source schema is safe to use as-is
      Returns:
      an immutable schema, per Schema.getImmutable() rules.