http://git-wip-us.apache.org/repos/asf/hbase/blob/37df6fe6/hbase-protocol/src/main/protobuf/Procedure.proto ---------------------------------------------------------------------- diff --git a/hbase-protocol/src/main/protobuf/Procedure.proto b/hbase-protocol/src/main/protobuf/Procedure.proto new file mode 100644 index 0000000..e48afa9 --- /dev/null +++ b/hbase-protocol/src/main/protobuf/Procedure.proto @@ -0,0 +1,114 @@ +/** + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +option java_package = "org.apache.hadoop.hbase.protobuf.generated"; +option java_outer_classname = "ProcedureProtos"; +option java_generic_services = true; +option java_generate_equals_and_hash = true; +option optimize_for = SPEED; + +import "ErrorHandling.proto"; + +enum ProcedureState { + INITIALIZING = 1; // Procedure in construction, not yet added to the executor + RUNNABLE = 2; // Procedure added to the executor, and ready to be executed + WAITING = 3; // The procedure is waiting on children to be completed + WAITING_TIMEOUT = 4; // The procedure is waiting a timout or an external event + ROLLEDBACK = 5; // The procedure failed and was rolledback + FINISHED = 6; // The procedure completed successfully +} + +/** + * Procedure metadata, serialized by the ProcedureStore to be able to recover the old state. + */ +message Procedure { + // internal "static" state + required string class_name = 1; // full classname to be able to instantiate the procedure + optional uint64 parent_id = 2; // parent if not a root-procedure otherwise not set + required uint64 proc_id = 3; + required uint64 start_time = 4; + optional string owner = 5; + + // internal "runtime" state + required ProcedureState state = 6; + repeated uint32 stack_id = 7; // stack indices in case the procedure was running + required uint64 last_update = 8; + optional uint32 timeout = 9; + + // user state/results + optional ForeignExceptionMessage exception = 10; + optional bytes result = 11; // opaque (user) result structure + optional bytes state_data = 12; // opaque (user) procedure internal-state +} + +/** + * SequentialProcedure data + */ +message SequentialProcedureData { + required bool executed = 1; +} + +/** + * StateMachineProcedure data + */ +message StateMachineProcedureData { + repeated uint32 state = 1; +} + +/** + * Procedure WAL header + */ +message ProcedureWALHeader { + required uint32 version = 1; + required uint32 type = 2; + required uint64 log_id = 3; + required uint64 min_proc_id = 4; +} + +/** + * Procedure WAL trailer + */ +message ProcedureWALTrailer { + required uint32 version = 1; + required uint64 tracker_pos = 2; +} + +message ProcedureStoreTracker { + message TrackerNode { + required uint64 start_id = 1; + repeated uint64 updated = 2; + repeated uint64 deleted = 3; + } + + repeated TrackerNode node = 1; +} + +message ProcedureWALEntry { + enum Type { + EOF = 1; + INIT = 2; + INSERT = 3; + UPDATE = 4; + DELETE = 5; + COMPACT = 6; + } + + required Type type = 1; + repeated Procedure procedure = 2; + optional uint64 proc_id = 3; +}
http://git-wip-us.apache.org/repos/asf/hbase/blob/37df6fe6/pom.xml ---------------------------------------------------------------------- diff --git a/pom.xml b/pom.xml index 3f94abc..69f31ee 100644 --- a/pom.xml +++ b/pom.xml @@ -56,6 +56,7 @@ <module>hbase-client</module> <module>hbase-hadoop-compat</module> <module>hbase-common</module> + <module>hbase-procedure</module> <module>hbase-it</module> <module>hbase-examples</module> <module>hbase-prefix-tree</module> @@ -872,7 +873,7 @@ </fileMapper> </fileMappers> <outputDir>${basedir}/target/asciidoc</outputDir> - </transformationSet> + </transformationSet> </transformationSets> </configuration> </plugin> @@ -1015,7 +1016,7 @@ <plugin> <groupId>org.asciidoctor</groupId> <artifactId>asciidoctor-maven-plugin</artifactId> - <version>1.5.2</version> + <version>1.5.2</version> <inherited>false</inherited> <dependencies> <dependency> @@ -1035,10 +1036,10 @@ </configuration> <executions> <execution> - <id>output-html</id> + <id>output-html</id> <phase>site</phase> <goals> - <goal>process-asciidoc</goal> + <goal>process-asciidoc</goal> </goals> <configuration> <attributes> @@ -1192,6 +1193,7 @@ Modules are pretty heavy-weight things, so doing this work isn't too bad. --> <server.test.jar>hbase-server-${project.version}-tests.jar</server.test.jar> <common.test.jar>hbase-common-${project.version}-tests.jar</common.test.jar> + <procedure.test.jar>hbase-procedure-${project.version}-tests.jar</procedure.test.jar> <it.test.jar>hbase-it-${project.version}-tests.jar</it.test.jar> <annotations.test.jar>hbase-annotations-${project.version}-tests.jar</annotations.test.jar> <surefire.version>2.18</surefire.version> @@ -1263,6 +1265,17 @@ </dependency> <dependency> <groupId>org.apache.hbase</groupId> + <artifactId>hbase-procedure</artifactId> + <version>${project.version}</version> + </dependency> + <dependency> + <groupId>org.apache.hbase</groupId> + <artifactId>hbase-procedure</artifactId> + <version>${project.version}</version> + <type>test-jar</type> + </dependency> + <dependency> + <groupId>org.apache.hbase</groupId> <artifactId>hbase-hadoop-compat</artifactId> <version>${project.version}</version> </dependency>
