gov.llnl.ontology.mapreduce.table
Class SchemaUtil

java.lang.Object
  extended by gov.llnl.ontology.mapreduce.table.SchemaUtil

public class SchemaUtil
extends Object

A set of often used methods for accessing values in a HBase table.

Author:
David Buttler, Keith Stevens

Constructor Summary
SchemaUtil()
           
 
Method Summary
static void add(org.apache.hadoop.hbase.client.Put put, String col, String qual, Double value)
          Adds data to a Put under a specified column and qualifier.
static void add(org.apache.hadoop.hbase.client.Put put, String col, String qual, Object object)
          Stores the given Object into the Put at the specified column family and column qualifier.
static boolean add(org.apache.hadoop.hbase.client.Put put, String col, String qual, String data)
          Adds data to a Put under a specified column and qualifier.
static boolean add(org.apache.hadoop.hbase.client.Put put, String col, String qual, String data, org.apache.hadoop.mapreduce.Counter counter)
          Adds data to a Put under a specified column and qualifier.
static void addDefaultColumnFamily(org.apache.hadoop.hbase.HTableDescriptor tableDescriptor, String columnFamilyName)
          Creates a new column family for the table with default versions, in memory columns, block cache, and TTL.
static String getColumn(org.apache.hadoop.hbase.client.Result row, String fieldName)
          Returns the text of a given column.
static String getColumn(org.apache.hadoop.hbase.client.Result row, String family, String qualifier)
          Returns the text for a given column.
static Double getDoubleColumn(org.apache.hadoop.hbase.client.Result row, String family, String qualifier)
          Returns a double value extracted from the specified column.
static
<T> T
getObjectColumn(org.apache.hadoop.hbase.client.Result row, String fieldName, Class<T> classOfT)
          Returns the Object stored in this row at the given column family and column qualifier.
static
<T> T
getObjectColumn(org.apache.hadoop.hbase.client.Result row, String col, String qual, Class<T> classOfT)
          Returns the Object stored in this row at the given column family and column qualifier.
static
<T> T
getObjectColumn(org.apache.hadoop.hbase.client.Result row, String col, String qual, Type typeOfT)
          Returns the Object stored in this row at the given column family and column qualifier.
static
<T> T
getObjectColumn(org.apache.hadoop.hbase.client.Result row, String fieldName, Type typeOfT)
          Returns the Object stored in this row at the given column family and column qualifier.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SchemaUtil

public SchemaUtil()
Method Detail

getColumn

public static String getColumn(org.apache.hadoop.hbase.client.Result row,
                               String fieldName)
Returns the text of a given column.


getColumn

public static String getColumn(org.apache.hadoop.hbase.client.Result row,
                               String family,
                               String qualifier)
Returns the text for a given column.


getDoubleColumn

public static Double getDoubleColumn(org.apache.hadoop.hbase.client.Result row,
                                     String family,
                                     String qualifier)
Returns a double value extracted from the specified column.


getObjectColumn

public static <T> T getObjectColumn(org.apache.hadoop.hbase.client.Result row,
                                    String fieldName,
                                    Class<T> classOfT)
Returns the Object stored in this row at the given column family and column qualifier. If no data exists, this returns null.


getObjectColumn

public static <T> T getObjectColumn(org.apache.hadoop.hbase.client.Result row,
                                    String fieldName,
                                    Type typeOfT)
Returns the Object stored in this row at the given column family and column qualifier. If no data exists, this returns null.


getObjectColumn

public static <T> T getObjectColumn(org.apache.hadoop.hbase.client.Result row,
                                    String col,
                                    String qual,
                                    Class<T> classOfT)
Returns the Object stored in this row at the given column family and column qualifier. If no data exists, this returns null.


getObjectColumn

public static <T> T getObjectColumn(org.apache.hadoop.hbase.client.Result row,
                                    String col,
                                    String qual,
                                    Type typeOfT)
Returns the Object stored in this row at the given column family and column qualifier. If no data exists, this returns null.


add

public static void add(org.apache.hadoop.hbase.client.Put put,
                       String col,
                       String qual,
                       Object object)
Stores the given Object into the Put at the specified column family and column qualifier. object should implement Serializable.


add

public static boolean add(org.apache.hadoop.hbase.client.Put put,
                          String col,
                          String qual,
                          String data)
Adds data to a Put under a specified column and qualifier. Returns false if the data is null.


add

public static boolean add(org.apache.hadoop.hbase.client.Put put,
                          String col,
                          String qual,
                          String data,
                          org.apache.hadoop.mapreduce.Counter counter)
Adds data to a Put under a specified column and qualifier. Returns false if the add failed.


add

public static void add(org.apache.hadoop.hbase.client.Put put,
                       String col,
                       String qual,
                       Double value)
Adds data to a Put under a specified column and qualifier.


addDefaultColumnFamily

public static void addDefaultColumnFamily(org.apache.hadoop.hbase.HTableDescriptor tableDescriptor,
                                          String columnFamilyName)
Creates a new column family for the table with default versions, in memory columns, block cache, and TTL.



Copyright © 2010-2011. All Rights Reserved.