Package com.illumon.iris.db.schema
Class CopyTableSchema
java.lang.Object
com.illumon.iris.db.schema.Schema.AbstractSchema
com.illumon.iris.db.schema.Schema.Delegating
com.illumon.iris.db.schema.CopyTableSchema
- All Implemented Interfaces:
com.fishlib.base.log.LogOutputAppendable
,Schema
,TableDefinitionSchema
,Serializable
An immutable schema that is based of a copy of another, overriding the namespace and table name and namespace set.
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from interface com.illumon.iris.db.schema.Schema
Schema.AbstractSchema, Schema.Delegating
-
Constructor Summary
ConstructorsConstructorDescriptionCopyTableSchema
(String namespace, String tableName, Schema source) Create a CopyTableSchema with the given namespace and table name, delegating to the given Schema. -
Method Summary
Methods inherited from class com.illumon.iris.db.schema.Schema.Delegating
getAttributes, getAttributeValue, getColumnDescriptions, getDataIndexSets, getDefaultMergeFormat, getExtendedStorage, getImportSource, getImportSources, getImportSources, getInputTableStateSpec, getListeners, getLoggers, getMergeCodecName, getPartitionKeyFormula, getStorageType, getTableDescription, getTableType, getTableTypeV2, getValidator, getVersion, hasListeners, hasLoggers
Methods inherited from class com.illumon.iris.db.schema.Schema.AbstractSchema
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.schema.TableDefinitionSchema
append
-
Constructor Details
-
CopyTableSchema
public CopyTableSchema(@NotNull String namespace, @NotNull String tableName, @NotNull Schema source) Create a CopyTableSchema with the given namespace and table name, delegating to the given Schema.- Parameters:
namespace
- namespace of the copytableName
- table name of the copysource
- the source Schema
-
-
Method Details
-
getMutable
Get a mutable copy of thisSchema
. The returned copy is guaranteed to be decoupled from this instance, That is, changes to the returnedmutable
instance will not affect this instance.
CopyTableSchema note:It doesn't make sense to mutate the delegate of a CopyTableSchema. Since this contract requires we return a MutableSchema, we have to break the delegation or violate the MutableSchema contract with
UnsupportedOperationException
s.This method on CopyTableSchema will return a MutableSchema based on the delegate.
If you want to change the namespace or tableName of the copy table schema, create a new one with the desired namespace and tableName.
- Returns:
- a MutableSchema based on the copy table delegate
-
getImmutable
Description copied from interface:Schema
Get an immutable copy of thisSchema
. May return itself if it is already immutable.- Returns:
- An immutable copy of this schema.
-
getNamespace
- Specified by:
getNamespace
in interfaceTableDefinitionSchema
- Overrides:
getNamespace
in classSchema.Delegating
- Returns:
- The namespace of the table
-
getTableName
- Specified by:
getTableName
in interfaceTableDefinitionSchema
- Overrides:
getTableName
in classSchema.Delegating
- Returns:
- The name of the table
-
getNamespaceSet
Note: as of Treasure, it is not possible to create a User CopyTable without directly inserting it into etcd.- Specified by:
getNamespaceSet
in interfaceTableDefinitionSchema
- Overrides:
getNamespaceSet
in classSchema.Delegating
- Returns:
- SYSTEM
-
getTableDefinition
- Specified by:
getTableDefinition
in interfaceTableDefinitionSchema
- Overrides:
getTableDefinition
in classSchema.Delegating
- Returns:
- The
TableDefinition
corresponding to this Schema
-
getDelegate
- Overrides:
getDelegate
in classSchema.Delegating
-