@InterfaceAudience.Private public static class ColumnFamilyDescriptorBuilder.ModifyableColumnFamilyDescriptor extends Object implements ColumnFamilyDescriptor, Comparable<ColumnFamilyDescriptorBuilder.ModifyableColumnFamilyDescriptor>
Modifier and Type | Field and Description |
---|---|
private Map<String,String> |
configuration
A map which holds the configuration specific to the column family.
|
private byte[] |
name |
private Map<Bytes,Bytes> |
values |
COMPARATOR, COMPARATOR_IGNORE_REPLICATION, REPLICATION_SCOPE_BYTES
Modifier | Constructor and Description |
---|---|
|
ModifyableColumnFamilyDescriptor(byte[] name)
Construct a column descriptor specifying only the family name The other
attributes are defaulted.
|
private |
ModifyableColumnFamilyDescriptor(byte[] name,
Map<Bytes,Bytes> values,
Map<String,String> config) |
|
ModifyableColumnFamilyDescriptor(ColumnFamilyDescriptor desc)
Constructor.
|
private final byte[] name
private final Map<String,String> configuration
@InterfaceAudience.Private public ModifyableColumnFamilyDescriptor(byte[] name)
name
- Column family name. Must be 'printable' -- digit or
letter -- and may not contain a :
TODO: make this private after the HCD is removed.@InterfaceAudience.Private public ModifyableColumnFamilyDescriptor(ColumnFamilyDescriptor desc)
desc
- The descriptor.public byte[] getName()
getName
in interface ColumnFamilyDescriptor
public String getNameAsString()
getNameAsString
in interface ColumnFamilyDescriptor
public Bytes getValue(Bytes key)
getValue
in interface ColumnFamilyDescriptor
key
- The key.public byte[] getValue(byte[] key)
getValue
in interface ColumnFamilyDescriptor
key
- The key.public Map<Bytes,Bytes> getValues()
ColumnFamilyDescriptor
getValues
in interface ColumnFamilyDescriptor
public ColumnFamilyDescriptorBuilder.ModifyableColumnFamilyDescriptor setValue(byte[] key, byte[] value)
key
- The key.value
- The value.public ColumnFamilyDescriptorBuilder.ModifyableColumnFamilyDescriptor setValue(String key, String value)
private ColumnFamilyDescriptorBuilder.ModifyableColumnFamilyDescriptor setValue(Bytes key, String value)
private ColumnFamilyDescriptorBuilder.ModifyableColumnFamilyDescriptor setValue(Bytes key, Bytes value)
key
- The key.value
- The value.public ColumnFamilyDescriptorBuilder.ModifyableColumnFamilyDescriptor removeValue(Bytes key)
key
- Key whose key and value we're to remove from HCD parameters.private static <T> Bytes toBytesOrNull(T t, Function<T,byte[]> f)
private <T> T getStringOrDefault(Bytes key, Function<String,T> function, T defaultValue)
private <T> T getOrDefault(Bytes key, Function<byte[],T> function, T defaultValue)
public int getMaxVersions()
getMaxVersions
in interface ColumnFamilyDescriptor
public ColumnFamilyDescriptorBuilder.ModifyableColumnFamilyDescriptor setMaxVersions(int maxVersions)
maxVersions
- maximum number of versionspublic ColumnFamilyDescriptorBuilder.ModifyableColumnFamilyDescriptor setVersions(int minVersions, int maxVersions)
minVersions
- minimal number of versionsmaxVersions
- maximum number of versionspublic int getBlocksize()
getBlocksize
in interface ColumnFamilyDescriptor
public ColumnFamilyDescriptorBuilder.ModifyableColumnFamilyDescriptor setBlocksize(int s)
s
- Blocksize to use when writing out storefiles/hfiles on this
column family.public Compression.Algorithm getCompressionType()
getCompressionType
in interface ColumnFamilyDescriptor
public ColumnFamilyDescriptorBuilder.ModifyableColumnFamilyDescriptor setCompressionType(Compression.Algorithm type)
type
- Compression type setting.public DataBlockEncoding getDataBlockEncoding()
getDataBlockEncoding
in interface ColumnFamilyDescriptor
public ColumnFamilyDescriptorBuilder.ModifyableColumnFamilyDescriptor setDataBlockEncoding(DataBlockEncoding type)
type
- What kind of data block encoding will be used.public ColumnFamilyDescriptorBuilder.ModifyableColumnFamilyDescriptor setCompressTags(boolean compressTags)
compressTags
- public boolean isCompressTags()
isCompressTags
in interface ColumnFamilyDescriptor
public Compression.Algorithm getCompactionCompressionType()
getCompactionCompressionType
in interface ColumnFamilyDescriptor
public ColumnFamilyDescriptorBuilder.ModifyableColumnFamilyDescriptor setCompactionCompressionType(Compression.Algorithm type)
type
- Compression type setting.public boolean isInMemory()
isInMemory
in interface ColumnFamilyDescriptor
public ColumnFamilyDescriptorBuilder.ModifyableColumnFamilyDescriptor setInMemory(boolean inMemory)
inMemory
- True if we are to favor keeping all values for this
column family in the HRegionServer cachepublic MemoryCompactionPolicy getInMemoryCompaction()
getInMemoryCompaction
in interface ColumnFamilyDescriptor
public ColumnFamilyDescriptorBuilder.ModifyableColumnFamilyDescriptor setInMemoryCompaction(MemoryCompactionPolicy inMemoryCompaction)
inMemoryCompaction
- the prefered in-memory compaction policy for
this column familypublic KeepDeletedCells getKeepDeletedCells()
getKeepDeletedCells
in interface ColumnFamilyDescriptor
public ColumnFamilyDescriptorBuilder.ModifyableColumnFamilyDescriptor setKeepDeletedCells(KeepDeletedCells keepDeletedCells)
keepDeletedCells
- True if deleted rows should not be collected
immediately.public boolean isNewVersionBehavior()
isNewVersionBehavior
in interface ColumnFamilyDescriptor
public ColumnFamilyDescriptorBuilder.ModifyableColumnFamilyDescriptor setNewVersionBehavior(boolean newVersionBehavior)
public int getTimeToLive()
getTimeToLive
in interface ColumnFamilyDescriptor
public ColumnFamilyDescriptorBuilder.ModifyableColumnFamilyDescriptor setTimeToLive(int timeToLive)
timeToLive
- Time-to-live of cell contents, in seconds.public ColumnFamilyDescriptorBuilder.ModifyableColumnFamilyDescriptor setTimeToLive(String timeToLive) throws HBaseException
timeToLive
- Time-to-live of cell contents, in seconds.HBaseException
public int getMinVersions()
getMinVersions
in interface ColumnFamilyDescriptor
public ColumnFamilyDescriptorBuilder.ModifyableColumnFamilyDescriptor setMinVersions(int minVersions)
minVersions
- The minimum number of versions to keep. (used when
timeToLive is set)public boolean isBlockCacheEnabled()
isBlockCacheEnabled
in interface ColumnFamilyDescriptor
public ColumnFamilyDescriptorBuilder.ModifyableColumnFamilyDescriptor setBlockCacheEnabled(boolean blockCacheEnabled)
blockCacheEnabled
- True if hfile DATA type blocks should be cached
(We always cache INDEX and BLOOM blocks; you cannot turn this off).public BloomType getBloomFilterType()
getBloomFilterType
in interface ColumnFamilyDescriptor
public ColumnFamilyDescriptorBuilder.ModifyableColumnFamilyDescriptor setBloomFilterType(BloomType bt)
public int getScope()
getScope
in interface ColumnFamilyDescriptor
public ColumnFamilyDescriptorBuilder.ModifyableColumnFamilyDescriptor setScope(int scope)
scope
- the scope tagpublic boolean isCacheDataOnWrite()
isCacheDataOnWrite
in interface ColumnFamilyDescriptor
public ColumnFamilyDescriptorBuilder.ModifyableColumnFamilyDescriptor setCacheDataOnWrite(boolean value)
value
- true if we should cache data blocks on writepublic boolean isCacheIndexesOnWrite()
isCacheIndexesOnWrite
in interface ColumnFamilyDescriptor
public ColumnFamilyDescriptorBuilder.ModifyableColumnFamilyDescriptor setCacheIndexesOnWrite(boolean value)
value
- true if we should cache index blocks on writepublic boolean isCacheBloomsOnWrite()
isCacheBloomsOnWrite
in interface ColumnFamilyDescriptor
public ColumnFamilyDescriptorBuilder.ModifyableColumnFamilyDescriptor setCacheBloomsOnWrite(boolean value)
value
- true if we should cache bloomfilter blocks on writepublic boolean isEvictBlocksOnClose()
isEvictBlocksOnClose
in interface ColumnFamilyDescriptor
public ColumnFamilyDescriptorBuilder.ModifyableColumnFamilyDescriptor setEvictBlocksOnClose(boolean value)
value
- true if we should evict cached blocks from the blockcache on
closepublic boolean isPrefetchBlocksOnOpen()
isPrefetchBlocksOnOpen
in interface ColumnFamilyDescriptor
public ColumnFamilyDescriptorBuilder.ModifyableColumnFamilyDescriptor setPrefetchBlocksOnOpen(boolean value)
value
- true if we should prefetch blocks into the blockcache on
openpublic String toStringCustomizedValues()
toStringCustomizedValues
in interface ColumnFamilyDescriptor
private StringBuilder getValues(boolean printDefaults)
public int compareTo(ColumnFamilyDescriptorBuilder.ModifyableColumnFamilyDescriptor other)
compareTo
in interface Comparable<ColumnFamilyDescriptorBuilder.ModifyableColumnFamilyDescriptor>
private byte[] toByteArray()
parseFrom(byte[])
private static ColumnFamilyDescriptor parseFrom(byte[] bytes) throws DeserializationException
bytes
- A pb serialized ColumnFamilyDescriptorBuilder.ModifyableColumnFamilyDescriptor
instance with pb
magic prefixColumnFamilyDescriptorBuilder.ModifyableColumnFamilyDescriptor
made from
bytes
DeserializationException
toByteArray()
public String getConfigurationValue(String key)
getConfigurationValue
in interface ColumnFamilyDescriptor
key
- the key whose associated value is to be returnedpublic Map<String,String> getConfiguration()
getConfiguration
in interface ColumnFamilyDescriptor
public ColumnFamilyDescriptorBuilder.ModifyableColumnFamilyDescriptor setConfiguration(String key, String value)
configuration
map.key
- Config key. Same as XML config key e.g.
hbase.something.or.other.value
- String value. If null, removes the configuration.public ColumnFamilyDescriptorBuilder.ModifyableColumnFamilyDescriptor removeConfiguration(String key)
configuration
map.key
- public String getEncryptionType()
getEncryptionType
in interface ColumnFamilyDescriptor
public ColumnFamilyDescriptorBuilder.ModifyableColumnFamilyDescriptor setEncryptionType(String algorithm)
algorithm
- public byte[] getEncryptionKey()
getEncryptionKey
in interface ColumnFamilyDescriptor
public ColumnFamilyDescriptorBuilder.ModifyableColumnFamilyDescriptor setEncryptionKey(byte[] keyBytes)
keyBytes
- public long getMobThreshold()
ColumnFamilyDescriptor
getMobThreshold
in interface ColumnFamilyDescriptor
public ColumnFamilyDescriptorBuilder.ModifyableColumnFamilyDescriptor setMobThreshold(long threshold)
threshold
- The mob threshold.public boolean isMobEnabled()
ColumnFamilyDescriptor
isMobEnabled
in interface ColumnFamilyDescriptor
public ColumnFamilyDescriptorBuilder.ModifyableColumnFamilyDescriptor setMobEnabled(boolean isMobEnabled)
isMobEnabled
- Whether to enable the mob for the family.public MobCompactPartitionPolicy getMobCompactPartitionPolicy()
ColumnFamilyDescriptor
getMobCompactPartitionPolicy
in interface ColumnFamilyDescriptor
public ColumnFamilyDescriptorBuilder.ModifyableColumnFamilyDescriptor setMobCompactPartitionPolicy(MobCompactPartitionPolicy policy)
policy
- policy typepublic short getDFSReplication()
getDFSReplication
in interface ColumnFamilyDescriptor
public ColumnFamilyDescriptorBuilder.ModifyableColumnFamilyDescriptor setDFSReplication(short replication)
replication
- number of replicas the blocks(s) belonging to this CF
should have, or ColumnFamilyDescriptorBuilder.DEFAULT_DFS_REPLICATION
for the default
replication factor set in the filesystempublic String getStoragePolicy()
ColumnFamilyDescriptor
enum
here because HDFS is not using enum
for storage policy, see
org.apache.hadoop.hdfs.server.blockmanagement.BlockStoragePolicySuite for more details.getStoragePolicy
in interface ColumnFamilyDescriptor
public ColumnFamilyDescriptorBuilder.ModifyableColumnFamilyDescriptor setStoragePolicy(String policy)
policy
- the policy to set, valid setting includes:
"LAZY_PERSIST",
"ALL_SSD", "ONE_SSD", "HOT", "WARM",
"COLD"Copyright © 2007–2019 The Apache Software Foundation. All rights reserved.