View Javadoc

1   /*
2    * Copyright 2010 The Apache Software Foundation
3    *
4    * Licensed under the Apache License, Version 2.0 (the "License");
5    * you may not use this file except in compliance with the License.
6    * You may obtain a copy of the License at
7    *
8    *     http://www.apache.org/licenses/LICENSE-2.0
9    *
10   * Unless required by applicable law or agreed to in writing, software
11   * distributed under the License is distributed on an "AS IS" BASIS,
12   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13   * See the License for the specific language governing permissions and
14   * limitations under the License.
15   */
16  
17  package org.apache.hadoop.hbase;
18  
19  import java.io.IOException;
20  import java.util.concurrent.ExecutorService;
21  
22  import org.apache.hadoop.conf.Configuration;
23  import org.apache.hadoop.hbase.client.HTableInterface;
24  
25  /**
26   * Coprocessor environment state.
27   */
28  public interface CoprocessorEnvironment {
29  
30    /** @return the Coprocessor interface version */
31    public int getVersion();
32  
33    /** @return the HBase version as a string (e.g. "0.21.0") */
34    public String getHBaseVersion();
35  
36    /** @return the loaded coprocessor instance */
37    public Coprocessor getInstance();
38  
39    /** @return the priority assigned to the loaded coprocessor */
40    public int getPriority();
41  
42    /** @return the load sequence number */
43    public int getLoadSequence();
44  
45    /** @return the configuration */
46    public Configuration getConfiguration();
47  
48    /**
49     * @return an interface for accessing the given table
50     * @throws IOException
51     */
52    public HTableInterface getTable(byte[] tableName) throws IOException;
53  
54    /**
55     * @return an interface for accessing the given table using the passed executor to run batch
56     *         operations
57     * @throws IOException
58     */
59    public HTableInterface getTable(byte[] tableName, ExecutorService service) throws IOException;
60  }