org.datanucleus.store.hbase
Class HBaseUtils

java.lang.Object
  extended by org.datanucleus.store.hbase.HBaseUtils

public class HBaseUtils
extends java.lang.Object


Field Summary
protected static org.datanucleus.util.Localiser LOCALISER
          Localiser for messages.
 
Constructor Summary
HBaseUtils()
           
 
Method Summary
static java.lang.String getDefaultValueForMember(org.datanucleus.metadata.AbstractMemberMetaData mmd)
          Accessor for the default value specified for the provided member.
static org.apache.hadoop.hbase.client.Delete getDeleteForObject(org.datanucleus.store.ObjectProvider sm)
           
static java.lang.Object getDiscriminatorForObject(org.datanucleus.metadata.AbstractClassMetaData cmd, org.apache.hadoop.hbase.client.Result result)
          Convenience method that extracts the discriminator for a class of the specified type from the passed Result.
static java.lang.String getFamilyName(org.datanucleus.metadata.AbstractClassMetaData acmd, int absoluteFieldNumber)
          Accessor for the HBase family name for this field.
static java.lang.String getFamilyName(org.datanucleus.metadata.AbstractMemberMetaData mmd, int fieldNumber, java.lang.String tableNameForClass)
          Accessor for the HBase family name for the field of the embedded field.
static java.lang.String getFamilyName(org.datanucleus.metadata.DiscriminatorMetaData dismd)
          Accessor for the HBase family name for the discriminator of this class.
static java.lang.String getFamilyName(org.datanucleus.metadata.IdentityMetaData idmd)
          Accessor for the HBase family name for the identity of this class.
static java.lang.String getFamilyName(org.datanucleus.metadata.VersionMetaData vermd)
          Accessor for the HBase family name for the version of this class.
static org.apache.hadoop.hbase.client.Put getPutForObject(org.datanucleus.store.ObjectProvider sm)
           
static java.lang.String getQualifierName(org.datanucleus.metadata.AbstractClassMetaData acmd, int absoluteFieldNumber)
          Accessor for the HBase qualifier name for this field.
static java.lang.String getQualifierName(org.datanucleus.metadata.AbstractMemberMetaData mmd, int fieldNumber)
          Accessor for the HBase qualifier name for the field of this embedded field.
static java.lang.String getQualifierName(org.datanucleus.metadata.DiscriminatorMetaData dismd)
          Accessor for the HBase qualifier name for this discriminator.
static java.lang.String getQualifierName(org.datanucleus.metadata.IdentityMetaData idmd)
          Accessor for the HBase qualifier name for this identity.
static java.lang.String getQualifierName(org.datanucleus.metadata.VersionMetaData vermd)
          Accessor for the HBase qualifier name for this version.
static org.apache.hadoop.hbase.client.Result getResultForObject(org.datanucleus.store.ObjectProvider sm, org.apache.hadoop.hbase.client.HTable table)
           
static java.lang.Object getSurrogateVersionForObject(org.datanucleus.metadata.AbstractClassMetaData cmd, org.apache.hadoop.hbase.client.Result result)
          Convenience method that extracts the surrogate version for a class of the specified type from the passed Result.
static java.lang.String getTableName(org.datanucleus.metadata.AbstractClassMetaData acmd)
          Accessor for the HBase table name for this class.
static java.lang.Object getVersionForObject(org.datanucleus.metadata.AbstractClassMetaData cmd, org.apache.hadoop.hbase.client.Result result, org.datanucleus.store.ExecutionContext ec)
          Convenience method that extracts the version for a class of the specified type from the passed Result.
static boolean objectExistsInTable(org.datanucleus.store.ObjectProvider sm, org.apache.hadoop.hbase.client.HTable table)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

LOCALISER

protected static final org.datanucleus.util.Localiser LOCALISER
Localiser for messages.

Constructor Detail

HBaseUtils

public HBaseUtils()
Method Detail

getDefaultValueForMember

public static java.lang.String getDefaultValueForMember(org.datanucleus.metadata.AbstractMemberMetaData mmd)
Accessor for the default value specified for the provided member. If no defaultValue is provided on the column then returns null.

Parameters:
mmd - Metadata for the member
Returns:
The default value

getTableName

public static java.lang.String getTableName(org.datanucleus.metadata.AbstractClassMetaData acmd)
Accessor for the HBase table name for this class.

Parameters:
acmd - Metadata for the class
Returns:
The table name

getFamilyName

public static java.lang.String getFamilyName(org.datanucleus.metadata.AbstractMemberMetaData mmd,
                                             int fieldNumber,
                                             java.lang.String tableNameForClass)
Accessor for the HBase family name for the field of the embedded field. Extracts the family name using the following priorities

Parameters:
mmd - Metadata for the embedded field
fieldNumber - Number of the field in the embedded object
Returns:
The family name

getQualifierName

