org.apache.hadoop.hbase.coprocessor
Class CoprocessorHost.Environment

java.lang.Object
  extended by org.apache.hadoop.hbase.coprocessor.CoprocessorHost.Environment
All Implemented Interfaces:
CoprocessorEnvironment
Enclosing class:
CoprocessorHost<E extends CoprocessorEnvironment>

public static class CoprocessorHost.Environment
extends Object
implements CoprocessorEnvironment

Encapsulation of the environment of each coprocessor


Field Summary
 Coprocessor impl
          The coprocessor
protected  List<HTableInterface> openTables
          Accounting for tables opened by the coprocessor
protected  int priority
          Chaining priority
 
Constructor Summary
CoprocessorHost.Environment(Coprocessor impl, int priority, int seq, org.apache.hadoop.conf.Configuration conf)
          Constructor
 
Method Summary
 org.apache.hadoop.conf.Configuration getConfiguration()
           
 String getHBaseVersion()
           
 Coprocessor getInstance()
           
 int getLoadSequence()
           
 int getPriority()
           
 HTableInterface getTable(byte[] tableName)
          Open a table from within the Coprocessor environment
 HTableInterface getTable(byte[] tableName, ExecutorService pool)
          Open a table from within the Coprocessor environment
 int getVersion()
           
protected  void shutdown()
          Clean up the environment
 void startup()
          Initialize the environment
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

impl

public Coprocessor impl
The coprocessor


priority

protected int priority
Chaining priority


openTables

protected List<HTableInterface> openTables
Accounting for tables opened by the coprocessor

Constructor Detail

CoprocessorHost.Environment

public CoprocessorHost.Environment(Coprocessor impl,
                                   int priority,
                                   int seq,
                                   org.apache.hadoop.conf.Configuration conf)
Constructor

Parameters:
impl - the coprocessor instance
priority - chaining priority
Method Detail

startup

public void startup()
Initialize the environment


shutdown

protected void shutdown()
Clean up the environment


getInstance

public Coprocessor getInstance()
Specified by:
getInstance in interface CoprocessorEnvironment
Returns:
the loaded coprocessor instance

getPriority

public int getPriority()
Specified by:
getPriority in interface CoprocessorEnvironment
Returns:
the priority assigned to the loaded coprocessor

getLoadSequence

public int getLoadSequence()
Specified by:
getLoadSequence in interface CoprocessorEnvironment
Returns:
the load sequence number

getVersion

public int getVersion()
Specified by:
getVersion in interface CoprocessorEnvironment
Returns:
the coprocessor environment version

getHBaseVersion

public String getHBaseVersion()
Specified by:
getHBaseVersion in interface CoprocessorEnvironment
Returns:
the HBase release

getConfiguration

public org.apache.hadoop.conf.Configuration getConfiguration()
Specified by:
getConfiguration in interface CoprocessorEnvironment
Returns:
the configuration

getTable

public HTableInterface getTable(byte[] tableName)
                         throws IOException
Open a table from within the Coprocessor environment

Specified by:
getTable in interface CoprocessorEnvironment
Parameters:
tableName - the table name
Returns:
an interface for manipulating the table
Throws:
IOException - Exception

getTable

public HTableInterface getTable(byte[] tableName,
                                ExecutorService pool)
                         throws IOException
Open a table from within the Coprocessor environment

Specified by:
getTable in interface CoprocessorEnvironment
Parameters:
tableName - the table name
Returns:
an interface for manipulating the table
Throws:
IOException - Exception


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