Package org.apache.hadoop.hbase.client
Class TableDescriptorBuilder
java.lang.Object
org.apache.hadoop.hbase.client.TableDescriptorBuilder
Convenience class for composing an instance of
TableDescriptor.- Since:
- 2.0.0
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classTODO: make this private after removing the HTableDescriptor -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringUsed by HBase Shell interface to access this metadata attribute which denotes if the table is compaction enabled.private static final Bytesprivate static final Patternprivate static final Stringprivate static final Patternprivate static final Stringprivate static final PatternPattern that matches a coprocessor specification.static final booleanConstant that denotes whether the table is compaction enabled by defaultprivate static final DurabilityDefault durability for HTD is USE_DEFAULT, which defaults to HBase-global default valueprivate static final Stringstatic final longConstant that denotes the maximum default size of the memstore in bytes after which the contents are flushed to the store files.static final booleanConstant that denotes whether the table is merge enabled by defaultstatic final booleanDeprecated.private static final intRelative priority of the table used for rpc schedulingstatic final booleanConstant that denotes whether the table is READONLY by default and is falsestatic final booleanstatic final intstatic final booleanConstant that denotes whether the table is split enabled by defaultprivate final TableDescriptorBuilder.ModifyableTableDescriptorstatic final StringDurabilitysetting for the table.private static final Bytesstatic final StringIf non-null, the HDFS erasure coding policy to set on the data dir of the tableprivate static final Bytesstatic final Stringprivate static final Bytesstatic final StringUsed by rest interface to access this metadata attribute which denotes if it is a catalog table, eitherhbase:meta.private static final Bytesstatic final org.slf4j.Loggerstatic final StringUsed by HBase Shell interface to access this metadata attribute which denotes the maximum size of the store file after which a region split occurs.private static final Bytesstatic final StringUsed by HBase Shell interface to access this metadata attribute which represents the maximum size of the memstore after which its contents are flushed onto the disk.private static final Bytesstatic final StringUsed by HBase Shell interface to access this metadata attribute which denotes if the table is merge enabled.private static final Bytesstatic final byte[]static final Stringstatic final byte[]static final TableDescriptorTable descriptor for namespace tablestatic final StringUsed by shell/rest interface to access this metadata attribute which denotes if the table should be treated by region normalizer.private static final Bytesstatic final Stringprivate static final Bytesstatic final StringDeprecated.private static final BytesDeprecated.static final Stringprivate static final Bytesstatic final Stringstatic final Bytesstatic final Stringprivate static final Bytesstatic final StringUsed by rest interface to access this metadata attribute which denotes if the table is Read Only.private static final Bytesstatic final StringThe flag to indicate whether or not the memstore should be replicated for read-replicas (CONSISTENCY => TIMELINE).private static final Bytesstatic final StringThe number of region replicas for the table.private static final Bytesprivate static final Bytesstatic final StringUsed by HBase Shell interface to access this metadata attribute which denotes if the table is split enabled.private static final Bytesstatic final Stringprivate static final Bytes -
Constructor Summary
ConstructorsModifierConstructorDescriptionprivateprivate -
Method Summary
Modifier and TypeMethodDescriptionDeprecated.As of release 2.0.0, this will be removed in HBase 3.0.0.addCoprocessor(String className) Deprecated.As of release 2.0.0, this will be removed in HBase 3.0.0.addCoprocessor(String className, org.apache.hadoop.fs.Path jarFilePath, int priority, Map<String, String> kvs) Deprecated.As of release 2.0.0, this will be removed in HBase 3.0.0.addCoprocessorWithSpec(String specStr) Deprecated.As of release 2.0.0, this will be removed in HBase 3.0.0.build()static TableDescriptorcopy(TableDescriptor desc) static TableDescriptorcopy(TableName name, TableDescriptor desc) static PrettyPrinter.Unitstatic TableDescriptorBuildernewBuilder(TableDescriptor desc) Copy all values, families, and name from the input.static TableDescriptorBuildernewBuilder(TableName name) static TableDescriptorparseFrom(byte[] pbBytes) The input should be created bytoByteArray(org.apache.hadoop.hbase.client.TableDescriptor).removeColumnFamily(byte[] name) removeCoprocessor(String className) removeValue(byte[] key) removeValue(String key) removeValue(Bytes key) setColumnFamilies(Collection<ColumnFamilyDescriptor> families) setCompactionEnabled(boolean isEnable) setCoprocessor(String className) setCoprocessor(CoprocessorDescriptor cpDesc) setCoprocessors(Collection<CoprocessorDescriptor> cpDescs) setDurability(Durability durability) setErasureCodingPolicy(String policy) setFlushPolicyClassName(String clazz) setMaxFileSize(long maxFileSize) setMaxFileSize(String maxFileSize) setMemStoreFlushSize(long memstoreFlushSize) setMemStoreFlushSize(String memStoreFlushSize) setMergeEnabled(boolean isEnable) setNormalizationEnabled(boolean isEnable) setNormalizerTargetRegionCount(int regionCount) setNormalizerTargetRegionSize(long regionSize) Deprecated.since 2.0.0 and will be removed in 3.0.0.setOwnerString(String ownerString) Deprecated.since 2.0.0 and will be removed in 3.0.0.setPriority(int priority) setReadOnly(boolean readOnly) setRegionMemStoreReplication(boolean memstoreReplication) setRegionReplication(int regionReplication) setRegionServerGroup(String group) Set the RSGroup for this table, specified RSGroup must exist before create or modify table.setReplicationScope(int scope) Sets replication scope all & only the columns already in the builder.setSplitEnabled(boolean isEnable) setValue(byte[] key, byte[] value) static byte[]toByteArray(TableDescriptor desc) Returns This instance serialized with pb with pb magic prefixprivate static Optional<CoprocessorDescriptor>
-
Field Details
-
LOG
-
SPLIT_POLICY
- See Also:
-
SPLIT_POLICY_KEY
-
MAX_FILESIZE
Used by HBase Shell interface to access this metadata attribute which denotes the maximum size of the store file after which a region split occurs.- See Also:
-
MAX_FILESIZE_KEY
-
OWNER
- See Also:
-
OWNER_KEY
-
READONLY
Used by rest interface to access this metadata attribute which denotes if the table is Read Only.- See Also:
-
READONLY_KEY
-
COMPACTION_ENABLED
Used by HBase Shell interface to access this metadata attribute which denotes if the table is compaction enabled.- See Also:
-
COMPACTION_ENABLED_KEY
-
SPLIT_ENABLED
Used by HBase Shell interface to access this metadata attribute which denotes if the table is split enabled.- See Also:
-
SPLIT_ENABLED_KEY
-
MERGE_ENABLED
Used by HBase Shell interface to access this metadata attribute which denotes if the table is merge enabled.- See Also:
-
MERGE_ENABLED_KEY
-
MEMSTORE_FLUSHSIZE
Used by HBase Shell interface to access this metadata attribute which represents the maximum size of the memstore after which its contents are flushed onto the disk.- See Also:
-
MEMSTORE_FLUSHSIZE_KEY
-
FLUSH_POLICY
- See Also:
-
FLUSH_POLICY_KEY
-
IS_META
Used by rest interface to access this metadata attribute which denotes if it is a catalog table, eitherhbase:meta.- See Also:
-
IS_META_KEY
-
DURABILITY
Durabilitysetting for the table.- See Also:
-
DURABILITY_KEY
-
REGION_REPLICATION
The number of region replicas for the table.- See Also:
-
REGION_REPLICATION_KEY
-
REGION_MEMSTORE_REPLICATION
The flag to indicate whether or not the memstore should be replicated for read-replicas (CONSISTENCY => TIMELINE).- See Also:
-
REGION_MEMSTORE_REPLICATION_KEY
-
ERASURE_CODING_POLICY
If non-null, the HDFS erasure coding policy to set on the data dir of the table- See Also:
-
ERASURE_CODING_POLICY_KEY
-
DEFAULT_ERASURE_CODING_POLICY
-
NORMALIZATION_ENABLED
Used by shell/rest interface to access this metadata attribute which denotes if the table should be treated by region normalizer.- See Also:
-
NORMALIZATION_ENABLED_KEY
-
DEFAULT_NORMALIZATION_ENABLED
Deprecated.- See Also:
-
NORMALIZER_TARGET_REGION_COUNT
- See Also:
-
NORMALIZER_TARGET_REGION_COUNT_KEY
-
NORMALIZER_TARGET_REGION_SIZE_MB
- See Also:
-
NORMALIZER_TARGET_REGION_SIZE_MB_KEY
-
NORMALIZER_TARGET_REGION_SIZE
Deprecated.- See Also:
-
NORMALIZER_TARGET_REGION_SIZE_KEY
Deprecated. -
DEFAULT_DURABLITY
Default durability for HTD is USE_DEFAULT, which defaults to HBase-global default value -
PRIORITY
- See Also:
-
PRIORITY_KEY
-
RSGROUP_KEY
-
DEFAULT_PRIORITY
Relative priority of the table used for rpc scheduling- See Also:
-
DEFAULT_READONLY
Constant that denotes whether the table is READONLY by default and is false- See Also:
-
DEFAULT_COMPACTION_ENABLED
Constant that denotes whether the table is compaction enabled by default- See Also:
-
DEFAULT_SPLIT_ENABLED
Constant that denotes whether the table is split enabled by default- See Also:
-
DEFAULT_MERGE_ENABLED
Constant that denotes whether the table is merge enabled by default- See Also:
-
DEFAULT_MEMSTORE_FLUSH_SIZE
Constant that denotes the maximum default size of the memstore in bytes after which the contents are flushed to the store files.- See Also:
-
DEFAULT_REGION_REPLICATION
- See Also:
-
DEFAULT_REGION_MEMSTORE_REPLICATION
- See Also:
-
DEFAULT_VALUES
-
RESERVED_KEYWORDS
-
NAMESPACE_FAMILY_INFO
- See Also:
-
NAMESPACE_FAMILY_INFO_BYTES
-
NAMESPACE_COL_DESC_BYTES
-
CP_HTD_ATTR_VALUE_PATTERN
Pattern that matches a coprocessor specification. Form is:
<coprocessor jar file location> '|' <class name> ['|' <priority> ['|' <arguments>]]where arguments are<KEY> '=' <VALUE> [,...]For example:hdfs:///foo.jar|com.foo.FooRegionObserver|1001|arg1=1,arg2=2 -
CP_HTD_ATTR_VALUE_PARAM_KEY_PATTERN
- See Also:
-
CP_HTD_ATTR_VALUE_PARAM_VALUE_PATTERN
- See Also:
-
CP_HTD_ATTR_VALUE_PARAM_PATTERN
-
CP_HTD_ATTR_KEY_PATTERN
-
NAMESPACE_TABLEDESC
Table descriptor for namespace table -
desc
-
-
Constructor Details
-
TableDescriptorBuilder
-
TableDescriptorBuilder
-
-
Method Details
-
getUnit
-
toByteArray
Returns This instance serialized with pb with pb magic prefix -
parseFrom
The input should be created bytoByteArray(org.apache.hadoop.hbase.client.TableDescriptor).- Parameters:
pbBytes- A pb serialized TableDescriptor instance with pb magic prefix- Returns:
- This instance serialized with pb with pb magic prefix
- Throws:
DeserializationException- if an error occurred
-
newBuilder
-
copy
-
copy
-
newBuilder
Copy all values, families, and name from the input.- Parameters:
desc- The desciptor to copy- Returns:
- A clone of input
-
addCoprocessor
Deprecated.As of release 2.0.0, this will be removed in HBase 3.0.0. UsesetCoprocessor(String)instead- Throws:
IOException
-
addCoprocessor
@Deprecated public TableDescriptorBuilder addCoprocessor(String className, org.apache.hadoop.fs.Path jarFilePath, int priority, Map<String, String> kvs) throws IOExceptionDeprecated.As of release 2.0.0, this will be removed in HBase 3.0.0. UsesetCoprocessor(CoprocessorDescriptor)instead- Throws:
IOException
-
addCoprocessorWithSpec
Deprecated.As of release 2.0.0, this will be removed in HBase 3.0.0. UsesetCoprocessor(CoprocessorDescriptor)instead- Throws:
IOException
-
addColumnFamily
Deprecated.As of release 2.0.0, this will be removed in HBase 3.0.0. UsesetColumnFamily(ColumnFamilyDescriptor)instead -
setCoprocessor
- Throws:
IOException
-
setCoprocessor
- Throws:
IOException
-
setCoprocessors
public TableDescriptorBuilder setCoprocessors(Collection<CoprocessorDescriptor> cpDescs) throws IOException - Throws:
IOException
-
setColumnFamily
-
setColumnFamilies
-
modifyColumnFamily
-
removeValue
-
removeValue
-
removeValue
-
removeColumnFamily
-
removeCoprocessor
-
setCompactionEnabled
-
setSplitEnabled
-
setMergeEnabled
-
setDurability
-
setFlushPolicyClassName
-
setMaxFileSize
-
setMaxFileSize
- Throws:
HBaseException
-
setMemStoreFlushSize
-
setMemStoreFlushSize
- Throws:
HBaseException
-
setNormalizerTargetRegionCount
-
setNormalizerTargetRegionSize
-
setNormalizationEnabled
-
setOwner
Deprecated.since 2.0.0 and will be removed in 3.0.0.Set the table owner- See Also:
-
setOwnerString
Deprecated.since 2.0.0 and will be removed in 3.0.0.Set the table owner- See Also:
-
setPriority
-
setReadOnly
-
setErasureCodingPolicy
-
setRegionMemStoreReplication
-
setRegionReplication
-
setRegionSplitPolicyClassName
-
setValue
-
setValue
-
setValue
-
getValue
-
setReplicationScope
Sets replication scope all & only the columns already in the builder. Columns added later won't be backfilled with replication scope.- Parameters:
scope- replication scope- Returns:
- a TableDescriptorBuilder
-
setRegionServerGroup
Set the RSGroup for this table, specified RSGroup must exist before create or modify table.- Parameters:
group- rsgroup name- Returns:
- a TableDescriptorBuilder
-
build
-
toCoprocessorDescriptor
-