@InternalApi(value="For internal usage only") public class ColumnDescriptorAdapter extends Object
HColumnDescriptor
to an
instance of ColumnFamily
For internal use only - public for technical reasons.
Modifier and Type | Field and Description |
---|---|
static Set<String> |
IGNORED_OPTION_KEYS
Configuration keys that we ignore unconditionally
|
static ColumnDescriptorAdapter |
INSTANCE |
static Set<String> |
SUPPORTED_OPTION_KEYS
Configuration keys that we can support unconditionally and we provide a mapped version of the
column descriptor to Bigtable.
|
static Map<String,String> |
SUPPORTED_OPTION_VALUES
Configuration option values that we ignore as long as the value is the one specified below.
|
Constructor and Description |
---|
ColumnDescriptorAdapter() |
Modifier and Type | Method and Description |
---|---|
org.apache.hadoop.hbase.HColumnDescriptor |
adapt(com.google.cloud.bigtable.admin.v2.models.ColumnFamily columnFamily)
Convert a Bigtable
ColumnFamily to an HBase
HColumnDescriptor . |
com.google.bigtable.admin.v2.ColumnFamily |
adapt(org.apache.hadoop.hbase.HColumnDescriptor columnDescriptor)
Adapt a single instance of an HBase
HColumnDescriptor to an
instance of ColumnFamily.Builder . |
static com.google.cloud.bigtable.admin.v2.models.GCRules.GCRule |
buildGarbageCollectionRule(org.apache.hadoop.hbase.HColumnDescriptor columnDescriptor)
Construct an Bigtable
GCRules.GCRule from the given column descriptor. |
static List<String> |
getUnknownFeatures(org.apache.hadoop.hbase.HColumnDescriptor columnDescriptor)
Build a list of configuration keys that we don't know how to handle
|
static Map<String,String> |
getUnsupportedFeatures(org.apache.hadoop.hbase.HColumnDescriptor columnDescriptor)
Build a Map of configuration keys and values describing configuration values we don't support.
|
protected static void |
processIntersection(com.google.bigtable.admin.v2.GcRule gcRule,
org.apache.hadoop.hbase.HColumnDescriptor columnDescriptor)
processIntersection.
|
static void |
throwIfRequestingUnknownFeatures(org.apache.hadoop.hbase.HColumnDescriptor columnDescriptor)
Throw an
UnsupportedOperationException if the column descriptor cannot be
adapted due to it having unknown configuration keys. |
static void |
throwIfRequestingUnsupportedFeatures(org.apache.hadoop.hbase.HColumnDescriptor columnDescriptor)
Throw an
UnsupportedOperationException if the column descriptor cannot be
adapted due to it having configuration values that are not supported. |
public static final ColumnDescriptorAdapter INSTANCE
public static final Set<String> SUPPORTED_OPTION_KEYS
public static final Set<String> IGNORED_OPTION_KEYS
public static List<String> getUnknownFeatures(org.apache.hadoop.hbase.HColumnDescriptor columnDescriptor)
columnDescriptor
- a HColumnDescriptor
object.List
object.public static Map<String,String> getUnsupportedFeatures(org.apache.hadoop.hbase.HColumnDescriptor columnDescriptor)
columnDescriptor
- a HColumnDescriptor
object.Map
object.public static void throwIfRequestingUnknownFeatures(org.apache.hadoop.hbase.HColumnDescriptor columnDescriptor)
UnsupportedOperationException
if the column descriptor cannot be
adapted due to it having unknown configuration keys.columnDescriptor
- a HColumnDescriptor
object.public static void throwIfRequestingUnsupportedFeatures(org.apache.hadoop.hbase.HColumnDescriptor columnDescriptor)
UnsupportedOperationException
if the column descriptor cannot be
adapted due to it having configuration values that are not supported.columnDescriptor
- a HColumnDescriptor
object.public static com.google.cloud.bigtable.admin.v2.models.GCRules.GCRule buildGarbageCollectionRule(org.apache.hadoop.hbase.HColumnDescriptor columnDescriptor)
GCRules.GCRule
from the given column descriptor.columnDescriptor
- a HColumnDescriptor
object.GCRules.GCRule
object.protected static void processIntersection(com.google.bigtable.admin.v2.GcRule gcRule, org.apache.hadoop.hbase.HColumnDescriptor columnDescriptor)
gcRule
- a GcRule
object.columnDescriptor
- a HColumnDescriptor
object.public com.google.bigtable.admin.v2.ColumnFamily adapt(org.apache.hadoop.hbase.HColumnDescriptor columnDescriptor)
HColumnDescriptor
to an
instance of ColumnFamily.Builder
.
NOTE: This method does not set the name of the ColumnFamily.Builder. The assumption is that the CreateTableRequest or CreateColumnFamilyRequest takes care of the naming. As of now (3/11/2015), the server insists on having a blank name.
columnDescriptor
- a HColumnDescriptor
object.ColumnFamily.Builder
object.public org.apache.hadoop.hbase.HColumnDescriptor adapt(com.google.cloud.bigtable.admin.v2.models.ColumnFamily columnFamily)
ColumnFamily
to an HBase
HColumnDescriptor
. See convertGarbageCollectionRule(GcRule, HColumnDescriptor)
for more info.columnFamily
- a ColumnFamily
object.HColumnDescriptor
object.