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, hasLoggersMethods inherited from class com.illumon.iris.db.schema.Schema.AbstractSchema
toStringMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods 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 returnedmutableinstance 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
UnsupportedOperationExceptions.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:SchemaGet an immutable copy of thisSchema. May return itself if it is already immutable.- Returns:
- An immutable copy of this schema.
-
getNamespace
- Specified by:
getNamespacein interfaceTableDefinitionSchema- Overrides:
getNamespacein classSchema.Delegating- Returns:
- The namespace of the table
-
getTableName
- Specified by:
getTableNamein interfaceTableDefinitionSchema- Overrides:
getTableNamein 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:
getNamespaceSetin interfaceTableDefinitionSchema- Overrides:
getNamespaceSetin classSchema.Delegating- Returns:
- SYSTEM
-
getTableDefinition
- Specified by:
getTableDefinitionin interfaceTableDefinitionSchema- Overrides:
getTableDefinitionin classSchema.Delegating- Returns:
- The
TableDefinitioncorresponding to this Schema
-
getDelegate
- Overrides:
getDelegatein classSchema.Delegating
-