com.google.cloud.bigtable.hbase.adapters.admin
Class ColumnDescriptorAdapter
- java.lang.Object
-
- com.google.cloud.bigtable.hbase.adapters.admin.ColumnDescriptorAdapter
-
public class ColumnDescriptorAdapter extends Object
Adapt a single instance of an HBaseHColumnDescriptor
to an instance ofColumnFamily
- Version:
- $Id: $Id
- Author:
- sduskis
-
-
Field Summary
Fields Modifier and Type Field and Description static Set<String>
IGNORED_OPTION_KEYS
Configuration keys that we ignore unconditionallystatic 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 Summary
Constructors Constructor and Description ColumnDescriptorAdapter()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method and Description HColumnDescriptor
adapt(com.google.cloud.bigtable.admin.v2.models.ColumnFamily columnFamily)
Convert a BigtableColumnFamily
to an HBaseHColumnDescriptor
.com.google.bigtable.admin.v2.ColumnFamily
adapt(HColumnDescriptor columnDescriptor)
Adapt a single instance of an HBaseHColumnDescriptor
to an instance ofColumnFamily.Builder
.static com.google.cloud.bigtable.admin.v2.models.GCRules.GCRule
buildGarbageCollectionRule(HColumnDescriptor columnDescriptor)
Construct an BigtableGCRules.GCRule
from the given column descriptor.static List<String>
getUnknownFeatures(HColumnDescriptor columnDescriptor)
Build a list of configuration keys that we don't know how to handlestatic Map<String,String>
getUnsupportedFeatures(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, HColumnDescriptor columnDescriptor)
processIntersection.static void
throwIfRequestingUnknownFeatures(HColumnDescriptor columnDescriptor)
Throw anUnsupportedOperationException
if the column descriptor cannot be adapted due to it having unknown configuration keys.static void
throwIfRequestingUnsupportedFeatures(HColumnDescriptor columnDescriptor)
Throw anUnsupportedOperationException
if the column descriptor cannot be adapted due to it having configuration values that are not supported.
-
-
-
Field Detail
-
INSTANCE
public static final ColumnDescriptorAdapter INSTANCE
-
SUPPORTED_OPTION_KEYS
public static final Set<String> SUPPORTED_OPTION_KEYS
Configuration keys that we can support unconditionally and we provide a mapped version of the column descriptor to Bigtable.
-
IGNORED_OPTION_KEYS
public static final Set<String> IGNORED_OPTION_KEYS
Configuration keys that we ignore unconditionally
-
-
Method Detail
-
getUnknownFeatures
public static List<String> getUnknownFeatures(HColumnDescriptor columnDescriptor)
Build a list of configuration keys that we don't know how to handle- Parameters:
columnDescriptor
- aHColumnDescriptor
object.- Returns:
- a
List
object.
-
getUnsupportedFeatures
public static Map<String,String> getUnsupportedFeatures(HColumnDescriptor columnDescriptor)
Build a Map of configuration keys and values describing configuration values we don't support.- Parameters:
columnDescriptor
- aHColumnDescriptor
object.- Returns:
- a
Map
object.
-
throwIfRequestingUnknownFeatures
public static void throwIfRequestingUnknownFeatures(HColumnDescriptor columnDescriptor)
Throw anUnsupportedOperationException
if the column descriptor cannot be adapted due to it having unknown configuration keys.- Parameters:
columnDescriptor
- aHColumnDescriptor
object.
-
throwIfRequestingUnsupportedFeatures
public static void throwIfRequestingUnsupportedFeatures(HColumnDescriptor columnDescriptor)
Throw anUnsupportedOperationException
if the column descriptor cannot be adapted due to it having configuration values that are not supported.- Parameters:
columnDescriptor
- aHColumnDescriptor
object.
-
buildGarbageCollectionRule
public static com.google.cloud.bigtable.admin.v2.models.GCRules.GCRule buildGarbageCollectionRule(HColumnDescriptor columnDescriptor)
Construct an BigtableGCRules.GCRule
from the given column descriptor.- Parameters:
columnDescriptor
- aHColumnDescriptor
object.- Returns:
- a
GCRules.GCRule
object.
-
processIntersection
protected static void processIntersection(com.google.bigtable.admin.v2.GcRule gcRule, HColumnDescriptor columnDescriptor)
processIntersection.- Parameters:
gcRule
- aGcRule
object.columnDescriptor
- aHColumnDescriptor
object.
-
adapt
public com.google.bigtable.admin.v2.ColumnFamily adapt(HColumnDescriptor columnDescriptor)
Adapt a single instance of an HBaseHColumnDescriptor
to an instance ofColumnFamily.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.
- Parameters:
columnDescriptor
- aHColumnDescriptor
object.- Returns:
- a
ColumnFamily.Builder
object.
-
adapt
public HColumnDescriptor adapt(com.google.cloud.bigtable.admin.v2.models.ColumnFamily columnFamily)
Convert a BigtableColumnFamily
to an HBaseHColumnDescriptor
. SeeconvertGarbageCollectionRule(GcRule, HColumnDescriptor)
for more info.- Parameters:
columnFamily
- aColumnFamily
object.- Returns:
- a
HColumnDescriptor
object.
-
-