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
public class CopyTableSchema extends Schema.Delegating
An immutable schema that is based of a copy of another, overriding the namespace and table name and namespace set.
- See Also:
- Serialized Form
-
Nested Class Summary
Nested classes/interfaces inherited from interface com.illumon.iris.db.schema.Schema
Schema.AbstractSchema, Schema.Delegating -
Constructor Summary
Constructors Constructor Description CopyTableSchema(String namespace, String tableName, Schema source)Create a CopyTableSchema with the given namespace and table name, delegating to the given Schema. -
Method Summary
Modifier and Type Method Description SchemagetDelegate()SchemagetImmutable()Get an immutable copy of thisSchema.MutableSchemagetMutable()Get a mutable copy of thisSchema.StringgetNamespace()NamespaceSetgetNamespaceSet()Note: as of Treasure, it is not possible to create a User CopyTable without directly inserting it into etcd.TableDefinitiongetTableDefinition()StringgetTableName()Methods inherited from class com.illumon.iris.db.schema.Schema.Delegating
getAttributes, getAttributeValue, getColumnDescriptions, getDataIndexSets, getDefaultMergeFormat, getImportSource, getImportSources, getImportSources, getListeners, getLoggers, getMergeCodecName, getPartitionKeyFormula, getTableDescription, getTableType, getValidator, getVersion, hasListeners, hasLoggers
-
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
-