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 TypeClassDescriptionprivate static final class -
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 defaultprivate 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[]Deprecated.namespace table has been folded into the ns family in meta table, do not use this any more.static final StringDeprecated.namespace table has been folded into the ns family in meta table, do not use this any more.static final byte[]Deprecated.namespace table has been folded into the ns family in meta table, do not use this any more.static final TableDescriptorDeprecated.since 3.0.0 and will be removed in 4.0.0.static 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 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 TypeMethodDescriptionbuild()static TableDescriptorcopy(TableDescriptor desc) static TableDescriptorcopy(TableName name, TableDescriptor desc) static PrettyPrinter.UnitbooleanhasCoprocessor(String classNameToMatch) static 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(BiPredicate<Bytes, Bytes> predicate) 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) setPriority(int priority) setReadOnly(boolean readOnly) setRegionMemStoreReplication(boolean memstoreReplication) setRegionReplication(int regionReplication) setRegionServerGroup(String group) 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>This method is mostly intended for internal use.
-
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
-
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
-
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
Deprecated.namespace table has been folded into the ns family in meta table, do not use this any more.- See Also:
-
NAMESPACE_FAMILY_INFO_BYTES
Deprecated.namespace table has been folded into the ns family in meta table, do not use this any more. -
NAMESPACE_COL_DESC_BYTES
Deprecated.namespace table has been folded into the ns family in meta table, do not use this any more. -
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
Deprecated.since 3.0.0 and will be removed in 4.0.0. We have folded the data in namespace table into meta table, so do not use it any more.Table descriptor for namespace table- See Also:
-
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
-
setCoprocessor
- Throws:
IOException
-
setCoprocessor
- Throws:
IOException
-
setCoprocessors
public TableDescriptorBuilder setCoprocessors(Collection<CoprocessorDescriptor> cpDescs) throws IOException - Throws:
IOException
-
hasCoprocessor
-
setColumnFamily
-
setColumnFamilies
-
modifyColumnFamily
-
removeValue
-
removeValue
-
removeValue
-
removeValue
-
removeColumnFamily
-
removeCoprocessor
-
setCompactionEnabled
-
setSplitEnabled
-
setMergeEnabled
-
setDurability
-
setFlushPolicyClassName
-
setMaxFileSize
-
setMaxFileSize
- Throws:
HBaseException
-
setMemStoreFlushSize
-
setMemStoreFlushSize
- Throws:
HBaseException
-
setNormalizerTargetRegionCount
-
setNormalizerTargetRegionSize
-
setNormalizationEnabled
-
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
-
build
-
toCoprocessorDescriptor
This method is mostly intended for internal use. However, it it also relied on by hbase-shell for backwards compatibility.
-