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 Schema
getDelegate()
Schema
getImmutable()
Get an immutable copy of thisSchema
.MutableSchema
getMutable()
Get a mutable copy of thisSchema
.String
getNamespace()
NamespaceSet
getNamespaceSet()
Note: as of Treasure, it is not possible to create a User CopyTable without directly inserting it into etcd.TableDefinition
getTableDefinition()
String
getTableName()
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 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
-