public static java.lang.String getQualifierName(org.datanucleus.metadata.AbstractMemberMetaData mmd,
                                                int fieldNumber)
Accessor for the HBase qualifier name for the field of this embedded field. Extracts the qualifier name using the following priorities

Parameters:
mmd - Metadata for the owning member
fieldNumber - Member number of the embedded object
Returns:
The qualifier name

getFamilyName

public static java.lang.String getFamilyName(org.datanucleus.metadata.IdentityMetaData idmd)
Accessor for the HBase family name for the identity of this class. Extracts the family name using the following priorities

Parameters:
idmd - Metadata for the identity
Returns:
The family name

getQualifierName

public static java.lang.String getQualifierName(org.datanucleus.metadata.IdentityMetaData idmd)
Accessor for the HBase qualifier name for this identity. Extracts the qualifier name using the following priorities

Parameters:
idmd - Metadata for the Identity
Returns:
The qualifier name

getFamilyName

public static java.lang.String getFamilyName(org.datanucleus.metadata.DiscriminatorMetaData dismd)
Accessor for the HBase family name for the discriminator of this class. Extracts the family name using the following priorities

Parameters:
dismd - Metadata for the discriminator
Returns:
The family name

getQualifierName

public static java.lang.String getQualifierName(org.datanucleus.metadata.DiscriminatorMetaData dismd)
Accessor for the HBase qualifier name for this discriminator. Extracts the qualifier name using the following priorities

Parameters:
dismd - Metadata for the discriminator
Returns:
The qualifier name

getFamilyName

public static java.lang.String getFamilyName(org.datanucleus.metadata.VersionMetaData vermd)
Accessor for the HBase family name for the version of this class. Extracts the family name using the following priorities

Parameters:
vermd - Metadata for the version
Returns:
The family name

getQualifierName

public static java.lang.String getQualifierName(org.datanucleus.metadata.VersionMetaData vermd)
Accessor for the HBase qualifier name for this version. Extracts the qualifier name using the following priorities

Parameters:
vermd - Metadata for the version
Returns:
The qualifier name

getFamilyName

public static java.lang.String getFamilyName(org.datanucleus.metadata.AbstractClassMetaData acmd,
                                             int absoluteFieldNumber)
Accessor for the HBase family name for this field. Extracts the family name using the following priorities

Parameters:
acmd - Metadata for the class
absoluteFieldNumber - Field number
Returns:
The family name

getQualifierName

public static java.lang.String getQualifierName(org.datanucleus.metadata.AbstractClassMetaData acmd,
                                                int absoluteFieldNumber)
Accessor for the HBase qualifier name for this field. Extracts the qualifier name using the following priorities

Parameters:
acmd - Metadata for the class
absoluteFieldNumber - Field number
Returns:
The qualifier name

getVersionForObject

public static java.lang.Object getVersionForObject(org.datanucleus.metadata.AbstractClassMetaData cmd,
                                                   org.apache.hadoop.hbase.client.Result result,
                                                   org.datanucleus.store.ExecutionContext ec)
Convenience method that extracts the version for a class of the specified type from the passed Result.

Parameters:
cmd - Metadata for the class
result - The result
Returns:
The version

getSurrogateVersionForObject

public static java.lang.Object getSurrogateVersionForObject(org.datanucleus.metadata.AbstractClassMetaData cmd,
                                                            org.apache.hadoop.hbase.client.Result result)
Convenience method that extracts the surrogate version for a class of the specified type from the passed Result.

Parameters:
cmd - Metadata for the class
result - The result
Returns:
The surrogate version

getDiscriminatorForObject

public static java.lang.Object getDiscriminatorForObject(org.datanucleus.metadata.AbstractClassMetaData cmd,
                                                         org.apache.hadoop.hbase.client.Result result)
Convenience method that extracts the discriminator for a class of the specified type from the passed Result.

Parameters:
cmd - Metadata for the class
result - The result
Returns:
The discriminator

getPutForObject

public static org.apache.hadoop.hbase.client.Put getPutForObject(org.datanucleus.store.ObjectProvider sm)
                                                          throws java.io.IOException
Throws:
java.io.IOException

getDeleteForObject

public static org.apache.hadoop.hbase.client.Delete getDeleteForObject(org.datanucleus.store.ObjectProvider sm)
                                                                throws java.io.IOException
Throws:
java.io.IOException

getResultForObject

public static org.apache.hadoop.hbase.client.Result getResultForObject(org.datanucleus.store.ObjectProvider sm,
                                                                       org.apache.hadoop.hbase.client.HTable table)
                                                                throws java.io.IOException
Throws:
java.io.IOException

objectExistsInTable

public static boolean objectExistsInTable(org.datanucleus.store.ObjectProvider sm,
                                          org.apache.hadoop.hbase.client.HTable table)
                                   throws java.io.IOException
Throws:
java.io.IOException


Copyright © 2012. All Rights Reserved.