org.apache.hadoop.hbase.avro
Class AvroServer.HBaseImpl

java.lang.Object
  extended by org.apache.hadoop.hbase.avro.AvroServer.HBaseImpl
All Implemented Interfaces:
HBase
Enclosing class:
AvroServer

public static class AvroServer.HBaseImpl
extends Object
implements HBase

The HBaseImpl is a glue object that connects Avro RPC calls to the HBase client API primarily defined in the HBaseAdmin and HTable objects.


Field Summary
protected  HBaseAdmin admin
           
protected  org.apache.hadoop.conf.Configuration conf
           
protected  HTablePool htablePool
           
protected  org.apache.commons.logging.Log LOG
           
protected  int nextScannerId
           
protected  HashMap<Integer,ResultScanner> scannerMap
           
 
Fields inherited from interface org.apache.hadoop.hbase.avro.generated.HBase
PROTOCOL
 
Method Summary
 Void addFamily(ByteBuffer table, AFamilyDescriptor family)
           
protected  int addScanner(ResultScanner scanner)
          Assigns a unique ID to the scanner and adds the mapping to an internal hash-map.
 Void createTable(ATableDescriptor table)
           
 Void delete(ByteBuffer table, ADelete adelete)
           
 Void deleteFamily(ByteBuffer table, ByteBuffer family)
           
 Void deleteTable(ByteBuffer table)
           
 AFamilyDescriptor describeFamily(ByteBuffer table, ByteBuffer family)
           
 ATableDescriptor describeTable(ByteBuffer table)
           
 Void disableTable(ByteBuffer table)
           
 Void enableTable(ByteBuffer table)
           
 boolean exists(ByteBuffer table, AGet aget)
           
 Void flush(ByteBuffer table)
           
 AResult get(ByteBuffer table, AGet aget)
           
 AClusterStatus getClusterStatus()
           
 org.apache.avro.util.Utf8 getHBaseVersion()
           
protected  ResultScanner getScanner(int id)
          Returns the scanner associated with the specified ID.
 long incrementColumnValue(ByteBuffer table, ByteBuffer row, ByteBuffer family, ByteBuffer qualifier, long amount, boolean writeToWAL)
           
 boolean isTableEnabled(ByteBuffer table)
           
 org.apache.avro.generic.GenericArray<ATableDescriptor> listTables()
           
 Void modifyFamily(ByteBuffer table, ByteBuffer familyName, AFamilyDescriptor familyDescriptor)
           
 Void modifyTable(ByteBuffer tableName, ATableDescriptor tableDescriptor)
           
 Void put(ByteBuffer table, APut aput)
           
protected  ResultScanner removeScanner(int id)
          Removes the scanner associated with the specified ID from the internal id->scanner hash-map.
 Void scannerClose(int scannerId)
           
 org.apache.avro.generic.GenericArray<AResult> scannerGetRows(int scannerId, int numberOfRows)
           
 int scannerOpen(ByteBuffer table, AScan ascan)
           
 Void split(ByteBuffer table)
           
 boolean tableExists(ByteBuffer table)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

conf

protected org.apache.hadoop.conf.Configuration conf

admin

protected HBaseAdmin admin

htablePool

protected HTablePool htablePool

LOG

protected final org.apache.commons.logging.Log LOG

nextScannerId

protected int nextScannerId

scannerMap

protected HashMap<Integer,ResultScanner> scannerMap
Method Detail

addScanner

protected int addScanner(ResultScanner scanner)
Assigns a unique ID to the scanner and adds the mapping to an internal hash-map.

Parameters:
scanner -
Returns:
integer scanner id

getScanner

protected ResultScanner getScanner(int id)
Returns the scanner associated with the specified ID.

Parameters:
id -
Returns:
a Scanner, or null if ID was invalid.

removeScanner

protected ResultScanner removeScanner(int id)
Removes the scanner associated with the specified ID from the internal id->scanner hash-map.

Parameters:
id -
Returns:
a Scanner, or null if ID was invalid.

getHBaseVersion

public org.apache.avro.util.Utf8 getHBaseVersion()
                                          throws AIOError
Specified by:
getHBaseVersion in interface HBase
Throws:
AIOError

getClusterStatus

public AClusterStatus getClusterStatus()
                                throws AIOError
Specified by:
getClusterStatus in interface HBase
Throws:
AIOError

listTables

