1 /*
2 *
3 * Licensed under the Apache License, Version 2.0 (the "License");
4 * you may not use this file except in compliance with the License.
5 * You may obtain a copy of the License at
6 *
7 * http://www.apache.org/licenses/LICENSE-2.0
8 *
9 * Unless required by applicable law or agreed to in writing, software
10 * distributed under the License is distributed on an "AS IS" BASIS,
11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 * See the License for the specific language governing permissions and
13 * limitations under the License.
14 */
15
16 package org.apache.hadoop.hbase;
17
18 import java.io.IOException;
19
20 import org.apache.hadoop.hbase.classification.InterfaceAudience;
21
22 /**
23 * Coprocessor interface.
24 */
25 @InterfaceAudience.Private
26 public interface Coprocessor {
27 int VERSION = 1;
28
29 /** Highest installation priority */
30 int PRIORITY_HIGHEST = 0;
31 /** High (system) installation priority */
32 int PRIORITY_SYSTEM = Integer.MAX_VALUE / 4;
33 /** Default installation priority for user coprocessors */
34 int PRIORITY_USER = Integer.MAX_VALUE / 2;
35 /** Lowest installation priority */
36 int PRIORITY_LOWEST = Integer.MAX_VALUE;
37
38 /**
39 * Lifecycle state of a given coprocessor instance.
40 */
41 enum State {
42 UNINSTALLED,
43 INSTALLED,
44 STARTING,
45 ACTIVE,
46 STOPPING,
47 STOPPED
48 }
49
50 // Interface
51 void start(CoprocessorEnvironment env) throws IOException;
52
53 void stop(CoprocessorEnvironment env) throws IOException;
54
55 }