public org.apache.avro.generic.GenericArray<ATableDescriptor> listTables()
                                                                  throws AIOError
Specified by:
listTables in interface HBase
Throws:
AIOError

describeTable

public ATableDescriptor describeTable(ByteBuffer table)
                               throws AIOError
Specified by:
describeTable in interface HBase
Throws:
AIOError

isTableEnabled

public boolean isTableEnabled(ByteBuffer table)
                       throws AIOError
Specified by:
isTableEnabled in interface HBase
Throws:
AIOError

tableExists

public boolean tableExists(ByteBuffer table)
                    throws AIOError
Specified by:
tableExists in interface HBase
Throws:
AIOError

describeFamily

public AFamilyDescriptor describeFamily(ByteBuffer table,
                                        ByteBuffer family)
                                 throws AIOError
Specified by:
describeFamily in interface HBase
Throws:
AIOError

createTable

public Void createTable(ATableDescriptor table)
                 throws AIOError,
                        AIllegalArgument,
                        ATableExists,
                        AMasterNotRunning
Specified by:
createTable in interface HBase
Throws:
AIOError
AIllegalArgument
ATableExists
AMasterNotRunning

deleteTable

public Void deleteTable(ByteBuffer table)
                 throws AIOError
Specified by:
deleteTable in interface HBase
Throws:
AIOError

modifyTable

public Void modifyTable(ByteBuffer tableName,
                        ATableDescriptor tableDescriptor)
                 throws AIOError
Specified by:
modifyTable in interface HBase
Throws:
AIOError

enableTable

public Void enableTable(ByteBuffer table)
                 throws AIOError
Specified by:
enableTable in interface HBase
Throws:
AIOError

disableTable

public Void disableTable(ByteBuffer table)
                  throws AIOError
Specified by:
disableTable in interface HBase
Throws:
AIOError

flush

public Void flush(ByteBuffer table)
           throws AIOError
Specified by:
flush in interface HBase
Throws:
AIOError

split

public Void split(ByteBuffer table)
           throws AIOError
Specified by:
split in interface HBase
Throws:
AIOError

addFamily

public Void addFamily(ByteBuffer table,
                      AFamilyDescriptor family)
               throws AIOError
Specified by:
addFamily in interface HBase
Throws:
AIOError

deleteFamily

public Void deleteFamily(ByteBuffer table,
                         ByteBuffer family)
                  throws AIOError
Specified by:
deleteFamily in interface HBase
Throws:
AIOError

modifyFamily

public Void modifyFamily(ByteBuffer table,
                         ByteBuffer familyName,
                         AFamilyDescriptor familyDescriptor)
                  throws AIOError
Specified by:
modifyFamily in interface HBase
Throws:
AIOError

get

public AResult get(ByteBuffer table,
                   AGet aget)
            throws AIOError
Specified by:
get in interface HBase
Throws:
AIOError

exists

public boolean exists(ByteBuffer table,
                      AGet aget)
               throws AIOError
Specified by:
exists in interface HBase
Throws:
AIOError

put

public Void put(ByteBuffer table,
                APut aput)
         throws AIOError
Specified by:
put in interface HBase
Throws:
AIOError

delete

public Void delete(ByteBuffer table,
                   ADelete adelete)
            throws AIOError
Specified by:
delete in interface HBase
Throws:
AIOError

incrementColumnValue

public long incrementColumnValue(ByteBuffer table,
                                 ByteBuffer row,
                                 ByteBuffer family,
                                 ByteBuffer qualifier,
                                 long amount,
                                 boolean writeToWAL)
                          throws AIOError
Specified by:
incrementColumnValue in interface HBase
Throws:
AIOError

scannerOpen

public int scannerOpen(ByteBuffer table,
                       AScan ascan)
                throws AIOError
Specified by:
scannerOpen in interface HBase
Throws:
AIOError

scannerClose

public Void scannerClose(int scannerId)
                  throws AIOError,
                         AIllegalArgument
Specified by:
scannerClose in interface HBase
Throws:
AIOError
AIllegalArgument

scannerGetRows

public org.apache.avro.generic.GenericArray<AResult> scannerGetRows(int scannerId,
                                                                    int numberOfRows)
                                                             throws AIOError,
                                                                    AIllegalArgument
Specified by:
scannerGetRows in interface HBase
Throws:
AIOError
AIllegalArgument


Copyright © 2011 The Apache Software Foundation. All Rights Reserved.