You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hbase.apache.org by ec...@apache.org on 2016/03/26 00:19:08 UTC
[1/8] hbase git commit: HBASE-15418 Clean up un-used warning in test
util
Repository: hbase
Updated Branches:
refs/heads/HBASE-14850 [created] cda4e6a51
HBASE-15418 Clean up un-used warning in test util
Project: http://git-wip-us.apache.org/repos/asf/hbase/repo
Commit: http://git-wip-us.apache.org/repos/asf/hbase/commit/cda4e6a5
Tree: http://git-wip-us.apache.org/repos/asf/hbase/tree/cda4e6a5
Diff: http://git-wip-us.apache.org/repos/asf/hbase/diff/cda4e6a5
Branch: refs/heads/HBASE-14850
Commit: cda4e6a51665ab45bf2ee3a72326ac360fc713b2
Parents: a51ac25
Author: Elliott Clark <ec...@apache.org>
Authored: Fri Mar 25 15:44:06 2016 -0700
Committer: Elliott Clark <ec...@apache.org>
Committed: Fri Mar 25 16:12:13 2016 -0700
----------------------------------------------------------------------
.../bin/start_local_hbase_and_wait.sh | 9 +++++-
.../bin/stop_local_hbase_and_wait.sh | 2 +-
hbase-native-client/core/BUCK | 6 ----
.../core/native-client-test-env.cc | 9 ++++--
hbase-native-client/core/test_env.h | 32 --------------------
5 files changed, 15 insertions(+), 43 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/hbase/blob/cda4e6a5/hbase-native-client/bin/start_local_hbase_and_wait.sh
----------------------------------------------------------------------
diff --git a/hbase-native-client/bin/start_local_hbase_and_wait.sh b/hbase-native-client/bin/start_local_hbase_and_wait.sh
index 64d0b68..cfc71f9 100755
--- a/hbase-native-client/bin/start_local_hbase_and_wait.sh
+++ b/hbase-native-client/bin/start_local_hbase_and_wait.sh
@@ -17,10 +17,17 @@
# See the License for the specific language governing permissions and
# limitations under the License.
+# Clean up from any other tests.
+rm -rf /tmp/hbase-*
+
+# Start the master/regionservers.
$PWD/../bin/start-hbase.sh
-until [ $(curl -s -o /dev/null -I -w "%{http_code}" http://localhost:16010) == "200" ]
+until [ $(curl -s -o /dev/null -I -w "%{http_code}" http://localhost:16010/jmx) == "200" ]
do
printf "Waiting for local HBase cluster to start\n"
sleep 1
done
+
+# This sucks, but master can easily be up and meta not be assigned yet.
+sleep 30
http://git-wip-us.apache.org/repos/asf/hbase/blob/cda4e6a5/hbase-native-client/bin/stop_local_hbase_and_wait.sh
----------------------------------------------------------------------
diff --git a/hbase-native-client/bin/stop_local_hbase_and_wait.sh b/hbase-native-client/bin/stop_local_hbase_and_wait.sh
index 4e89334..761412a 100755
--- a/hbase-native-client/bin/stop_local_hbase_and_wait.sh
+++ b/hbase-native-client/bin/stop_local_hbase_and_wait.sh
@@ -17,7 +17,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-$PWD/../bin/stop-hbase.sh
+ps aux | grep proc_master | awk '{print $2}' | xargs kill -9
while [ $(curl -s -o /dev/null -I -w "%{http_code}" http://localhost:16010) == "200" ]
do
http://git-wip-us.apache.org/repos/asf/hbase/blob/cda4e6a5/hbase-native-client/core/BUCK
----------------------------------------------------------------------
diff --git a/hbase-native-client/core/BUCK b/hbase-native-client/core/BUCK
index 817b5a0..d1e89d1 100644
--- a/hbase-native-client/core/BUCK
+++ b/hbase-native-client/core/BUCK
@@ -51,9 +51,6 @@ cxx_library(name="core",
], )
cxx_test(name="simple-test",
- headers=[
- "test_env.h",
- ],
srcs=[
"native-client-test-env.cc",
"simple-native-client-test.cc",
@@ -63,9 +60,6 @@ cxx_test(name="simple-test",
],
run_test_separately=True, )
cxx_test(name="location-cache-test",
- headers=[
- "test_env.h",
- ],
srcs=[
"native-client-test-env.cc",
"location-cache-test.cc",
http://git-wip-us.apache.org/repos/asf/hbase/blob/cda4e6a5/hbase-native-client/core/native-client-test-env.cc
----------------------------------------------------------------------
diff --git a/hbase-native-client/core/native-client-test-env.cc b/hbase-native-client/core/native-client-test-env.cc
index a86961f..07f30a6 100644
--- a/hbase-native-client/core/native-client-test-env.cc
+++ b/hbase-native-client/core/native-client-test-env.cc
@@ -18,18 +18,21 @@
*/
#include <gtest/gtest.h>
-#include <core/test_env.h>
namespace {
class NativeClientTestEnv : public ::testing::Environment {
public:
void SetUp() override {
- init_test_env();
+ // start local HBase cluster to be reused by all tests
+ auto result = system("bin/start_local_hbase_and_wait.sh");
+ ASSERT_EQ(0, result);
}
void TearDown() override {
- clean_test_env();
+ // shutdown local HBase cluster
+ auto result = system("bin/stop_local_hbase_and_wait.sh");
+ ASSERT_EQ(0, result);
}
};
http://git-wip-us.apache.org/repos/asf/hbase/blob/cda4e6a5/hbase-native-client/core/test_env.h
----------------------------------------------------------------------
diff --git a/hbase-native-client/core/test_env.h b/hbase-native-client/core/test_env.h
deleted file mode 100644
index 79bdbec..0000000
--- a/hbase-native-client/core/test_env.h
+++ /dev/null
@@ -1,32 +0,0 @@
-/*
- * 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.
- *
- */
-
-#pragma once
-
-#include <cstdlib>
-
-inline void init_test_env() {
- // start local HBase cluster to be reused by all tests
- system("scripts/start_local_hbase_and_wait.sh");
-}
-
-inline void clean_test_env() {
- // shutdown local HBase cluster
- system("scripts/stop_local_hbase_and_wait.sh");
-}
[5/8] hbase git commit: HBASE-15078 Added ability to start/stop hbase
local cluster for tests, global test_env for gtest,
small changes to dockerfile and docker run.
Posted by ec...@apache.org.
HBASE-15078 Added ability to start/stop hbase local cluster for tests, global test_env for gtest, small changes to dockerfile and docker run.
Added check ~/.m2 folder exists; moved scripts to ./bin
Project: http://git-wip-us.apache.org/repos/asf/hbase/repo
Commit: http://git-wip-us.apache.org/repos/asf/hbase/commit/ebbdbc79
Tree: http://git-wip-us.apache.org/repos/asf/hbase/tree/ebbdbc79
Diff: http://git-wip-us.apache.org/repos/asf/hbase/diff/ebbdbc79
Branch: refs/heads/HBASE-14850
Commit: ebbdbc790cc85a0b1ca0f4eaf64c787279eb90fb
Parents: 3c81072
Author: Mikhail Antonov <an...@apache.org>
Authored: Wed Jan 6 15:08:21 2016 -0800
Committer: Elliott Clark <ec...@apache.org>
Committed: Fri Mar 25 16:12:13 2016 -0700
----------------------------------------------------------------------
hbase-native-client/.buckconfig | 2 +-
hbase-native-client/Dockerfile | 2 +-
hbase-native-client/bin/start-docker.sh | 10 ++++-
.../bin/start_local_hbase_and_wait.sh | 26 ++++++++++++
.../bin/stop_local_hbase_and_wait.sh | 26 ++++++++++++
hbase-native-client/core/BUCK | 15 +++++++
.../core/HBaseNativeClientTestEnv.cc | 42 ++++++++++++++++++++
.../core/SampleNativeClientTest.cc | 28 +++++++++++++
hbase-native-client/core/test_env.h | 30 ++++++++++++++
9 files changed, 178 insertions(+), 3 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/hbase/blob/ebbdbc79/hbase-native-client/.buckconfig
----------------------------------------------------------------------
diff --git a/hbase-native-client/.buckconfig b/hbase-native-client/.buckconfig
index 3227a2a..402ef27 100644
--- a/hbase-native-client/.buckconfig
+++ b/hbase-native-client/.buckconfig
@@ -1,2 +1,2 @@
[cxx]
- gtest_dep = //third-party/googletest/googletest:google-test
+ gtest_dep = //third-party:google-test
http://git-wip-us.apache.org/repos/asf/hbase/blob/ebbdbc79/hbase-native-client/Dockerfile
----------------------------------------------------------------------
diff --git a/hbase-native-client/Dockerfile b/hbase-native-client/Dockerfile
index 70e823b..5f17f04 100644
--- a/hbase-native-client/Dockerfile
+++ b/hbase-native-client/Dockerfile
@@ -17,6 +17,6 @@
FROM pjameson/buck-folly-watchman
-RUN apt-get install -y libprotobuf-dev protobuf-compiler clang-format-3.7 vim
+RUN apt-get install -y libprotobuf-dev protobuf-compiler clang-format-3.7 vim maven inetutils-ping
WORKDIR /usr/local/src/hbase/hbase-native-client
http://git-wip-us.apache.org/repos/asf/hbase/blob/ebbdbc79/hbase-native-client/bin/start-docker.sh
----------------------------------------------------------------------
diff --git a/hbase-native-client/bin/start-docker.sh b/hbase-native-client/bin/start-docker.sh
index 1c9b02e..bf38912 100755
--- a/hbase-native-client/bin/start-docker.sh
+++ b/hbase-native-client/bin/start-docker.sh
@@ -28,5 +28,13 @@ if [[ ! -d third-party/googletest ]]; then
git clone https://github.com/google/googletest.git third-party/googletest
fi
+if [[ ! -d ~/.m2 ]]; then
+ echo "~/.m2 directory doesn't exist. Check Apache Maven is installed."
+ exit 1
+fi;
-docker run -v ${PWD}/..:/usr/local/src/hbase -it hbase_native /bin/bash
+docker run -p 16010:16010/tcp \
+ -e "JAVA_HOME=/usr/lib/jvm/java-8-oracle" \
+ -v ${PWD}/..:/usr/local/src/hbase \
+ -v ~/.m2:/root/.m2 \
+ -it hbase_native /bin/bash
http://git-wip-us.apache.org/repos/asf/hbase/blob/ebbdbc79/hbase-native-client/bin/start_local_hbase_and_wait.sh
----------------------------------------------------------------------
diff --git a/hbase-native-client/bin/start_local_hbase_and_wait.sh b/hbase-native-client/bin/start_local_hbase_and_wait.sh
new file mode 100755
index 0000000..64d0b68
--- /dev/null
+++ b/hbase-native-client/bin/start_local_hbase_and_wait.sh
@@ -0,0 +1,26 @@
+#!/usr/bin/env bash
+
+##
+# 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.
+
+$PWD/../bin/start-hbase.sh
+
+until [ $(curl -s -o /dev/null -I -w "%{http_code}" http://localhost:16010) == "200" ]
+do
+ printf "Waiting for local HBase cluster to start\n"
+ sleep 1
+done
http://git-wip-us.apache.org/repos/asf/hbase/blob/ebbdbc79/hbase-native-client/bin/stop_local_hbase_and_wait.sh
----------------------------------------------------------------------
diff --git a/hbase-native-client/bin/stop_local_hbase_and_wait.sh b/hbase-native-client/bin/stop_local_hbase_and_wait.sh
new file mode 100755
index 0000000..4e89334
--- /dev/null
+++ b/hbase-native-client/bin/stop_local_hbase_and_wait.sh
@@ -0,0 +1,26 @@
+#!/usr/bin/env bash
+
+##
+# 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.
+
+$PWD/../bin/stop-hbase.sh
+
+while [ $(curl -s -o /dev/null -I -w "%{http_code}" http://localhost:16010) == "200" ]
+do
+ printf "Waiting for local HBase cluster to stop\n"
+ sleep 1
+done
http://git-wip-us.apache.org/repos/asf/hbase/blob/ebbdbc79/hbase-native-client/core/BUCK
----------------------------------------------------------------------
diff --git a/hbase-native-client/core/BUCK b/hbase-native-client/core/BUCK
index a7eaa9e..2e4e755 100644
--- a/hbase-native-client/core/BUCK
+++ b/hbase-native-client/core/BUCK
@@ -48,3 +48,18 @@ cxx_binary(
'PUBLIC',
],
)
+
+cxx_test(
+ name = "core_test",
+ headers = [
+ "test_env.h",
+ ],
+ srcs = [
+ "HBaseNativeClientTestEnv.cc",
+ "SampleNativeClientTest.cc",
+ ],
+ deps = [
+ ":core",
+ ],
+ run_test_separately = True,
+)
http://git-wip-us.apache.org/repos/asf/hbase/blob/ebbdbc79/hbase-native-client/core/HBaseNativeClientTestEnv.cc
----------------------------------------------------------------------
diff --git a/hbase-native-client/core/HBaseNativeClientTestEnv.cc b/hbase-native-client/core/HBaseNativeClientTestEnv.cc
new file mode 100644
index 0000000..b8cb8db
--- /dev/null
+++ b/hbase-native-client/core/HBaseNativeClientTestEnv.cc
@@ -0,0 +1,42 @@
+/*
+ * 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.
+ *
+ */
+
+#include <gtest/gtest.h>
+#include <core/test_env.h>
+
+namespace {
+
+class HBaseNativeClientTestEnv : public ::testing::Environment {
+ public:
+ void SetUp() override {
+ init_test_env();
+ }
+
+ void TearDown() override {
+ clean_test_env();
+ }
+};
+
+} // anonymous
+
+int main(int argc, char** argv) {
+ testing::InitGoogleTest(&argc, argv);
+ ::testing::AddGlobalTestEnvironment(new HBaseNativeClientTestEnv());
+ return RUN_ALL_TESTS();
+}
http://git-wip-us.apache.org/repos/asf/hbase/blob/ebbdbc79/hbase-native-client/core/SampleNativeClientTest.cc
----------------------------------------------------------------------
diff --git a/hbase-native-client/core/SampleNativeClientTest.cc b/hbase-native-client/core/SampleNativeClientTest.cc
new file mode 100644
index 0000000..ef564f7
--- /dev/null
+++ b/hbase-native-client/core/SampleNativeClientTest.cc
@@ -0,0 +1,28 @@
+/*
+ * 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.
+ *
+ */
+
+#include "gtest/gtest.h"
+
+/**
+ * Sample test.
+ */
+TEST(SampleTest, sample) {
+ EXPECT_TRUE(true);
+}
+
http://git-wip-us.apache.org/repos/asf/hbase/blob/ebbdbc79/hbase-native-client/core/test_env.h
----------------------------------------------------------------------
diff --git a/hbase-native-client/core/test_env.h b/hbase-native-client/core/test_env.h
new file mode 100644
index 0000000..5796ae1
--- /dev/null
+++ b/hbase-native-client/core/test_env.h
@@ -0,0 +1,30 @@
+/*
+ * 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.
+ *
+ */
+
+#include <cstdlib>
+
+inline void init_test_env() {
+ // start local HBase cluster to be reused by all tests
+ system("scripts/start_local_hbase_and_wait.sh");
+}
+
+inline void clean_test_env() {
+ // shutdown local HBase cluster
+ system("scripts/stop_local_hbase_and_wait.sh");
+}
[4/8] hbase git commit: HBASE-14852 Update build env
Posted by ec...@apache.org.
HBASE-14852 Update build env
Also includes HBASE-14858 Clean up so core is ready for development on a recent version of c++
Project: http://git-wip-us.apache.org/repos/asf/hbase/repo
Commit: http://git-wip-us.apache.org/repos/asf/hbase/commit/3c81072b
Tree: http://git-wip-us.apache.org/repos/asf/hbase/tree/3c81072b
Diff: http://git-wip-us.apache.org/repos/asf/hbase/diff/3c81072b
Branch: refs/heads/HBASE-14850
Commit: 3c81072bb0af8c4f943a5b2e1b6c9c1079812f85
Parents: 11d11d3
Author: Elliott Clark <ec...@apache.org>
Authored: Thu Nov 19 16:28:11 2015 -0800
Committer: Elliott Clark <ec...@apache.org>
Committed: Fri Mar 25 16:12:13 2016 -0700
----------------------------------------------------------------------
hbase-native-client/.buckconfig | 2 +
hbase-native-client/.gitignore | 23 +--
hbase-native-client/CMakeLists.txt | 157 -------------------
hbase-native-client/Dockerfile | 22 +++
hbase-native-client/README.md | 15 +-
hbase-native-client/bin/build-all.sh | 41 -----
hbase-native-client/bin/build-thirdparty.sh | 64 --------
hbase-native-client/bin/download-thirdparty.sh | 70 ---------
hbase-native-client/bin/hbase-client-env.sh | 47 ------
hbase-native-client/bin/start-docker.sh | 32 ++++
.../cmake_modules/FindGTest.cmake | 53 -------
.../cmake_modules/FindLibEv.cmake | 47 ------
hbase-native-client/core/BUCK | 50 ++++++
hbase-native-client/core/admin.cc | 20 +++
hbase-native-client/core/admin.h | 22 +++
hbase-native-client/core/client.cc | 38 +++++
hbase-native-client/core/client.h | 24 +++
hbase-native-client/core/connection.cc | 20 +++
hbase-native-client/core/connection.h | 26 +++
hbase-native-client/core/connection_attr.h | 24 +++
hbase-native-client/core/delete.cc | 21 +++
hbase-native-client/core/delete.h | 27 ++++
hbase-native-client/core/get.cc | 20 +++
hbase-native-client/core/get.h | 22 +++
hbase-native-client/core/hbase_macros.h | 56 +++++++
hbase-native-client/core/mutation.cc | 41 +++++
hbase-native-client/core/mutation.h | 58 +++++++
hbase-native-client/core/put.cc | 21 +++
hbase-native-client/core/put.h | 27 ++++
hbase-native-client/core/scanner.cc | 20 +++
hbase-native-client/core/scanner.h | 22 +++
hbase-native-client/rpc/CMakeLists.txt | 17 ++
hbase-native-client/src/async/CMakeLists.txt | 32 ----
hbase-native-client/src/async/get-test.cc | 59 -------
hbase-native-client/src/async/hbase_admin.cc | 57 -------
hbase-native-client/src/async/hbase_admin.h | 69 --------
hbase-native-client/src/async/hbase_client.cc | 47 ------
hbase-native-client/src/async/hbase_client.h | 60 -------
.../src/async/hbase_connection.cc | 37 -----
.../src/async/hbase_connection.h | 52 ------
hbase-native-client/src/async/hbase_errno.h | 23 ---
hbase-native-client/src/async/hbase_get.cc | 61 -------
hbase-native-client/src/async/hbase_get.h | 73 ---------
.../src/async/hbase_mutations.cc | 111 -------------
hbase-native-client/src/async/hbase_mutations.h | 119 --------------
hbase-native-client/src/async/hbase_result.cc | 37 -----
hbase-native-client/src/async/hbase_result.h | 44 ------
hbase-native-client/src/async/hbase_scanner.cc | 59 -------
hbase-native-client/src/async/hbase_scanner.h | 80 ----------
hbase-native-client/src/async/mutations-test.cc | 102 ------------
hbase-native-client/src/core/CMakeLists.txt | 31 ----
hbase-native-client/src/core/admin.cc | 20 ---
hbase-native-client/src/core/admin.h | 25 ---
hbase-native-client/src/core/client.cc | 20 ---
hbase-native-client/src/core/client.h | 25 ---
hbase-native-client/src/core/connection.cc | 22 ---
hbase-native-client/src/core/connection.h | 26 ---
hbase-native-client/src/core/connection_attr.h | 30 ----
hbase-native-client/src/core/delete.cc | 22 ---
hbase-native-client/src/core/delete.h | 29 ----
hbase-native-client/src/core/get.cc | 20 ---
hbase-native-client/src/core/get.h | 26 ---
.../src/core/hbase_connection_attr.cc | 41 -----
.../src/core/hbase_connection_attr.h | 51 ------
hbase-native-client/src/core/hbase_macros.h | 60 -------
hbase-native-client/src/core/hbase_types.h | 83 ----------
hbase-native-client/src/core/mutation.cc | 42 -----
hbase-native-client/src/core/mutation.h | 48 ------
hbase-native-client/src/core/put.cc | 22 ---
hbase-native-client/src/core/put.h | 29 ----
hbase-native-client/src/core/scanner.cc | 20 ---
hbase-native-client/src/core/scanner.h | 25 ---
hbase-native-client/src/rpc/CMakeLists.txt | 17 --
hbase-native-client/src/sync/CMakeLists.txt | 24 ---
hbase-native-client/src/sync/hbase_admin.cc | 51 ------
hbase-native-client/src/sync/hbase_admin.h | 61 -------
.../src/sync/hbase_connection.cc | 37 -----
hbase-native-client/src/sync/hbase_connection.h | 52 ------
hbase-native-client/third-party/BUCK | 105 +++++++++++++
pom.xml | 4 +
80 files changed, 757 insertions(+), 2582 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/hbase/blob/3c81072b/hbase-native-client/.buckconfig
----------------------------------------------------------------------
diff --git a/hbase-native-client/.buckconfig b/hbase-native-client/.buckconfig
new file mode 100644
index 0000000..3227a2a
--- /dev/null
+++ b/hbase-native-client/.buckconfig
@@ -0,0 +1,2 @@
+[cxx]
+ gtest_dep = //third-party/googletest/googletest:google-test
http://git-wip-us.apache.org/repos/asf/hbase/blob/3c81072b/hbase-native-client/.gitignore
----------------------------------------------------------------------
diff --git a/hbase-native-client/.gitignore b/hbase-native-client/.gitignore
index f14b3be..b172fe9 100644
--- a/hbase-native-client/.gitignore
+++ b/hbase-native-client/.gitignore
@@ -14,25 +14,12 @@
#python
*.pyc
-# CMake Generated Files
-CMakeCache.txt
-CMakeFiles
-Makefile
-cmake_install.CMakeCache
-cmake_install.cmake
-install_manifest.txt
-CTestTestfile.cmake
-build
-Testing
+# Buck
+buck-out
+.buckd
+*.swp
# Thirdparty dirs
-
-thirdparty/glog-*
-thirdparty/gtest-*
-thirdparty/gtest
-thirdparty/protobuf-*
-thirdparty/libevent-*
-thirdparty/libev-*
-thirdparty/installed
+third-party/googletest*
http://git-wip-us.apache.org/repos/asf/hbase/blob/3c81072b/hbase-native-client/CMakeLists.txt
----------------------------------------------------------------------
diff --git a/hbase-native-client/CMakeLists.txt b/hbase-native-client/CMakeLists.txt
deleted file mode 100644
index 819f178..0000000
--- a/hbase-native-client/CMakeLists.txt
+++ /dev/null
@@ -1,157 +0,0 @@
-# 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.
-
-cmake_minimum_required(VERSION 2.6)
-
-# generate CTest input files
-enable_testing()
-
-# where to find cmake modules
-set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake_modules")
-
-# if no build build type is specified, default to debug builds
-if (NOT CMAKE_BUILD_TYPE)
- set(CMAKE_BUILD_TYPE Debug)
-endif(NOT CMAKE_BUILD_TYPE)
-
-STRING(TOUPPER ${CMAKE_BUILD_TYPE} CMAKE_BUILD_TYPE)
-
-set(CXX_COMMON_FLAGS "-Wall -Wextra -std=c++11")
-set(C_COMMON_FLAGS "-Wall -Wextra -std=c11")
-
-set(CXX_FLAGS_DEBUG "-ggdb -g")
-set(C_FLAGS_DEBUG "-ggdb")
-
-set(CXX_FLAGS_FASTDEBUG "-ggdb -O1")
-set(C_FLAGS_FASTDEBUG "-ggdb -O1")
-
-set(CXX_FLAGS_RELEASE "-O3 -g -DNDEBUG -Wno-strict-aliasing")
-set(C_FLAGS_RELEASE "-O3 -g -DNDEBUG -Wno-strict-aliasing")
-
-# if no build build type is specified, default to debug builds
-if (NOT CMAKE_BUILD_TYPE)
- set(CMAKE_BUILD_TYPE Debug)
-endif(NOT CMAKE_BUILD_TYPE)
-
-string(TOUPPER ${CMAKE_BUILD_TYPE} CMAKE_BUILD_TYPE)
-
-# Set compile flags based on the build type.
-message("Configured for ${CMAKE_BUILD_TYPE} build (set with cmake -DCMAKE_BUILD_TYPE={release,debug,...})")
-if ("${CMAKE_BUILD_TYPE}" STREQUAL "DEBUG")
- set(CMAKE_CXX_FLAGS ${CXX_FLAGS_DEBUG})
- set(CMAKE_C_FLAGS ${C_FLAGS_DEBUG})
-elseif ("${CMAKE_BUILD_TYPE}" STREQUAL "FASTDEBUG")
- set(CMAKE_CXX_FLAGS ${CXX_FLAGS_FASTDEBUG})
- set(CMAKE_C_FLAGS ${C_FLAGS_FASTDEBUG})
-elseif ("${CMAKE_BUILD_TYPE}" STREQUAL "RELEASE")
- set(CMAKE_CXX_FLAGS ${CXX_FLAGS_RELEASE})
- set(CMAKE_C_FLAGS ${C_FLAGS_RELEASE})
-else()
- message(FATAL_ERROR "Unknown build type: ${CMAKE_BUILD_TYPE}")
-endif ()
-
-set(CMAKE_CXX_FLAGS "${CXX_COMMON_FLAGS} ${CMAKE_CXX_FLAGS}")
-set(CMAKE_C_FLAGS "${C_COMMON_FLAGS} ${CMAKE_C_FLAGS}")
-
-
-# set compile output directory
-string(TOLOWER ${CMAKE_BUILD_TYPE} CMAKE_BUILD_TYPE_LOWERCASE)
-set(BUILD_OUTPUT_ROOT_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/build/${CMAKE_BUILD_TYPE_LOWERCASE}/")
-
-# Link build/latest to the current build directory, to avoid developers
-# accidentally running the latest debug build when in fact they're building
-# release builds.
-file(MAKE_DIRECTORY ${BUILD_OUTPUT_ROOT_DIRECTORY})
-execute_process(COMMAND rm -f ${CMAKE_CURRENT_SOURCE_DIR}/build/latest)
-execute_process(COMMAND ln -sf ${BUILD_OUTPUT_ROOT_DIRECTORY}
- ${CMAKE_CURRENT_SOURCE_DIR}/build/latest)
-
-# where to put generated libraries
-set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY "${BUILD_OUTPUT_ROOT_DIRECTORY}")
-set(ARCHIVE_OUTPUT_DIRECTORY "${BUILD_OUTPUT_ROOT_DIRECTORY}")
-set(CMAKE_LIBRARY_OUTPUT_DIRECTORY "${BUILD_OUTPUT_ROOT_DIRECTORY}")
-
-# where to put generated binaries
-set(EXECUTABLE_OUTPUT_PATH "${BUILD_OUTPUT_ROOT_DIRECTORY}")
-
-include_directories(src)
-
-#####################
-# Third Party
-#####################
-
-# find boost headers and libs
-set(Boost_DEBUG TRUE)
-set(Boost_USE_MULTITHREADED ON)
-find_package(Boost REQUIRED COMPONENTS thread system-mt)
-include_directories(${Boost_INCLUDE_DIRS})
-
-find_package(Protobuf REQUIRED)
-include_directories(${PROTOBUF_INCLUDE_DIRS})
-add_library(protobuf STATIC IMPORTED)
-set_target_properties(protobuf PROPERTIES IMPORTED_LOCATION "${PROTOBUF_STATIC_LIBRARY}")
-
-find_package(LibEv REQUIRED)
-include_directories(${LIBEV_INCLUDE_DIR})
-add_library(libev STATIC IMPORTED)
-
-
-set(HBASE_LIBS
- ${PROTOBUF}
- ${LIBEV}
- ${Boost_LIBRARIES}
-)
-#########
-# Testing Config
-#########
-
-# find GTest headers and libs
-find_package(GTest REQUIRED)
-include_directories(${GTEST_INCLUDE_DIR})
-add_library(gtest STATIC IMPORTED)
-set_target_properties(gtest PROPERTIES IMPORTED_LOCATION "${GTEST_LIBS}")
-
-set(HBASE_TEST_LIBS ${HBASE_LIBS} ${GTEST_LIBS})
-set(HBASE_ASYNC_TEST_LIBS ${HBASE_LIBS} ${GTEST_LIBS} hbase-async)
-set(HBASE_SYNC_TEST_LIBS ${HBASE_LIBS} ${GTEST_LIBS} hbase-sync)
-
-function(ADD_HBASE_ASYNC_TEST TEST_NAME)
- add_executable(${TEST_NAME} ${TEST_NAME}.cc)
- target_link_libraries(${TEST_NAME} ${HBASE_ASYNC_TEST_LIBS})
- add_test(${TEST_NAME} "${EXECUTABLE_OUTPUT_PATH}/${TEST_NAME}")
-endfunction()
-
-
-function(ADD_HBASE_SYNC_TEST TEST_NAME)
- add_executable(${TEST_NAME} ${TEST_NAME}.cc)
- target_link_libraries(${TEST_NAME} ${HBASE_ASYNC_TEST_LIBS})
- add_test(${TEST_NAME} "${EXECUTABLE_OUTPUT_PATH}/${TEST_NAME}")
-endfunction()
-
-
-#####
-# Actual project definition
-#####
-add_subdirectory(src/async)
-add_subdirectory(src/sync)
-
-add_subdirectory(src/core)
-add_subdirectory(src/rpc)
-
-
-add_library(hbase-async SHARED $<TARGET_OBJECTS:hcore> $<TARGET_OBJECTS:hasync>)
-add_library(hbase-sync SHARED $<TARGET_OBJECTS:hcore> $<TARGET_OBJECTS:hsync>)
http://git-wip-us.apache.org/repos/asf/hbase/blob/3c81072b/hbase-native-client/Dockerfile
----------------------------------------------------------------------
diff --git a/hbase-native-client/Dockerfile b/hbase-native-client/Dockerfile
new file mode 100644
index 0000000..70e823b
--- /dev/null
+++ b/hbase-native-client/Dockerfile
@@ -0,0 +1,22 @@
+##
+# 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.
+
+FROM pjameson/buck-folly-watchman
+
+RUN apt-get install -y libprotobuf-dev protobuf-compiler clang-format-3.7 vim
+
+WORKDIR /usr/local/src/hbase/hbase-native-client
http://git-wip-us.apache.org/repos/asf/hbase/blob/3c81072b/hbase-native-client/README.md
----------------------------------------------------------------------
diff --git a/hbase-native-client/README.md b/hbase-native-client/README.md
index 0bb4d48..76df596 100644
--- a/hbase-native-client/README.md
+++ b/hbase-native-client/README.md
@@ -19,11 +19,10 @@ under the License.
# hbase-native-client
-Native client for HBase 0.96
+Native client for HBase
-This is a C library that implements a
-HBase client. It's thread safe and libEv
-based.
+This is a C/C++ library that implements a
+HBase client.
## Design Philosphy
@@ -51,3 +50,11 @@ the hbase_ prefix is assumed to be implementation private.
All C apis and typedefs will be prefixed with hb_.
All typedefs end with _t.
+
+
+## Docker
+
+The build environment is docker. This should keep a consistent
+build environment for everyone. Buck the build system works
+best with mmap'd files. On OSX this means that vmwarefusion
+works the best. However it should work with just the defaults.
http://git-wip-us.apache.org/repos/asf/hbase/blob/3c81072b/hbase-native-client/bin/build-all.sh
----------------------------------------------------------------------
diff --git a/hbase-native-client/bin/build-all.sh b/hbase-native-client/bin/build-all.sh
deleted file mode 100755
index a3e45de..0000000
--- a/hbase-native-client/bin/build-all.sh
+++ /dev/null
@@ -1,41 +0,0 @@
-#! /usr/bin/env bash
-#
-#/**
-# * Copyright The Apache Software Foundation
-# *
-# * 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.
-# */
-
-set -e
-set -x
-
-SOURCE="${BASH_SOURCE[0]}"
-while [ -h "$SOURCE" ]; do # resolve $SOURCE until the file is no longer a symlink
- DIR="$( cd -P "$( dirname "$SOURCE" )" && pwd )"
- SOURCE="$(readlink "$SOURCE")"
- [[ $SOURCE != /* ]] && SOURCE="$DIR/$SOURCE" # if $SOURCE was a relative symlink, we need to resolve it relative to the path where the symlink file was located
-done
-DIR="$( cd -P "$( dirname "$SOURCE" )" && pwd )"
-
-source ${DIR}/hbase-client-env.sh
-
-${DIR}/download-thirdparty.sh
-${DIR}/build-thirdparty.sh
-cd ${HBASE_DIR}
-cmake .
-make clean all
-make test
http://git-wip-us.apache.org/repos/asf/hbase/blob/3c81072b/hbase-native-client/bin/build-thirdparty.sh
----------------------------------------------------------------------
diff --git a/hbase-native-client/bin/build-thirdparty.sh b/hbase-native-client/bin/build-thirdparty.sh
deleted file mode 100755
index 097c1a4..0000000
--- a/hbase-native-client/bin/build-thirdparty.sh
+++ /dev/null
@@ -1,64 +0,0 @@
-#! /usr/bin/env bash
-#
-#/**
-# * Copyright The Apache Software Foundation
-# *
-# * 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.
-# */
-
-set -x
-set -e
-
-SOURCE="${BASH_SOURCE[0]}"
-while [ -h "$SOURCE" ]; do # resolve $SOURCE until the file is no longer a symlink
- DIR="$( cd -P "$( dirname "$SOURCE" )" && pwd )"
- SOURCE="$(readlink "$SOURCE")"
- [[ $SOURCE != /* ]] && SOURCE="$DIR/$SOURCE" # if $SOURCE was a relative symlink, we need to resolve it relative to the path where the symlink file was located
-done
-DIR="$( cd -P "$( dirname "$SOURCE" )" && pwd )"
-
-source ${DIR}/../bin/hbase-client-env.sh
-
-# On some systems, autotools installs libraries to lib64 rather than lib. Fix
-# this by setting up lib64 as a symlink to lib. We have to do this step first
-# to handle cases where one third-party library depends on another.
-mkdir -p "${HBASE_PREFIX}/lib"
-cd ${HBASE_PREFIX}
-ln -sf lib "${HBASE_PREFIX}/lib64"
-
-if [ ! -f gtest ]; then
- cd ${HBASE_GTEST_DIR}
- cmake .
- make -j4
- cd ..
- ln -sf ${HBASE_GTEST_DIR} gtest
-fi
-
-if [ ! -f ${HBASE_PREFIX}/lib/libprotobuf.a ]; then
- cd ${HBASE_PROTOBUF_DIR}
- ./configure --with-pic --disable-shared --prefix=${HBASE_PREFIX}
- make -j4 install
-fi
-
-if [ ! -f ${HBASE_PREFIX}/lib/libev.a ]; then
- cd ${HBASE_LIBEV_DIR}
- ./configure --with-pic --disable-shared --prefix=${HBASE_PREFIX}
- make -j4 install
-fi
-
-echo "---------------------"
-echo "Thirdparty dependencies built and installed into $HBASE_PREFIX successfully"
http://git-wip-us.apache.org/repos/asf/hbase/blob/3c81072b/hbase-native-client/bin/download-thirdparty.sh
----------------------------------------------------------------------
diff --git a/hbase-native-client/bin/download-thirdparty.sh b/hbase-native-client/bin/download-thirdparty.sh
deleted file mode 100755
index db98aae..0000000
--- a/hbase-native-client/bin/download-thirdparty.sh
+++ /dev/null
@@ -1,70 +0,0 @@
-#! /usr/bin/env bash
-#
-#/**
-# * Copyright The Apache Software Foundation
-# *
-# * 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.
-# */
-
-set -x
-set -e
-
-SOURCE="${BASH_SOURCE[0]}"
-while [ -h "$SOURCE" ]; do # resolve $SOURCE until the file is no longer a symlink
- DIR="$( cd -P "$( dirname "$SOURCE" )" && pwd )"
- SOURCE="$(readlink "$SOURCE")"
- [[ $SOURCE != /* ]] && SOURCE="$DIR/$SOURCE" # if $SOURCE was a relative symlink, we need to resolve it relative to the path where the symlink file was located
-done
-DIR="$( cd -P "$( dirname "$SOURCE" )" && pwd )"
-
-source ${DIR}/../bin/hbase-client-env.sh
-
-mkdir -p ${HBASE_TP_DIR}
-cd ${HBASE_TP_DIR}
-
-
-if [ ! -d ${HBASE_GTEST_DIR} ]; then
- echo "Fetching gtest"
- wget -c http://googletest.googlecode.com/files/gtest-${HBASE_GTEST_VERSION}.zip
- unzip gtest-${HBASE_GTEST_VERSION}.zip
- rm gtest-${HBASE_GTEST_VERSION}.zip
-fi
-
-if [ ! -d ${HBASE_PROTOBUF_DIR} ]; then
- echo "Fetching protobuf"
- wget -c http://protobuf.googlecode.com/files/protobuf-${HBASE_PROTOBUF_VERSION}.tar.gz
- tar xzf protobuf-${HBASE_PROTOBUF_VERSION}.tar.gz
- rm protobuf-${HBASE_PROTOBUF_VERSION}.tar.gz
-fi
-
-if [ ! -d $HBASE_LIBEV_DIR ]; then
- echo "Fetching libev"
- wget -c http://dist.schmorp.de/libev/libev-${HBASE_LIBEV_VERSION}.tar.gz
- tar zxf libev-${HBASE_LIBEV_VERSION}.tar.gz
- rm -rf libev-${HBASE_LIBEV_VERSION}.tar.gz
-fi
-
-if [ ! -d $HBASE_PREFIX/bin/cpplint.py ]; then
- echo "Fetching cpplint"
- mkdir -p $HBASE_PREFIX/bin/
- wget -O $HBASE_PREFIX/bin/cpplint.py http://google-styleguide.googlecode.com/svn/trunk/cpplint/cpplint.py
- chmod +x $HBASE_PREFIX/bin/cpplint.py
-fi
-
-
-echo "---------------"
-echo "Thirdparty dependencies downloaded successfully"
http://git-wip-us.apache.org/repos/asf/hbase/blob/3c81072b/hbase-native-client/bin/hbase-client-env.sh
----------------------------------------------------------------------
diff --git a/hbase-native-client/bin/hbase-client-env.sh b/hbase-native-client/bin/hbase-client-env.sh
deleted file mode 100644
index 96763da..0000000
--- a/hbase-native-client/bin/hbase-client-env.sh
+++ /dev/null
@@ -1,47 +0,0 @@
-#! /usr/bin/env bash
-#
-#/**
-# * Copyright The Apache Software Foundation
-# *
-# * 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.
-# */
-
-SOURCE="${BASH_SOURCE[0]}"
-while [ -h "$SOURCE" ]; do # resolve $SOURCE until the file is no longer a symlink
- DIR="$( cd -P "$( dirname "$SOURCE" )" && pwd )"
- SOURCE="$(readlink "$SOURCE")"
- [[ $SOURCE != /* ]] && SOURCE="$DIR/$SOURCE" # if $SOURCE was a relative symlink, we need to
- # resolve it relative to the path where
- # the symlink file was located
-done
-DIR="$( cd -P "$( dirname "$SOURCE" )" && pwd )"
-HBASE_DIR="${DIR}/../"
-HBASE_TP_DIR="${HBASE_DIR}/thirdparty/"
-
-HBASE_PREFIX=$HBASE_TP_DIR/installed
-
-HBASE_GTEST_VERSION=1.7.0
-HBASE_GTEST_DIR=$HBASE_TP_DIR/gtest-$HBASE_GTEST_VERSION
-
-HBASE_PROTOBUF_VERSION=2.5.0
-HBASE_PROTOBUF_DIR=$HBASE_TP_DIR/protobuf-$HBASE_PROTOBUF_VERSION
-
-HBASE_LIBEV_VERSION=4.15
-HBASE_LIBEV_DIR=$HBASE_TP_DIR/libev-$HBASE_LIBEV_VERSION
-
-# use the compiled tools
-export PATH=$HBASE_PREFIX/bin:$PATH
http://git-wip-us.apache.org/repos/asf/hbase/blob/3c81072b/hbase-native-client/bin/start-docker.sh
----------------------------------------------------------------------
diff --git a/hbase-native-client/bin/start-docker.sh b/hbase-native-client/bin/start-docker.sh
new file mode 100755
index 0000000..1c9b02e
--- /dev/null
+++ b/hbase-native-client/bin/start-docker.sh
@@ -0,0 +1,32 @@
+#!/usr/bin/env bash
+##
+# 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.
+
+set -e
+set -x
+
+eval "$(docker-machine env docker-vm)"
+docker build -t hbase_native .
+
+
+mkdir third-party || true
+if [[ ! -d third-party/googletest ]]; then
+ git clone https://github.com/google/googletest.git third-party/googletest
+fi
+
+
+docker run -v ${PWD}/..:/usr/local/src/hbase -it hbase_native /bin/bash
http://git-wip-us.apache.org/repos/asf/hbase/blob/3c81072b/hbase-native-client/cmake_modules/FindGTest.cmake
----------------------------------------------------------------------
diff --git a/hbase-native-client/cmake_modules/FindGTest.cmake b/hbase-native-client/cmake_modules/FindGTest.cmake
deleted file mode 100644
index 8d27876..0000000
--- a/hbase-native-client/cmake_modules/FindGTest.cmake
+++ /dev/null
@@ -1,53 +0,0 @@
-# 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.
-
-set( GTEST_INCLUDE_SEARCH
- ${CMAKE_SOURCE_DIR}/thirdparty/gtest/include
-)
-
-set( GTEST_LIB_SEARCH
- ${CMAKE_SOURCE_DIR}/thirdparty/gtest
-)
-
-find_path(GTEST_INCLUDE
- NAMES gtest/gtest.h
- PATHS ${GTEST_INCLUDE_SEARCH}
- NO_DEFAULT_PATH
-)
-
-find_library(GTEST_LIBRARY
- NAMES gtest
- PATHS ${GTEST_LIB_SEARCH}
- NO_DEFAULT_PATH
-)
-
-find_library(GTEST_LIBRARY_MAIN
- NAMES gtest_main
- PATHS ${GTEST_LIB_SEARCH}
- NO_DEFAULT_PATH
-)
-
-if (GTEST_INCLUDE AND GTEST_LIBRARY AND GTEST_LIBRARY_MAIN)
- set(GTEST_LIBS ${GTEST_LIBRARY} ${GTEST_LIBRARY_MAIN})
- set(GTEST_INCLUDE_DIR ${GTEST_INCLUDE})
- set(GTEST_FOUND TRUE)
-endif()
-
-mark_as_advanced(
- GTEST_INCLUDE_DIR
- GTEST_LIBS
-)
http://git-wip-us.apache.org/repos/asf/hbase/blob/3c81072b/hbase-native-client/cmake_modules/FindLibEv.cmake
----------------------------------------------------------------------
diff --git a/hbase-native-client/cmake_modules/FindLibEv.cmake b/hbase-native-client/cmake_modules/FindLibEv.cmake
deleted file mode 100644
index 5fd3e86..0000000
--- a/hbase-native-client/cmake_modules/FindLibEv.cmake
+++ /dev/null
@@ -1,47 +0,0 @@
-# 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.
-
-set( LIBEV_INCLUDE_SEARCH
- ${CMAKE_SOURCE_DIR}/thirdparty/installed/include
-)
-
-set( LIBEV_LIB_SEARCH
- ${CMAKE_SOURCE_DIR}/thirdparty/installed/include
-)
-
-find_path(LIBEV_INCLUDE
- NAMES ev++.h
- PATHS ${LIBEV_INCLUDE_SEARCH}
- NO_DEFAULT_PATH
-)
-
-find_library(LIBEV_LIBRARY
- NAMES ev
- PATHS ${LIBEV_LIB_SEARCH}
- NO_DEFAULT_PATH
-)
-
-if (LIBEV_INCLUDE_PATH AND LIBEV_LIBRARY)
- set(LIBEV_LIBS ${LIBEV_LIBRARY})
- set(LIBEV_INCLUDE_DIR ${LIBEV_INCLUDE})
- set(LIBEV_FOUND TRUE)
-endif()
-
-mark_as_advanced(
- LIBEV_INCLUDE_DIR
- LIBEV_LIBS
-)
http://git-wip-us.apache.org/repos/asf/hbase/blob/3c81072b/hbase-native-client/core/BUCK
----------------------------------------------------------------------
diff --git a/hbase-native-client/core/BUCK b/hbase-native-client/core/BUCK
new file mode 100644
index 0000000..a7eaa9e
--- /dev/null
+++ b/hbase-native-client/core/BUCK
@@ -0,0 +1,50 @@
+##
+# 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.
+
+
+cxx_binary(
+ name = "core",
+ headers = [
+ "admin.h",
+ "client.h",
+ "connection.h",
+ "connection_attr.h",
+ "delete.h",
+ "get.h",
+ "hbase_macros.h",
+ "mutation.h",
+ "put.h",
+ "scanner.h",
+ ],
+ srcs = [
+ "admin.cc",
+ "client.cc",
+ "connection.cc",
+ "get.cc",
+ "mutation.cc",
+ "put.cc",
+ "delete.cc",
+ "scanner.cc",
+ ],
+ deps = [
+ "//third-party:folly",
+ "//third-party:wangle",
+ ],
+ visibility = [
+ 'PUBLIC',
+ ],
+)
http://git-wip-us.apache.org/repos/asf/hbase/blob/3c81072b/hbase-native-client/core/admin.cc
----------------------------------------------------------------------
diff --git a/hbase-native-client/core/admin.cc b/hbase-native-client/core/admin.cc
new file mode 100644
index 0000000..897e6bf
--- /dev/null
+++ b/hbase-native-client/core/admin.cc
@@ -0,0 +1,20 @@
+/*
+ * 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.
+ *
+ */
+
+#include "core/admin.h"
http://git-wip-us.apache.org/repos/asf/hbase/blob/3c81072b/hbase-native-client/core/admin.h
----------------------------------------------------------------------
diff --git a/hbase-native-client/core/admin.h b/hbase-native-client/core/admin.h
new file mode 100644
index 0000000..775181c
--- /dev/null
+++ b/hbase-native-client/core/admin.h
@@ -0,0 +1,22 @@
+/*
+ * 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.
+ *
+ */
+
+#pragma once
+
+class Admin {};
http://git-wip-us.apache.org/repos/asf/hbase/blob/3c81072b/hbase-native-client/core/client.cc
----------------------------------------------------------------------
diff --git a/hbase-native-client/core/client.cc b/hbase-native-client/core/client.cc
new file mode 100644
index 0000000..98cf38a
--- /dev/null
+++ b/hbase-native-client/core/client.cc
@@ -0,0 +1,38 @@
+/*
+ * 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.
+ *
+ */
+
+#include "core/client.h"
+
+#include <folly/Logging.h>
+#include <folly/Random.h>
+#include <glog/logging.h>
+#include <gflags/gflags.h>
+
+using namespace folly;
+
+int main(int argc, char *argv[]) {
+ google::ParseCommandLineFlags(&argc, &argv, true);
+ google::InitGoogleLogging(argv[0]);
+
+ FB_LOG_EVERY_MS(INFO, 10000) << "Hello";
+ for (long i = 0; i < 10000000; i++) {
+ FB_LOG_EVERY_MS(INFO, 1) << Random::rand32();
+ }
+ return 0;
+}
http://git-wip-us.apache.org/repos/asf/hbase/blob/3c81072b/hbase-native-client/core/client.h
----------------------------------------------------------------------
diff --git a/hbase-native-client/core/client.h b/hbase-native-client/core/client.h
new file mode 100644
index 0000000..921cecc
--- /dev/null
+++ b/hbase-native-client/core/client.h
@@ -0,0 +1,24 @@
+/*
+ * 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.
+ *
+ */
+
+#pragma once
+
+#include <folly/io/IOBuf.h>
+
+class Client {};
http://git-wip-us.apache.org/repos/asf/hbase/blob/3c81072b/hbase-native-client/core/connection.cc
----------------------------------------------------------------------
diff --git a/hbase-native-client/core/connection.cc b/hbase-native-client/core/connection.cc
new file mode 100644
index 0000000..e9a28eb
--- /dev/null
+++ b/hbase-native-client/core/connection.cc
@@ -0,0 +1,20 @@
+/*
+ * 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.
+ */
+#include "core/connection.h"
+
+void Connection::set_zk_quorum(char *zk_q) { this->zk_quorum = zk_q; }
http://git-wip-us.apache.org/repos/asf/hbase/blob/3c81072b/hbase-native-client/core/connection.h
----------------------------------------------------------------------
diff --git a/hbase-native-client/core/connection.h b/hbase-native-client/core/connection.h
new file mode 100644
index 0000000..5c9d6b8
--- /dev/null
+++ b/hbase-native-client/core/connection.h
@@ -0,0 +1,26 @@
+/*
+ * 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.
+ */
+
+#pragma once
+
+class Connection {
+ char *zk_quorum;
+
+public:
+ void set_zk_quorum(char *zk_q);
+};
http://git-wip-us.apache.org/repos/asf/hbase/blob/3c81072b/hbase-native-client/core/connection_attr.h
----------------------------------------------------------------------
diff --git a/hbase-native-client/core/connection_attr.h b/hbase-native-client/core/connection_attr.h
new file mode 100644
index 0000000..a312005
--- /dev/null
+++ b/hbase-native-client/core/connection_attr.h
@@ -0,0 +1,24 @@
+/*
+ * 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.
+ *
+ */
+
+#pragma once
+
+#include "core/hbase_macros.h"
+
+class ConnectionAttr {};
http://git-wip-us.apache.org/repos/asf/hbase/blob/3c81072b/hbase-native-client/core/delete.cc
----------------------------------------------------------------------
diff --git a/hbase-native-client/core/delete.cc b/hbase-native-client/core/delete.cc
new file mode 100644
index 0000000..57030be
--- /dev/null
+++ b/hbase-native-client/core/delete.cc
@@ -0,0 +1,21 @@
+/*
+ * 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.
+ */
+
+#include "core/delete.h"
+
+Delete::~Delete() {}
http://git-wip-us.apache.org/repos/asf/hbase/blob/3c81072b/hbase-native-client/core/delete.h
----------------------------------------------------------------------
diff --git a/hbase-native-client/core/delete.h b/hbase-native-client/core/delete.h
new file mode 100644
index 0000000..34f6a6c
--- /dev/null
+++ b/hbase-native-client/core/delete.h
@@ -0,0 +1,27 @@
+/*
+ * 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.
+ *
+ */
+
+#pragma once
+
+#include "core/mutation.h"
+
+class Delete : public Mutation {
+public:
+ ~Delete();
+};
http://git-wip-us.apache.org/repos/asf/hbase/blob/3c81072b/hbase-native-client/core/get.cc
----------------------------------------------------------------------
diff --git a/hbase-native-client/core/get.cc b/hbase-native-client/core/get.cc
new file mode 100644
index 0000000..9e11332
--- /dev/null
+++ b/hbase-native-client/core/get.cc
@@ -0,0 +1,20 @@
+/*
+ * 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.
+ *
+ */
+
+#include "core/get.h"
http://git-wip-us.apache.org/repos/asf/hbase/blob/3c81072b/hbase-native-client/core/get.h
----------------------------------------------------------------------
diff --git a/hbase-native-client/core/get.h b/hbase-native-client/core/get.h
new file mode 100644
index 0000000..b4b5912
--- /dev/null
+++ b/hbase-native-client/core/get.h
@@ -0,0 +1,22 @@
+/*
+ * 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.
+ *
+ */
+
+#pragma once
+
+class Get {};
http://git-wip-us.apache.org/repos/asf/hbase/blob/3c81072b/hbase-native-client/core/hbase_macros.h
----------------------------------------------------------------------
diff --git a/hbase-native-client/core/hbase_macros.h b/hbase-native-client/core/hbase_macros.h
new file mode 100644
index 0000000..48304f0
--- /dev/null
+++ b/hbase-native-client/core/hbase_macros.h
@@ -0,0 +1,56 @@
+/*
+ * 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.
+ *
+ */
+
+#pragma once
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/**
+ * The following code block define API as the tag for exported
+ * functions. The library should be compiled with symbols visibility
+ * set to hidden by default and only the exported functions should be
+ * tagged as HBASE_API.
+ *
+ * When building the library on Windows, compile with compiler flag
+ * "-D_LIBHBASE_IMPLEMENTATION_", whereas when linking application with
+ * this library, this compiler flag should not be used.
+ */
+#if defined _WIN32 || defined __CYGWIN__
+#ifdef _LIBHBASE_IMPLEMENTATION_
+#define API __declspec(dllexport)
+#else
+#ifdef _LIBHBASE_TEST_
+#define HBASE_API
+#else
+#define HBASE_API __declspec(dllimport)
+#endif
+#endif
+#else
+#if __GNUC__ >= 4
+#define HBASE_API __attribute__((visibility("default")))
+#else
+#define HBASE_API
+#endif
+#endif
+
+#ifdef __cplusplus
+} // extern "C"
+#endif // __cplusplus
http://git-wip-us.apache.org/repos/asf/hbase/blob/3c81072b/hbase-native-client/core/mutation.cc
----------------------------------------------------------------------
diff --git a/hbase-native-client/core/mutation.cc b/hbase-native-client/core/mutation.cc
new file mode 100644
index 0000000..52910d5
--- /dev/null
+++ b/hbase-native-client/core/mutation.cc
@@ -0,0 +1,41 @@
+/*
+ * 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.
+ *
+ */
+
+#include "core/mutation.h"
+
+void Mutation::set_namespace(char *name_space, size_t name_space_length) {
+ this->name_space = name_space;
+ this->name_space_length = name_space_length;
+}
+
+void Mutation::set_table(char *table, size_t table_length) {
+ this->table = table;
+ this->table_length = table_length;
+}
+
+void Mutation::set_row(unsigned char *row, size_t row_length) {
+ this->row = row;
+ this->row_length = row_length;
+}
+
+void Mutation::set_durability(durability_type durability) {
+ this->durability = durability;
+}
+
+Mutation::~Mutation() {}
http://git-wip-us.apache.org/repos/asf/hbase/blob/3c81072b/hbase-native-client/core/mutation.h
----------------------------------------------------------------------
diff --git a/hbase-native-client/core/mutation.h b/hbase-native-client/core/mutation.h
new file mode 100644
index 0000000..1880571
--- /dev/null
+++ b/hbase-native-client/core/mutation.h
@@ -0,0 +1,58 @@
+/*
+ * 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.
+ *
+ */
+
+#pragma once
+
+#include <stdlib.h>
+
+typedef enum {
+ DELETE_ONE_VERSION,
+ DELETE_MULTIPLE_VERSIONS,
+ DELETE_FAMILY,
+ DELETE_FAMILY_VERSION
+} delete_type;
+
+typedef enum {
+ USE_DEFAULT,
+ SKIP_WAL,
+ ASYNC_WAL,
+ SYNC_WAL,
+ HSYNC_WAL
+} durability_type;
+
+class Mutation {
+ char *name_space;
+ size_t name_space_length;
+
+ char *table;
+ size_t table_length;
+
+ unsigned char *row;
+ size_t row_length;
+
+ durability_type durability;
+
+public:
+ void set_namespace(char *name_space, size_t name_space_length);
+ void set_table(char *table, size_t table_length);
+ void set_row(unsigned char *row, size_t row_length);
+ void set_durability(durability_type durability);
+
+ virtual ~Mutation();
+};
http://git-wip-us.apache.org/repos/asf/hbase/blob/3c81072b/hbase-native-client/core/put.cc
----------------------------------------------------------------------
diff --git a/hbase-native-client/core/put.cc b/hbase-native-client/core/put.cc
new file mode 100644
index 0000000..806a478
--- /dev/null
+++ b/hbase-native-client/core/put.cc
@@ -0,0 +1,21 @@
+/*
+ * 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.
+ */
+
+#include "core/put.h"
+
+Put::~Put() {}
http://git-wip-us.apache.org/repos/asf/hbase/blob/3c81072b/hbase-native-client/core/put.h
----------------------------------------------------------------------
diff --git a/hbase-native-client/core/put.h b/hbase-native-client/core/put.h
new file mode 100644
index 0000000..d34aa0d
--- /dev/null
+++ b/hbase-native-client/core/put.h
@@ -0,0 +1,27 @@
+/*
+ * 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.
+ *
+ */
+
+#pragma once
+
+#include "core/mutation.h"
+
+class Put : public Mutation {
+public:
+ ~Put();
+};
http://git-wip-us.apache.org/repos/asf/hbase/blob/3c81072b/hbase-native-client/core/scanner.cc
----------------------------------------------------------------------
diff --git a/hbase-native-client/core/scanner.cc b/hbase-native-client/core/scanner.cc
new file mode 100644
index 0000000..a10e444
--- /dev/null
+++ b/hbase-native-client/core/scanner.cc
@@ -0,0 +1,20 @@
+/*
+ * 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.
+ *
+ */
+
+#include "core/scanner.h"
http://git-wip-us.apache.org/repos/asf/hbase/blob/3c81072b/hbase-native-client/core/scanner.h
----------------------------------------------------------------------
diff --git a/hbase-native-client/core/scanner.h b/hbase-native-client/core/scanner.h
new file mode 100644
index 0000000..180865a
--- /dev/null
+++ b/hbase-native-client/core/scanner.h
@@ -0,0 +1,22 @@
+/*
+ * 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.
+ *
+ */
+
+#pragma once
+
+class Scanner {};
http://git-wip-us.apache.org/repos/asf/hbase/blob/3c81072b/hbase-native-client/rpc/CMakeLists.txt
----------------------------------------------------------------------
diff --git a/hbase-native-client/rpc/CMakeLists.txt b/hbase-native-client/rpc/CMakeLists.txt
new file mode 100644
index 0000000..2456923
--- /dev/null
+++ b/hbase-native-client/rpc/CMakeLists.txt
@@ -0,0 +1,17 @@
+# 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.
+
http://git-wip-us.apache.org/repos/asf/hbase/blob/3c81072b/hbase-native-client/src/async/CMakeLists.txt
----------------------------------------------------------------------
diff --git a/hbase-native-client/src/async/CMakeLists.txt b/hbase-native-client/src/async/CMakeLists.txt
deleted file mode 100644
index b2ed461..0000000
--- a/hbase-native-client/src/async/CMakeLists.txt
+++ /dev/null
@@ -1,32 +0,0 @@
-# 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.
-
-set( ASYNC_SRC
- hbase_admin.cc
- hbase_client.cc
- hbase_connection.cc
- hbase_get.cc
- hbase_mutations.cc
- hbase_result.cc
- hbase_scanner.cc
-)
-
-
-add_library(hasync OBJECT ${ASYNC_SRC})
-
-ADD_HBASE_ASYNC_TEST(mutations-test)
-ADD_HBASE_ASYNC_TEST(get-test)
http://git-wip-us.apache.org/repos/asf/hbase/blob/3c81072b/hbase-native-client/src/async/get-test.cc
----------------------------------------------------------------------
diff --git a/hbase-native-client/src/async/get-test.cc b/hbase-native-client/src/async/get-test.cc
deleted file mode 100644
index df94ce2..0000000
--- a/hbase-native-client/src/async/get-test.cc
+++ /dev/null
@@ -1,59 +0,0 @@
-/*
- * 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.
- *
- */
-
-#include <pthread.h>
-
-#include "gtest/gtest.h"
-#include "async/hbase_get.h"
-#include "async/hbase_client.h"
-
-
-pthread_cond_t cv;
-pthread_mutex_t mutex;
-
-TEST(GetTest, TestPut) {
- char tn[] = "T1";
- hb_byte_t row[] = "ROW";
-
- hb_client_t client = NULL;
- hb_get_t get = NULL;
- int32_t s1 = -1;
-
- pthread_cond_init(&cv, NULL);
- pthread_mutex_init(&mutex, NULL);
-
- s1 = hb_client_create(&client, NULL);
- EXPECT_EQ(0, s1);
-
- s1 = hb_get_create(&get);
- EXPECT_EQ(0, s1);
-
- hb_get_set_table(get, tn, 2);
- hb_get_set_row(get, row, 3);
-
- /*
- * TODO:
- * This is currently a NO-OP as there is no CB.
- */
- hb_get_send(client, get, NULL, NULL);
-
- hb_client_destroy(client, NULL, NULL);
-
- EXPECT_EQ(0, s1);
-}
http://git-wip-us.apache.org/repos/asf/hbase/blob/3c81072b/hbase-native-client/src/async/hbase_admin.cc
----------------------------------------------------------------------
diff --git a/hbase-native-client/src/async/hbase_admin.cc b/hbase-native-client/src/async/hbase_admin.cc
deleted file mode 100644
index 17ff2a7..0000000
--- a/hbase-native-client/src/async/hbase_admin.cc
+++ /dev/null
@@ -1,57 +0,0 @@
-/*
- * 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.
- *
- */
-
-#include "async/hbase_admin.h"
-
-#include <stdlib.h>
-#include <stdbool.h>
-
-#include "core/admin.h"
-#include "async/hbase_connection.h"
-
-int32_t hb_admin_create(hb_admin_t* admin_ptr,
- hb_connection_t connection) {
- (*admin_ptr) = reinterpret_cast<hb_admin_t>(new Admin());
- return 0;
-}
-
-/*
- * Disconnect the admin releasing any internal objects
- * or connections created in the background.
- */
-int32_t hb_admin_destroy(hb_admin_t admin,
- hb_admin_disconnection_cb cb, void * extra) {
- if (cb)
- cb(0, admin, extra);
- free(admin);
- return 0;
-}
-
-/*
- * See if a table exists.
- */
-int32_t hb_admin_table_exists(hb_admin_t admin,
- char * name_space, size_t name_space_length,
- char * table, size_t table_length,
- hb_admin_table_exists_cb cb, void * extra) {
- if (cb)
- cb(0, admin, name_space, name_space_length,
- table, table_length, true, extra);
- return 0;
-}
http://git-wip-us.apache.org/repos/asf/hbase/blob/3c81072b/hbase-native-client/src/async/hbase_admin.h
----------------------------------------------------------------------
diff --git a/hbase-native-client/src/async/hbase_admin.h b/hbase-native-client/src/async/hbase_admin.h
deleted file mode 100644
index f03a83f..0000000
--- a/hbase-native-client/src/async/hbase_admin.h
+++ /dev/null
@@ -1,69 +0,0 @@
-/*
- * 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.
- *
- */
-
-#ifndef ASYNC_HBASE_ADMIN_H_
-#define ASYNC_HBASE_ADMIN_H_
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#include <stdlib.h>
-#include <stdbool.h>
-
-#include "core/hbase_macros.h"
-#include "async/hbase_connection.h"
-
-
-typedef void (* hb_admin_disconnection_cb)( int32_t status,
- hb_admin_t admin, void * extra);
-typedef void (* hb_admin_table_exists_cb)(int32_t status, hb_admin_t admin,
- char * name_space, size_t name_space_length,
- char * table, size_t table_length, bool exsists, void * extra);
-
-/**
- * Create a new hb_admin.
- * All fields are initialized to the defaults. If you want to set
- * connection or other properties, set those before calling any
- * RPC functions.
- */
-HBASE_API int32_t hb_admin_create(hb_admin_t* admin_ptr,
- hb_connection_t connection);
-
-/*
- * Disconnect the admin releasing any internal objects
- * or connections created in the background.
- */
-HBASE_API int32_t hb_admin_destroy(hb_admin_t admin,
- hb_admin_disconnection_cb cb, void * extra);
-
-/*
- * See if a table exists.
- */
-HBASE_API int32_t hb_admin_table_exists(hb_admin_t admin,
- char * name_space, size_t name_space_length,
- char * table, size_t table_length,
- hb_admin_table_exists_cb cb, void * extra);
-
-
-#ifdef __cplusplus
-} // extern "C"
-#endif // __cplusplus
-
-#endif // ASYNC_HBASE_ADMIN_H_
http://git-wip-us.apache.org/repos/asf/hbase/blob/3c81072b/hbase-native-client/src/async/hbase_client.cc
----------------------------------------------------------------------
diff --git a/hbase-native-client/src/async/hbase_client.cc b/hbase-native-client/src/async/hbase_client.cc
deleted file mode 100644
index 98e3dbf..0000000
--- a/hbase-native-client/src/async/hbase_client.cc
+++ /dev/null
@@ -1,47 +0,0 @@
-/*
- * 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.
- *
- */
-
-#include "async/hbase_client.h"
-
-#include <pthread.h>
-#include <stdlib.h>
-#include <string.h>
-
-#include "core/client.h"
-#include "async/hbase_connection.h"
-
-int32_t hb_client_create(hb_client_t* client_ptr,
- hb_connection_t connection) {
- (*client_ptr) = reinterpret_cast<hb_client_t>(new Client());
- if (client_ptr == NULL)
- return -1; // TODO(eclark): setup the errno file.
- return 0;
-}
-
-int32_t hb_client_destroy(hb_client_t client,
- hb_client_disconnection_cb cb, void * extra) {
- if (client == NULL)
- return -2;
- if (cb) {
- cb(0, client, extra);
- }
- free(client);
- return 0;
-}
-
http://git-wip-us.apache.org/repos/asf/hbase/blob/3c81072b/hbase-native-client/src/async/hbase_client.h
----------------------------------------------------------------------
diff --git a/hbase-native-client/src/async/hbase_client.h b/hbase-native-client/src/async/hbase_client.h
deleted file mode 100644
index 34c3d98..0000000
--- a/hbase-native-client/src/async/hbase_client.h
+++ /dev/null
@@ -1,60 +0,0 @@
-/*
- * 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.
- *
- */
-
-#ifndef ASYNC_HBASE_CLIENT_H_
-#define ASYNC_HBASE_CLIENT_H_
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#include "core/hbase_macros.h"
-#include "core/hbase_types.h"
-
-/*
- * Client disconnection callback typedef
- *
- * This is called after the connections are closed, but just
- * before the client is freed.
- */
-typedef void (* hb_client_disconnection_cb)( int32_t status,
- hb_client_t client, void * extra);
-
-/**
- * Create an hb_client_t.
- *
- * If connection is null then all defaults will be used.
- */
-HBASE_API int32_t hb_client_create(hb_client_t * client_ptr,
- hb_connection_t connection);
-
-/*
- * Disconnect the client releasing any internal objects
- * or connections created in the background.
- */
-HBASE_API int32_t hb_client_destroy(hb_client_t client,
- hb_client_disconnection_cb cb, void * extra);
-
-#ifdef __cplusplus
-} // extern "C"
-#endif // __cplusplus
-
-#endif // ASYNC_HBASE_CLIENT_H_
-
-
http://git-wip-us.apache.org/repos/asf/hbase/blob/3c81072b/hbase-native-client/src/async/hbase_connection.cc
----------------------------------------------------------------------
diff --git a/hbase-native-client/src/async/hbase_connection.cc b/hbase-native-client/src/async/hbase_connection.cc
deleted file mode 100644
index 57fa4f5..0000000
--- a/hbase-native-client/src/async/hbase_connection.cc
+++ /dev/null
@@ -1,37 +0,0 @@
-/*
- * 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.
- *
- */
-
-#include "async/hbase_connection.h"
-
-#include "core/connection.h"
-#include "core/hbase_types.h"
-
-extern "C" {
-int32_t hb_connection_create(hb_connection_t * connection_ptr,
- hb_connection_attr_t connection_attr) {
- (*connection_ptr) = reinterpret_cast<hb_connection_t>(new Connection());
- if ((*connection_ptr) == NULL)
- return -1;
- return 0;
-}
-int32_t hb_connection_destroy(hb_connection_t connection) {
- free(connection);
- return 0;
-}
-} // extern "C"
http://git-wip-us.apache.org/repos/asf/hbase/blob/3c81072b/hbase-native-client/src/async/hbase_connection.h
----------------------------------------------------------------------
diff --git a/hbase-native-client/src/async/hbase_connection.h b/hbase-native-client/src/async/hbase_connection.h
deleted file mode 100644
index 343f36c..0000000
--- a/hbase-native-client/src/async/hbase_connection.h
+++ /dev/null
@@ -1,52 +0,0 @@
-/*
- * 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.
- *
- */
-
-#ifndef ASYNC_HBASE_CONNECTION_H_
-#define ASYNC_HBASE_CONNECTION_H_
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#include "core/hbase_macros.h"
-#include "core/hbase_types.h"
-#include "core/hbase_connection_attr.h"
-
-#include <stdlib.h>
-
-/**
- * Create an hb_connection.
- *
- * if connection_attr is null everything will be left as default
- */
-HBASE_API int32_t hb_connection_create(hb_connection_t * connection_ptr,
- hb_connection_attr_t connection_attr);
-
-/**
- * Destroy the connection and free all resources allocated at creation
- * time.
- */
-HBASE_API int32_t hb_connection_destroy(hb_connection_t connection);
-
-#ifdef __cplusplus
-} // extern "C"
-#endif // __cplusplus
-
-#endif // ASYNC_HBASE_CONNECTION_H_
-
http://git-wip-us.apache.org/repos/asf/hbase/blob/3c81072b/hbase-native-client/src/async/hbase_errno.h
----------------------------------------------------------------------
diff --git a/hbase-native-client/src/async/hbase_errno.h b/hbase-native-client/src/async/hbase_errno.h
deleted file mode 100644
index 1698bbd..0000000
--- a/hbase-native-client/src/async/hbase_errno.h
+++ /dev/null
@@ -1,23 +0,0 @@
-/*
- * 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.
- *
- */
-
-#ifndef ASYNC_HBASE_ERRNO_H_
-#define ASYNC_HBASE_ERRNO_H_
-
-#endif // ASYNC_HBASE_ERRNO_H_
http://git-wip-us.apache.org/repos/asf/hbase/blob/3c81072b/hbase-native-client/src/async/hbase_get.cc
----------------------------------------------------------------------
diff --git a/hbase-native-client/src/async/hbase_get.cc b/hbase-native-client/src/async/hbase_get.cc
deleted file mode 100644
index 32048d8..0000000
--- a/hbase-native-client/src/async/hbase_get.cc
+++ /dev/null
@@ -1,61 +0,0 @@
-/*
- * 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.
- *
- */
-
-#include "async/hbase_get.h"
-
-#include <stdlib.h>
-#include <string.h>
-
-#include "core/get.h"
-
-int32_t hb_get_create(hb_get_t * get_ptr) {
- (*get_ptr) = reinterpret_cast<hb_get_t>(new Get());
- if ((*get_ptr) == NULL) {
- return -1;
- }
- return 0;
-}
-
-int32_t hb_get_destroy(hb_get_t get) {
- free(get);
- return 0;
-}
-
-int32_t hb_get_set_row(hb_get_t get, unsigned char * row,
- size_t row_length) {
- return 0;
-}
-
-int32_t hb_get_set_table(hb_get_t get,
- char * table, size_t table_length) {
- return 0;
-}
-
-int32_t hb_get_set_namespace(hb_get_t get,
- char * name_space, size_t name_space_length) {
- return 0;
-}
-
-int32_t hb_get_send(hb_client_t client,
- hb_get_t get, hb_get_cb cb, void * extra) {
- if (cb) {
- cb(0, client, get, NULL, extra);
- }
- return 0;
-}
http://git-wip-us.apache.org/repos/asf/hbase/blob/3c81072b/hbase-native-client/src/async/hbase_get.h
----------------------------------------------------------------------
diff --git a/hbase-native-client/src/async/hbase_get.h b/hbase-native-client/src/async/hbase_get.h
deleted file mode 100644
index 7d91c08..0000000
--- a/hbase-native-client/src/async/hbase_get.h
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- * 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.
- *
- */
-
-#ifndef ASYNC_HBASE_GET_H_
-#define ASYNC_HBASE_GET_H_
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#include "core/hbase_macros.h"
-#include "core/hbase_types.h"
-
-/**
- * Allocate a new get structure.
- * Ownership passes to the caller.
- */
-HBASE_API int32_t hb_get_create(hb_get_t * get_ptr);
-
-/**
- * Destroy and free a get structure.
- */
-HBASE_API int32_t hb_get_destroy(hb_get_t get);
-
-/**
- * set the row of this get.
- */
-HBASE_API int32_t hb_get_set_row(hb_get_t get, hb_byte_t * row,
- size_t row_length);
-
-/**
- * Set the table.
- */
-HBASE_API int32_t hb_get_set_table(hb_get_t get,
- char * table, size_t table_length);
-
-/**
- * Set the namespace this get is targeting.
- */
-HBASE_API int32_t hb_get_set_namespace(hb_get_t get,
- char * name_space, size_t name_space_length);
-
-/*
- * get call back typedef.
- */
-typedef void (* hb_get_cb)(int32_t status, hb_client_t client,
- hb_get_t get, hb_result_t results, void * extra);
-
-HBASE_API int32_t hb_get_send(hb_client_t client,
- hb_get_t get, hb_get_cb cb, void * extra);
-
-
-#ifdef __cplusplus
-} // extern "C"
-#endif // __cplusplus
-
-#endif // ASYNC_HBASE_GET_H_
http://git-wip-us.apache.org/repos/asf/hbase/blob/3c81072b/hbase-native-client/src/async/hbase_mutations.cc
----------------------------------------------------------------------
diff --git a/hbase-native-client/src/async/hbase_mutations.cc b/hbase-native-client/src/async/hbase_mutations.cc
deleted file mode 100644
index 2456dc0..0000000
--- a/hbase-native-client/src/async/hbase_mutations.cc
+++ /dev/null
@@ -1,111 +0,0 @@
-/*
- * 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.
- *
- */
-
-#include "async/hbase_mutations.h"
-
-#include <stdlib.h>
-
-#include "core/hbase_types.h"
-#include "core/mutation.h"
-#include "core/put.h"
-#include "core/delete.h"
-
-#include "async/hbase_result.h"
-
-extern "C" {
-int32_t hb_put_create(hb_put_t* put_ptr) {
- (*put_ptr) = reinterpret_cast<hb_put_t>(new Put());
- return 0;
-}
-
-int32_t hb_delete_create(hb_delete_t * delete_ptr) {
- (*delete_ptr) = reinterpret_cast<hb_delete_t>(new Delete());
- return 0;
-}
-
-int32_t hb_increment_create(hb_increment_t * increment_ptr) {
- return 0;
-}
-
-int32_t hb_append_create(hb_append_t * append_ptr) {
- return 0;
-}
-
-int32_t hb_mutation_destroy(hb_mutation_t mutation) {
- return 0;
-}
-
-HBASE_API int32_t hb_mutation_set_namespace(hb_mutation_t mutation,
- char * name_space, size_t name_space_length) {
- Mutation * m = reinterpret_cast<Mutation *>(mutation);
- m->set_namespace(name_space, name_space_length);
- return 0;
-}
-
-HBASE_API int32_t hb_mutation_set_table(hb_mutation_t mutation,
- char * table, size_t table_length) {
- Mutation * m = reinterpret_cast<Mutation *>(mutation);
- m->set_namespace(table, table_length);
- return 0;
-}
-
-int32_t hb_mutation_set_row(hb_mutation_t mutation,
- unsigned char * rk, size_t row_length) {
- Mutation * m = reinterpret_cast<Mutation *>(mutation);
- m->set_row(rk, row_length);
- return 0;
-}
-
-int32_t hb_mutation_set_durability(hb_mutation_t mutation,
- hb_durability_type durability) {
- Mutation * m = reinterpret_cast<Mutation *>(mutation);
- m->set_durability(durability);
- return 0;
-}
-
-int32_t hb_put_add_cell(hb_put_t put, hb_cell_t * cell) {
- return 0;
-}
-
-int32_t hb_delete_add_col(hb_increment_t incr,
- unsigned char * family, size_t family_length,
- unsigned char * qual, size_t qual_length) {
- return 0;
-}
-
-int32_t hb_increment_add_value(hb_increment_t incr,
- unsigned char * family, size_t family_length,
- unsigned char * qual, size_t qual_length,
- int64_t ammount) {
- return 0;
-}
-
-int32_t hb_append_add_cell(hb_append_t put, hb_cell_t * cell) {
- return 0;
-}
-
-int32_t hb_mutation_send(hb_client_t client,
- hb_mutation_t mutation, hb_mutation_cb cb,
- void * extra) {
- if (cb) {
- cb(0, client, mutation, NULL, extra);
- }
- return 0;
-}
-} // extern "C"
http://git-wip-us.apache.org/repos/asf/hbase/blob/3c81072b/hbase-native-client/src/async/hbase_mutations.h
----------------------------------------------------------------------
diff --git a/hbase-native-client/src/async/hbase_mutations.h b/hbase-native-client/src/async/hbase_mutations.h
deleted file mode 100644
index 4000390..0000000
--- a/hbase-native-client/src/async/hbase_mutations.h
+++ /dev/null
@@ -1,119 +0,0 @@
-/*
- * 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.
- *
- */
-
-#ifndef ASYNC_HBASE_MUTATIONS_H_
-#define ASYNC_HBASE_MUTATIONS_H_
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#include "core/hbase_types.h"
-#include "async/hbase_result.h"
-
-// Creation methods
-
-/**
- * Create a put.
- * Ownership passes to the caller.
- */
-HBASE_API int32_t hb_put_create(hb_put_t * put_ptr);
-
-/**
- * Create a delete
- * Ownership passes to the caller.
- */
-HBASE_API int32_t hb_delete_create(hb_delete_t * delete_ptr);
-
-/**
- * Create an increment
- * Ownership passes to the caller.
- */
-HBASE_API int32_t hb_increment_create(hb_increment_t * increment_ptr);
-
-/**
- * Create an append
- * Ownership passes to the caller.
- */
-HBASE_API int32_t hb_append_create(hb_append_t * append_ptr);
-
-/**
- * Destroy the mutation.
- * All internal structures are cleaned up. However any backing
- * data structures passed in by the user are not cleaned up.
- */
-HBASE_API int32_t hb_mutation_destroy(hb_mutation_t mutation);
-
-// Shared setters.
-HBASE_API int32_t hb_mutation_set_namespace(hb_mutation_t mutation,
- char * name_space, size_t name_space_length);
-HBASE_API int32_t hb_mutation_set_table(hb_mutation_t mutation,
- char * table, size_t table_length);
-HBASE_API int32_t hb_mutation_set_row(hb_mutation_t mutation,
- unsigned char * rk, size_t row_length);
-HBASE_API int32_t hb_mutation_set_durability(hb_mutation_t mutation,
- hb_durability_type durability);
-
-// Put Setters etc.
-HBASE_API int32_t hb_put_add_cell(hb_put_t put, hb_cell_t * cell);
-
-// Delete
-HBASE_API int32_t hb_delete_add_col(hb_increment_t incr,
- unsigned char * family, size_t family_length,
- unsigned char * qual, size_t qual_length);
-
-// Increment
-HBASE_API int32_t hb_increment_add_value(hb_increment_t incr,
- unsigned char * family, size_t family_length,
- unsigned char * qual, size_t qual_length,
- int64_t ammount);
-
-// Append
-HBASE_API int32_t hb_append_add_cell(hb_append_t put, hb_cell_t * cell);
-
-// Now that the mutations are created and populated
-// The real meat of the client is below.
-
-/*
- * mutation call back typedef
- */
-typedef void (* hb_mutation_cb)(int32_t status,
- hb_client_t client, hb_mutation_t mutation,
- hb_result_t result, void * extra);
-
-/*
- * Queue a single mutation. This mutation will be
- * sent out in the background and can be batched with
- * other requests destined for the same server.
- *
- * The call back will be executed after the response
- * is received from the RegionServer. Even if the
- * mutation was batched with other requests,
- * the call back will be invoked for every mutation
- * individually.
- */
-HBASE_API int32_t hb_mutation_send(hb_client_t client,
- hb_mutation_t mutation, hb_mutation_cb cb,
- void * extra);
-
-#ifdef __cplusplus
-} // extern "C"
-#endif // __cplusplus
-
-#endif // ASYNC_HBASE_MUTATIONS_H_
http://git-wip-us.apache.org/repos/asf/hbase/blob/3c81072b/hbase-native-client/src/async/hbase_result.cc
----------------------------------------------------------------------
diff --git a/hbase-native-client/src/async/hbase_result.cc b/hbase-native-client/src/async/hbase_result.cc
deleted file mode 100644
index 9351270..0000000
--- a/hbase-native-client/src/async/hbase_result.cc
+++ /dev/null
@@ -1,37 +0,0 @@
-/*
- * 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.
- *
- */
-
-#include "async/hbase_result.h"
-
-#include "core/hbase_types.h"
-
-int32_t hb_result_get_cells(hb_result_t result,
- hb_cell_t ** cell_ptr, size_t * num_cells) {
- return 0;
-}
-
-int32_t hb_result_get_table(hb_result_t result,
- char ** table, size_t * table_length) {
- return 0;
-}
-
-int32_t hb_result_get_namespace(hb_result_t result,
- char ** name_space, size_t * name_space_length) {
- return 0;
-}
[8/8] hbase git commit: HBASE-14853 Add on protobuf to c++ chain
Posted by ec...@apache.org.
HBASE-14853 Add on protobuf to c++ chain
Project: http://git-wip-us.apache.org/repos/asf/hbase/repo
Commit: http://git-wip-us.apache.org/repos/asf/hbase/commit/967f0910
Tree: http://git-wip-us.apache.org/repos/asf/hbase/tree/967f0910
Diff: http://git-wip-us.apache.org/repos/asf/hbase/diff/967f0910
Branch: refs/heads/HBASE-14850
Commit: 967f09101434ab20080029d597017d702b761a6e
Parents: ebbdbc7
Author: Elliott Clark <ec...@apache.org>
Authored: Mon Dec 28 15:33:52 2015 -0800
Committer: Elliott Clark <ec...@apache.org>
Committed: Fri Mar 25 16:12:13 2016 -0700
----------------------------------------------------------------------
hbase-native-client/bin/start-docker.sh | 1 +
hbase-native-client/core/BUCK | 1 +
hbase-native-client/core/client.cc | 4 +
hbase-native-client/core/client.h | 2 +
hbase-native-client/if/AccessControl.proto | 123 +++
hbase-native-client/if/Admin.proto | 309 ++++++++
hbase-native-client/if/Aggregate.proto | 63 ++
hbase-native-client/if/Authentication.proto | 82 ++
hbase-native-client/if/BUCK | 36 +
hbase-native-client/if/Cell.proto | 67 ++
hbase-native-client/if/Client.proto | 472 +++++++++++
hbase-native-client/if/ClusterId.proto | 34 +
hbase-native-client/if/ClusterStatus.proto | 224 ++++++
hbase-native-client/if/Comparator.proto | 74 ++
hbase-native-client/if/Encryption.proto | 33 +
hbase-native-client/if/ErrorHandling.proto | 58 ++
hbase-native-client/if/FS.proto | 45 ++
hbase-native-client/if/Filter.proto | 170 ++++
hbase-native-client/if/HBase.proto | 258 ++++++
hbase-native-client/if/HFile.proto | 49 ++
hbase-native-client/if/LoadBalancer.proto | 29 +
hbase-native-client/if/MapReduce.proto | 37 +
hbase-native-client/if/Master.proto | 778 +++++++++++++++++++
hbase-native-client/if/MasterProcedure.proto | 245 ++++++
hbase-native-client/if/MultiRowMutation.proto | 45 ++
hbase-native-client/if/Procedure.proto | 119 +++
hbase-native-client/if/Quota.proto | 76 ++
hbase-native-client/if/RPC.proto | 136 ++++
hbase-native-client/if/RegionNormalizer.proto | 28 +
hbase-native-client/if/RegionServerStatus.proto | 158 ++++
hbase-native-client/if/RowProcessor.proto | 45 ++
hbase-native-client/if/SecureBulkLoad.proto | 72 ++
hbase-native-client/if/Snapshot.proto | 66 ++
hbase-native-client/if/Tracing.proto | 33 +
hbase-native-client/if/VisibilityLabels.proto | 83 ++
hbase-native-client/if/WAL.proto | 172 ++++
hbase-native-client/if/ZooKeeper.proto | 155 ++++
hbase-native-client/rpc/CMakeLists.txt | 17 -
hbase-native-client/third-party/BUCK | 4 +-
39 files changed, 4385 insertions(+), 18 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/hbase/blob/967f0910/hbase-native-client/bin/start-docker.sh
----------------------------------------------------------------------
diff --git a/hbase-native-client/bin/start-docker.sh b/hbase-native-client/bin/start-docker.sh
index bf38912..4426705 100755
--- a/hbase-native-client/bin/start-docker.sh
+++ b/hbase-native-client/bin/start-docker.sh
@@ -20,6 +20,7 @@ set -e
set -x
eval "$(docker-machine env docker-vm)"
+eval "$(docker-machine env dinghy)"
docker build -t hbase_native .
http://git-wip-us.apache.org/repos/asf/hbase/blob/967f0910/hbase-native-client/core/BUCK
----------------------------------------------------------------------
diff --git a/hbase-native-client/core/BUCK b/hbase-native-client/core/BUCK
index 2e4e755..ef027a1 100644
--- a/hbase-native-client/core/BUCK
+++ b/hbase-native-client/core/BUCK
@@ -41,6 +41,7 @@ cxx_binary(
"scanner.cc",
],
deps = [
+ "//if:if",
"//third-party:folly",
"//third-party:wangle",
],
http://git-wip-us.apache.org/repos/asf/hbase/blob/967f0910/hbase-native-client/core/client.cc
----------------------------------------------------------------------
diff --git a/hbase-native-client/core/client.cc b/hbase-native-client/core/client.cc
index 98cf38a..a04daee 100644
--- a/hbase-native-client/core/client.cc
+++ b/hbase-native-client/core/client.cc
@@ -24,9 +24,13 @@
#include <glog/logging.h>
#include <gflags/gflags.h>
+#include "if/ZooKeeper.pb.h"
+
using namespace folly;
+using namespace hbase::pb;
int main(int argc, char *argv[]) {
+ MetaRegionServer mrs;
google::ParseCommandLineFlags(&argc, &argv, true);
google::InitGoogleLogging(argv[0]);
http://git-wip-us.apache.org/repos/asf/hbase/blob/967f0910/hbase-native-client/core/client.h
----------------------------------------------------------------------
diff --git a/hbase-native-client/core/client.h b/hbase-native-client/core/client.h
index 921cecc..35a3bd8 100644
--- a/hbase-native-client/core/client.h
+++ b/hbase-native-client/core/client.h
@@ -21,4 +21,6 @@
#include <folly/io/IOBuf.h>
+#include "if/Cell.pb.h"
+
class Client {};
http://git-wip-us.apache.org/repos/asf/hbase/blob/967f0910/hbase-native-client/if/AccessControl.proto
----------------------------------------------------------------------
diff --git a/hbase-native-client/if/AccessControl.proto b/hbase-native-client/if/AccessControl.proto
new file mode 100644
index 0000000..e67540b
--- /dev/null
+++ b/hbase-native-client/if/AccessControl.proto
@@ -0,0 +1,123 @@
+/**
+ * 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.
+ */
+package hbase.pb;
+
+option java_package = "org.apache.hadoop.hbase.protobuf.generated";
+option java_outer_classname = "AccessControlProtos";
+option java_generic_services = true;
+option java_generate_equals_and_hash = true;
+option optimize_for = SPEED;
+
+import "HBase.proto";
+
+message Permission {
+ enum Action {
+ READ = 0;
+ WRITE = 1;
+ EXEC = 2;
+ CREATE = 3;
+ ADMIN = 4;
+ }
+ enum Type {
+ Global = 1;
+ Namespace = 2;
+ Table = 3;
+ }
+ required Type type = 1;
+ optional GlobalPermission global_permission = 2;
+ optional NamespacePermission namespace_permission = 3;
+ optional TablePermission table_permission = 4;
+}
+
+message TablePermission {
+ optional TableName table_name = 1;
+ optional bytes family = 2;
+ optional bytes qualifier = 3;
+ repeated Permission.Action action = 4;
+}
+
+message NamespacePermission {
+ optional bytes namespace_name = 1;
+ repeated Permission.Action action = 2;
+}
+
+message GlobalPermission {
+ repeated Permission.Action action = 1;
+}
+
+message UserPermission {
+ required bytes user = 1;
+ required Permission permission = 3;
+}
+
+/**
+ * Content of the /hbase/acl/<table or namespace> znode.
+ */
+message UsersAndPermissions {
+ message UserPermissions {
+ required bytes user = 1;
+ repeated Permission permissions = 2;
+ }
+
+ repeated UserPermissions user_permissions = 1;
+}
+
+message GrantRequest {
+ required UserPermission user_permission = 1;
+}
+
+message GrantResponse {
+}
+
+message RevokeRequest {
+ required UserPermission user_permission = 1;
+}
+
+message RevokeResponse {
+}
+
+message GetUserPermissionsRequest {
+ optional Permission.Type type = 1;
+ optional TableName table_name = 2;
+ optional bytes namespace_name = 3;
+}
+
+message GetUserPermissionsResponse {
+ repeated UserPermission user_permission = 1;
+}
+
+message CheckPermissionsRequest {
+ repeated Permission permission = 1;
+}
+
+message CheckPermissionsResponse {
+}
+
+service AccessControlService {
+ rpc Grant(GrantRequest)
+ returns (GrantResponse);
+
+ rpc Revoke(RevokeRequest)
+ returns (RevokeResponse);
+
+ rpc GetUserPermissions(GetUserPermissionsRequest)
+ returns (GetUserPermissionsResponse);
+
+ rpc CheckPermissions(CheckPermissionsRequest)
+ returns (CheckPermissionsResponse);
+}
http://git-wip-us.apache.org/repos/asf/hbase/blob/967f0910/hbase-native-client/if/Admin.proto
----------------------------------------------------------------------
diff --git a/hbase-native-client/if/Admin.proto b/hbase-native-client/if/Admin.proto
new file mode 100644
index 0000000..e905340
--- /dev/null
+++ b/hbase-native-client/if/Admin.proto
@@ -0,0 +1,309 @@
+/**
+ * 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.
+ */
+
+// This file contains protocol buffers that are used for Admin service.
+package hbase.pb;
+
+option java_package = "org.apache.hadoop.hbase.protobuf.generated";
+option java_outer_classname = "AdminProtos";
+option java_generic_services = true;
+option java_generate_equals_and_hash = true;
+option optimize_for = SPEED;
+
+import "HBase.proto";
+import "WAL.proto";
+
+message GetRegionInfoRequest {
+ required RegionSpecifier region = 1;
+ optional bool compaction_state = 2;
+}
+
+message GetRegionInfoResponse {
+ required RegionInfo region_info = 1;
+ optional CompactionState compaction_state = 2;
+ optional bool isRecovering = 3;
+
+ enum CompactionState {
+ NONE = 0;
+ MINOR = 1;
+ MAJOR = 2;
+ MAJOR_AND_MINOR = 3;
+ }
+}
+
+/**
+ * Get a list of store files for a set of column families in a particular region.
+ * If no column family is specified, get the store files for all column families.
+ */
+message GetStoreFileRequest {
+ required RegionSpecifier region = 1;
+ repeated bytes family = 2;
+}
+
+message GetStoreFileResponse {
+ repeated string store_file = 1;
+}
+
+message GetOnlineRegionRequest {
+}
+
+message GetOnlineRegionResponse {
+ repeated RegionInfo region_info = 1;
+}
+
+message OpenRegionRequest {
+ repeated RegionOpenInfo open_info = 1;
+ // the intended server for this RPC.
+ optional uint64 serverStartCode = 2;
+ // wall clock time from master
+ optional uint64 master_system_time = 5;
+
+ message RegionOpenInfo {
+ required RegionInfo region = 1;
+ optional uint32 version_of_offline_node = 2;
+ repeated ServerName favored_nodes = 3;
+ // open region for distributedLogReplay
+ optional bool openForDistributedLogReplay = 4;
+ }
+}
+
+message OpenRegionResponse {
+ repeated RegionOpeningState opening_state = 1;
+
+ enum RegionOpeningState {
+ OPENED = 0;
+ ALREADY_OPENED = 1;
+ FAILED_OPENING = 2;
+ }
+}
+
+message WarmupRegionRequest {
+
+ required RegionInfo regionInfo = 1;
+}
+
+message WarmupRegionResponse {
+}
+
+/**
+ * Closes the specified region and will use or not use ZK during the close
+ * according to the specified flag.
+ */
+message CloseRegionRequest {
+ required RegionSpecifier region = 1;
+ optional uint32 version_of_closing_node = 2;
+ optional bool transition_in_ZK = 3 [default = true];
+ optional ServerName destination_server = 4;
+ // the intended server for this RPC.
+ optional uint64 serverStartCode = 5;
+}
+
+message CloseRegionResponse {
+ required bool closed = 1;
+}
+
+/**
+ * Flushes the MemStore of the specified region.
+ * <p>
+ * This method is synchronous.
+ */
+message FlushRegionRequest {
+ required RegionSpecifier region = 1;
+ optional uint64 if_older_than_ts = 2;
+ optional bool write_flush_wal_marker = 3; // whether to write a marker to WAL even if not flushed
+}
+
+message FlushRegionResponse {
+ required uint64 last_flush_time = 1;
+ optional bool flushed = 2;
+ optional bool wrote_flush_wal_marker = 3;
+}
+
+/**
+ * Splits the specified region.
+ * <p>
+ * This method currently flushes the region and then forces a compaction which
+ * will then trigger a split. The flush is done synchronously but the
+ * compaction is asynchronous.
+ */
+message SplitRegionRequest {
+ required RegionSpecifier region = 1;
+ optional bytes split_point = 2;
+}
+
+message SplitRegionResponse {
+}
+
+/**
+ * Compacts the specified region. Performs a major compaction if specified.
+ * <p>
+ * This method is asynchronous.
+ */
+message CompactRegionRequest {
+ required RegionSpecifier region = 1;
+ optional bool major = 2;
+ optional bytes family = 3;
+}
+
+message CompactRegionResponse {
+}
+
+message UpdateFavoredNodesRequest {
+ repeated RegionUpdateInfo update_info = 1;
+
+ message RegionUpdateInfo {
+ required RegionInfo region = 1;
+ repeated ServerName favored_nodes = 2;
+ }
+}
+
+message UpdateFavoredNodesResponse {
+ optional uint32 response = 1;
+}
+
+/**
+ * Merges the specified regions.
+ * <p>
+ * This method currently closes the regions and then merges them
+ */
+message MergeRegionsRequest {
+ required RegionSpecifier region_a = 1;
+ required RegionSpecifier region_b = 2;
+ optional bool forcible = 3 [default = false];
+ // wall clock time from master
+ optional uint64 master_system_time = 4;
+}
+
+message MergeRegionsResponse {
+}
+
+// Protocol buffer version of WAL for replication
+message WALEntry {
+ required WALKey key = 1;
+ // Following may be null if the KVs/Cells are carried along the side in a cellblock (See
+ // RPC for more on cellblocks). If Cells/KVs are in a cellblock, this next field is null
+ // and associated_cell_count has count of Cells associated w/ this WALEntry
+ repeated bytes key_value_bytes = 2;
+ // If Cell data is carried alongside in a cellblock, this is count of Cells in the cellblock.
+ optional int32 associated_cell_count = 3;
+}
+
+/**
+ * Replicates the given entries. The guarantee is that the given entries
+ * will be durable on the slave cluster if this method returns without
+ * any exception. hbase.replication has to be set to true for this to work.
+ */
+message ReplicateWALEntryRequest {
+ repeated WALEntry entry = 1;
+ optional string replicationClusterId = 2;
+ optional string sourceBaseNamespaceDirPath = 3;
+ optional string sourceHFileArchiveDirPath = 4;
+}
+
+message ReplicateWALEntryResponse {
+}
+
+message RollWALWriterRequest {
+}
+
+/*
+ * Roll request responses no longer include regions to flush
+ * this list will always be empty when talking to a 1.0 server
+ */
+message RollWALWriterResponse {
+ // A list of encoded name of regions to flush
+ repeated bytes region_to_flush = 1;
+}
+
+message StopServerRequest {
+ required string reason = 1;
+}
+
+message StopServerResponse {
+}
+
+message GetServerInfoRequest {
+}
+
+message ServerInfo {
+ required ServerName server_name = 1;
+ optional uint32 webui_port = 2;
+}
+
+message GetServerInfoResponse {
+ required ServerInfo server_info = 1;
+}
+
+message UpdateConfigurationRequest {
+}
+
+message UpdateConfigurationResponse {
+}
+
+service AdminService {
+ rpc GetRegionInfo(GetRegionInfoRequest)
+ returns(GetRegionInfoResponse);
+
+ rpc GetStoreFile(GetStoreFileRequest)
+ returns(GetStoreFileResponse);
+
+ rpc GetOnlineRegion(GetOnlineRegionRequest)
+ returns(GetOnlineRegionResponse);
+
+ rpc OpenRegion(OpenRegionRequest)
+ returns(OpenRegionResponse);
+
+ rpc WarmupRegion(WarmupRegionRequest)
+ returns(WarmupRegionResponse);
+
+ rpc CloseRegion(CloseRegionRequest)
+ returns(CloseRegionResponse);
+
+ rpc FlushRegion(FlushRegionRequest)
+ returns(FlushRegionResponse);
+
+ rpc SplitRegion(SplitRegionRequest)
+ returns(SplitRegionResponse);
+
+ rpc CompactRegion(CompactRegionRequest)
+ returns(CompactRegionResponse);
+
+ rpc MergeRegions(MergeRegionsRequest)
+ returns(MergeRegionsResponse);
+
+ rpc ReplicateWALEntry(ReplicateWALEntryRequest)
+ returns(ReplicateWALEntryResponse);
+
+ rpc Replay(ReplicateWALEntryRequest)
+ returns(ReplicateWALEntryResponse);
+
+ rpc RollWALWriter(RollWALWriterRequest)
+ returns(RollWALWriterResponse);
+
+ rpc GetServerInfo(GetServerInfoRequest)
+ returns(GetServerInfoResponse);
+
+ rpc StopServer(StopServerRequest)
+ returns(StopServerResponse);
+
+ rpc UpdateFavoredNodes(UpdateFavoredNodesRequest)
+ returns(UpdateFavoredNodesResponse);
+
+ rpc UpdateConfiguration(UpdateConfigurationRequest)
+ returns(UpdateConfigurationResponse);
+}
http://git-wip-us.apache.org/repos/asf/hbase/blob/967f0910/hbase-native-client/if/Aggregate.proto
----------------------------------------------------------------------
diff --git a/hbase-native-client/if/Aggregate.proto b/hbase-native-client/if/Aggregate.proto
new file mode 100644
index 0000000..4d32e70
--- /dev/null
+++ b/hbase-native-client/if/Aggregate.proto
@@ -0,0 +1,63 @@
+/**
+ * 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.
+ */
+package hbase.pb;
+
+option java_package = "org.apache.hadoop.hbase.protobuf.generated";
+option java_outer_classname = "AggregateProtos";
+option java_generic_services = true;
+option java_generate_equals_and_hash = true;
+option optimize_for = SPEED;
+
+import "Client.proto";
+
+message AggregateRequest {
+ /** The request passed to the AggregateService consists of three parts
+ * (1) the (canonical) classname of the ColumnInterpreter implementation
+ * (2) the Scan query
+ * (3) any bytes required to construct the ColumnInterpreter object
+ * properly
+ */
+ required string interpreter_class_name = 1;
+ required Scan scan = 2;
+ optional bytes interpreter_specific_bytes = 3;
+}
+
+message AggregateResponse {
+ /**
+ * The AggregateService methods all have a response that either is a Pair
+ * or a simple object. When it is a Pair both first_part and second_part
+ * have defined values (and the second_part is not present in the response
+ * when the response is not a pair). Refer to the AggregateImplementation
+ * class for an overview of the AggregateResponse object constructions.
+ */
+ repeated bytes first_part = 1;
+ optional bytes second_part = 2;
+}
+
+/** Refer to the AggregateImplementation class for an overview of the
+ * AggregateService method implementations and their functionality.
+ */
+service AggregateService {
+ rpc GetMax (AggregateRequest) returns (AggregateResponse);
+ rpc GetMin (AggregateRequest) returns (AggregateResponse);
+ rpc GetSum (AggregateRequest) returns (AggregateResponse);
+ rpc GetRowNum (AggregateRequest) returns (AggregateResponse);
+ rpc GetAvg (AggregateRequest) returns (AggregateResponse);
+ rpc GetStd (AggregateRequest) returns (AggregateResponse);
+ rpc GetMedian (AggregateRequest) returns (AggregateResponse);
+}
http://git-wip-us.apache.org/repos/asf/hbase/blob/967f0910/hbase-native-client/if/Authentication.proto
----------------------------------------------------------------------
diff --git a/hbase-native-client/if/Authentication.proto b/hbase-native-client/if/Authentication.proto
new file mode 100644
index 0000000..2f64799
--- /dev/null
+++ b/hbase-native-client/if/Authentication.proto
@@ -0,0 +1,82 @@
+/**
+ * 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.
+ */
+package hbase.pb;
+
+option java_package = "org.apache.hadoop.hbase.protobuf.generated";
+option java_outer_classname = "AuthenticationProtos";
+option java_generic_services = true;
+option java_generate_equals_and_hash = true;
+option optimize_for = SPEED;
+
+message AuthenticationKey {
+ required int32 id = 1;
+ required int64 expiration_date = 2;
+ required bytes key = 3;
+}
+
+
+message TokenIdentifier {
+ enum Kind {
+ HBASE_AUTH_TOKEN = 0;
+ }
+ required Kind kind = 1;
+ required bytes username = 2;
+ required int32 key_id = 3;
+ optional int64 issue_date = 4;
+ optional int64 expiration_date = 5;
+ optional int64 sequence_number = 6;
+}
+
+
+// Serialization of the org.apache.hadoop.security.token.Token class
+// Note that this is a Hadoop class, so fields may change!
+message Token {
+ // the TokenIdentifier in serialized form
+ // Note: we can't use the protobuf directly because the Hadoop Token class
+ // only stores the serialized bytes
+ optional bytes identifier = 1;
+ optional bytes password = 2;
+ optional bytes service = 3;
+}
+
+
+// RPC request & response messages
+message GetAuthenticationTokenRequest {
+}
+
+message GetAuthenticationTokenResponse {
+ optional Token token = 1;
+}
+
+message WhoAmIRequest {
+}
+
+message WhoAmIResponse {
+ optional string username = 1;
+ optional string auth_method = 2;
+}
+
+
+// RPC service
+service AuthenticationService {
+ rpc GetAuthenticationToken(GetAuthenticationTokenRequest)
+ returns (GetAuthenticationTokenResponse);
+
+ rpc WhoAmI(WhoAmIRequest)
+ returns (WhoAmIResponse);
+}
http://git-wip-us.apache.org/repos/asf/hbase/blob/967f0910/hbase-native-client/if/BUCK
----------------------------------------------------------------------
diff --git a/hbase-native-client/if/BUCK b/hbase-native-client/if/BUCK
new file mode 100644
index 0000000..3490a05
--- /dev/null
+++ b/hbase-native-client/if/BUCK
@@ -0,0 +1,36 @@
+PROTO_SRCS = glob(['*.proto'])
+HEADER_FILENAMES = [ x.replace('.proto','.pb.h') for x in PROTO_SRCS]
+CC_FILENAMES = [ x.replace('.proto', '.pb.cc') for x in PROTO_SRCS]
+
+genrule(
+ name = 'generate-proto-sources',
+ srcs = PROTO_SRCS,
+ cmd = 'mkdir -p $OUT && pwd && protoc --proto_path=. --cpp_out=$OUT *.proto',
+ out = 'output',
+)
+
+for header_filename in HEADER_FILENAMES:
+ genrule(
+ name = header_filename,
+ cmd = 'mkdir -p `dirname $OUT` '
+ ' && cp $(location :generate-proto-sources)/{} $OUT'.format(header_filename),
+ out = header_filename,
+ )
+for cc_filename in CC_FILENAMES:
+ genrule(
+ name = cc_filename,
+ cmd = 'mkdir -p `dirname $OUT` '
+ ' && cp $(location :generate-proto-sources)/{} $OUT '
+ ' && cp $(location :generate-proto-sources)/*.h `dirname $OUT`'.format(cc_filename),
+ out = cc_filename,
+ )
+
+cxx_library(
+ name = 'if',
+ exported_headers = [':' + x for x in HEADER_FILENAMES],
+ srcs = [':' + x for x in CC_FILENAMES],
+ deps = [ '//third-party:protobuf']
+ + [':' + x for x in CC_FILENAMES]
+ + [ ':' + x for x in HEADER_FILENAMES ],
+ visibility = [ 'PUBLIC', ],
+)
http://git-wip-us.apache.org/repos/asf/hbase/blob/967f0910/hbase-native-client/if/Cell.proto
----------------------------------------------------------------------
diff --git a/hbase-native-client/if/Cell.proto b/hbase-native-client/if/Cell.proto
new file mode 100644
index 0000000..2c61035
--- /dev/null
+++ b/hbase-native-client/if/Cell.proto
@@ -0,0 +1,67 @@
+/**
+ * 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.
+ */
+
+// Cell and KeyValue protos
+package hbase.pb;
+
+option java_package = "org.apache.hadoop.hbase.protobuf.generated";
+option java_outer_classname = "CellProtos";
+option java_generate_equals_and_hash = true;
+option optimize_for = SPEED;
+
+/**
+ * The type of the key in a Cell
+ */
+enum CellType {
+ MINIMUM = 0;
+ PUT = 4;
+
+ DELETE = 8;
+ DELETE_COLUMN = 12;
+ DELETE_FAMILY = 14;
+
+ // MAXIMUM is used when searching; you look from maximum on down.
+ MAXIMUM = 255;
+}
+
+/**
+ * Protocol buffer version of Cell.
+ */
+message Cell {
+ optional bytes row = 1;
+ optional bytes family = 2;
+ optional bytes qualifier = 3;
+ optional uint64 timestamp = 4;
+ optional CellType cell_type = 5;
+ optional bytes value = 6;
+ optional bytes tags = 7;
+}
+
+/**
+ * Protocol buffer version of KeyValue.
+ * It doesn't have those transient parameters
+ */
+message KeyValue {
+ required bytes row = 1;
+ required bytes family = 2;
+ required bytes qualifier = 3;
+ optional uint64 timestamp = 4;
+ optional CellType key_type = 5;
+ optional bytes value = 6;
+ optional bytes tags = 7;
+}
http://git-wip-us.apache.org/repos/asf/hbase/blob/967f0910/hbase-native-client/if/Client.proto
----------------------------------------------------------------------
diff --git a/hbase-native-client/if/Client.proto b/hbase-native-client/if/Client.proto
new file mode 100644
index 0000000..ca9abdc
--- /dev/null
+++ b/hbase-native-client/if/Client.proto
@@ -0,0 +1,472 @@
+/**
+ * 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.
+ */
+
+// This file contains protocol buffers that are used for Client service.
+package hbase.pb;
+
+option java_package = "org.apache.hadoop.hbase.protobuf.generated";
+option java_outer_classname = "ClientProtos";
+option java_generic_services = true;
+option java_generate_equals_and_hash = true;
+option optimize_for = SPEED;
+
+import "HBase.proto";
+import "Filter.proto";
+import "Cell.proto";
+import "Comparator.proto";
+import "MapReduce.proto";
+
+/**
+ * The protocol buffer version of Authorizations.
+ */
+message Authorizations {
+ repeated string label = 1;
+}
+
+/**
+ * The protocol buffer version of CellVisibility.
+ */
+message CellVisibility {
+ required string expression = 1;
+}
+
+/**
+ * Container for a list of column qualifier names of a family.
+ */
+message Column {
+ required bytes family = 1;
+ repeated bytes qualifier = 2;
+}
+
+/**
+ * Consistency defines the expected consistency level for an operation.
+ */
+enum Consistency {
+ STRONG = 0;
+ TIMELINE = 1;
+}
+
+/**
+ * The protocol buffer version of Get.
+ * Unless existence_only is specified, return all the requested data
+ * for the row that matches exactly.
+ */
+message Get {
+ required bytes row = 1;
+ repeated Column column = 2;
+ repeated NameBytesPair attribute = 3;
+ optional Filter filter = 4;
+ optional TimeRange time_range = 5;
+ optional uint32 max_versions = 6 [default = 1];
+ optional bool cache_blocks = 7 [default = true];
+ optional uint32 store_limit = 8;
+ optional uint32 store_offset = 9;
+
+ // The result isn't asked for, just check for
+ // the existence.
+ optional bool existence_only = 10 [default = false];
+
+ optional Consistency consistency = 12 [default = STRONG];
+ repeated ColumnFamilyTimeRange cf_time_range = 13;
+}
+
+message Result {
+ // Result includes the Cells or else it just has a count of Cells
+ // that are carried otherwise.
+ repeated Cell cell = 1;
+ // The below count is set when the associated cells are
+ // not part of this protobuf message; they are passed alongside
+ // and then this Message is just a placeholder with metadata.
+ // The count is needed to know how many to peel off the block of Cells as
+ // ours. NOTE: This is different from the pb managed cell_count of the
+ // 'cell' field above which is non-null when the cells are pb'd.
+ optional int32 associated_cell_count = 2;
+
+ // used for Get to check existence only. Not set if existence_only was not set to true
+ // in the query.
+ optional bool exists = 3;
+
+ // Whether or not the results are coming from possibly stale data
+ optional bool stale = 4 [default = false];
+
+ // Whether or not the entire result could be returned. Results will be split when
+ // the RPC chunk size limit is reached. Partial results contain only a subset of the
+ // cells for a row and must be combined with a result containing the remaining cells
+ // to form a complete result
+ optional bool partial = 5 [default = false];
+}
+
+/**
+ * The get request. Perform a single Get operation.
+ */
+message GetRequest {
+ required RegionSpecifier region = 1;
+ required Get get = 2;
+}
+
+message GetResponse {
+ optional Result result = 1;
+}
+
+/**
+ * Condition to check if the value of a given cell (row,
+ * family, qualifier) matches a value via a given comparator.
+ *
+ * Condition is used in check and mutate operations.
+ */
+message Condition {
+ required bytes row = 1;
+ required bytes family = 2;
+ required bytes qualifier = 3;
+ required CompareType compare_type = 4;
+ required Comparator comparator = 5;
+}
+
+
+/**
+ * A specific mutation inside a mutate request.
+ * It can be an append, increment, put or delete based
+ * on the mutation type. It can be fully filled in or
+ * only metadata present because data is being carried
+ * elsewhere outside of pb.
+ */
+message MutationProto {
+ optional bytes row = 1;
+ optional MutationType mutate_type = 2;
+ repeated ColumnValue column_value = 3;
+ optional uint64 timestamp = 4;
+ repeated NameBytesPair attribute = 5;
+ optional Durability durability = 6 [default = USE_DEFAULT];
+
+ // For some mutations, a result may be returned, in which case,
+ // time range can be specified for potential performance gain
+ optional TimeRange time_range = 7;
+ // The below count is set when the associated cells are NOT
+ // part of this protobuf message; they are passed alongside
+ // and then this Message is a placeholder with metadata. The
+ // count is needed to know how many to peel off the block of Cells as
+ // ours. NOTE: This is different from the pb managed cell_count of the
+ // 'cell' field above which is non-null when the cells are pb'd.
+ optional int32 associated_cell_count = 8;
+
+ optional uint64 nonce = 9;
+
+ enum Durability {
+ USE_DEFAULT = 0;
+ SKIP_WAL = 1;
+ ASYNC_WAL = 2;
+ SYNC_WAL = 3;
+ FSYNC_WAL = 4;
+ }
+
+ enum MutationType {
+ APPEND = 0;
+ INCREMENT = 1;
+ PUT = 2;
+ DELETE = 3;
+ }
+
+ enum DeleteType {
+ DELETE_ONE_VERSION = 0;
+ DELETE_MULTIPLE_VERSIONS = 1;
+ DELETE_FAMILY = 2;
+ DELETE_FAMILY_VERSION = 3;
+ }
+
+ message ColumnValue {
+ required bytes family = 1;
+ repeated QualifierValue qualifier_value = 2;
+
+ message QualifierValue {
+ optional bytes qualifier = 1;
+ optional bytes value = 2;
+ optional uint64 timestamp = 3;
+ optional DeleteType delete_type = 4;
+ optional bytes tags = 5;
+ }
+ }
+}
+
+/**
+ * The mutate request. Perform a single Mutate operation.
+ *
+ * Optionally, you can specify a condition. The mutate
+ * will take place only if the condition is met. Otherwise,
+ * the mutate will be ignored. In the response result,
+ * parameter processed is used to indicate if the mutate
+ * actually happened.
+ */
+message MutateRequest {
+ required RegionSpecifier region = 1;
+ required MutationProto mutation = 2;
+ optional Condition condition = 3;
+ optional uint64 nonce_group = 4;
+}
+
+message MutateResponse {
+ optional Result result = 1;
+
+ // used for mutate to indicate processed only
+ optional bool processed = 2;
+}
+
+/**
+ * Instead of get from a table, you can scan it with optional filters.
+ * You can specify the row key range, time range, the columns/families
+ * to scan and so on.
+ *
+ * This scan is used the first time in a scan request. The response of
+ * the initial scan will return a scanner id, which should be used to
+ * fetch result batches later on before it is closed.
+ */
+message Scan {
+ repeated Column column = 1;
+ repeated NameBytesPair attribute = 2;
+ optional bytes start_row = 3;
+ optional bytes stop_row = 4;
+ optional Filter filter = 5;
+ optional TimeRange time_range = 6;
+ optional uint32 max_versions = 7 [default = 1];
+ optional bool cache_blocks = 8 [default = true];
+ optional uint32 batch_size = 9;
+ optional uint64 max_result_size = 10;
+ optional uint32 store_limit = 11;
+ optional uint32 store_offset = 12;
+ optional bool load_column_families_on_demand = 13; /* DO NOT add defaults to load_column_families_on_demand. */
+ optional bool small = 14;
+ optional bool reversed = 15 [default = false];
+ optional Consistency consistency = 16 [default = STRONG];
+ optional uint32 caching = 17;
+ optional bool allow_partial_results = 18;
+ repeated ColumnFamilyTimeRange cf_time_range = 19;
+}
+
+/**
+ * A scan request. Initially, it should specify a scan. Later on, you
+ * can use the scanner id returned to fetch result batches with a different
+ * scan request.
+ *
+ * The scanner will remain open if there are more results, and it's not
+ * asked to be closed explicitly.
+ *
+ * You can fetch the results and ask the scanner to be closed to save
+ * a trip if you are not interested in remaining results.
+ */
+message ScanRequest {
+ optional RegionSpecifier region = 1;
+ optional Scan scan = 2;
+ optional uint64 scanner_id = 3;
+ optional uint32 number_of_rows = 4;
+ optional bool close_scanner = 5;
+ optional uint64 next_call_seq = 6;
+ optional bool client_handles_partials = 7;
+ optional bool client_handles_heartbeats = 8;
+ optional bool track_scan_metrics = 9;
+ optional bool renew = 10 [default = false];
+}
+
+/**
+ * The scan response. If there are no more results, more_results will
+ * be false. If it is not specified, it means there are more.
+ */
+message ScanResponse {
+ // This field is filled in if we are doing cellblocks. A cellblock is made up
+ // of all Cells serialized out as one cellblock BUT responses from a server
+ // have their Cells grouped by Result. So we can reconstitute the
+ // Results on the client-side, this field is a list of counts of Cells
+ // in each Result that makes up the response. For example, if this field
+ // has 3, 3, 3 in it, then we know that on the client, we are to make
+ // three Results each of three Cells each.
+ repeated uint32 cells_per_result = 1;
+
+ optional uint64 scanner_id = 2;
+ optional bool more_results = 3;
+ optional uint32 ttl = 4;
+ // If cells are not carried in an accompanying cellblock, then they are pb'd here.
+ // This field is mutually exclusive with cells_per_result (since the Cells will
+ // be inside the pb'd Result)
+ repeated Result results = 5;
+ optional bool stale = 6;
+
+ // This field is filled in if we are doing cellblocks. In the event that a row
+ // could not fit all of its cells into a single RPC chunk, the results will be
+ // returned as partials, and reconstructed into a complete result on the client
+ // side. This field is a list of flags indicating whether or not the result
+ // that the cells belong to is a partial result. For example, if this field
+ // has false, false, true in it, then we know that on the client side, we need to
+ // make another RPC request since the last result was only a partial.
+ repeated bool partial_flag_per_result = 7;
+
+ // A server may choose to limit the number of results returned to the client for
+ // reasons such as the size in bytes or quantity of results accumulated. This field
+ // will true when more results exist in the current region.
+ optional bool more_results_in_region = 8;
+
+ // This field is filled in if the server is sending back a heartbeat message.
+ // Heartbeat messages are sent back to the client to prevent the scanner from
+ // timing out. Seeing a heartbeat message communicates to the Client that the
+ // server would have continued to scan had the time limit not been reached.
+ optional bool heartbeat_message = 9;
+
+ // This field is filled in if the client has requested that scan metrics be tracked.
+ // The metrics tracked here are sent back to the client to be tracked together with
+ // the existing client side metrics.
+ optional ScanMetrics scan_metrics = 10;
+}
+
+/**
+ * Atomically bulk load multiple HFiles (say from different column families)
+ * into an open region.
+ */
+message BulkLoadHFileRequest {
+ required RegionSpecifier region = 1;
+ repeated FamilyPath family_path = 2;
+ optional bool assign_seq_num = 3;
+
+ message FamilyPath {
+ required bytes family = 1;
+ required string path = 2;
+ }
+}
+
+message BulkLoadHFileResponse {
+ required bool loaded = 1;
+}
+
+message CoprocessorServiceCall {
+ required bytes row = 1;
+ required string service_name = 2;
+ required string method_name = 3;
+ required bytes request = 4;
+}
+
+message CoprocessorServiceResult {
+ optional NameBytesPair value = 1;
+}
+
+message CoprocessorServiceRequest {
+ required RegionSpecifier region = 1;
+ required CoprocessorServiceCall call = 2;
+}
+
+message CoprocessorServiceResponse {
+ required RegionSpecifier region = 1;
+ required NameBytesPair value = 2;
+}
+
+// Either a Get or a Mutation
+message Action {
+ // If part of a multi action, useful aligning
+ // result with what was originally submitted.
+ optional uint32 index = 1;
+ optional MutationProto mutation = 2;
+ optional Get get = 3;
+ optional CoprocessorServiceCall service_call = 4;
+}
+
+/**
+ * Actions to run against a Region.
+ */
+message RegionAction {
+ required RegionSpecifier region = 1;
+ // When set, run mutations as atomic unit.
+ optional bool atomic = 2;
+ repeated Action action = 3;
+}
+
+/*
+* Statistics about the current load on the region
+*/
+message RegionLoadStats {
+ // Percent load on the memstore. Guaranteed to be positive, between 0 and 100.
+ optional int32 memstoreLoad = 1 [default = 0];
+ // Percent JVM heap occupancy. Guaranteed to be positive, between 0 and 100.
+ // We can move this to "ServerLoadStats" should we develop them.
+ optional int32 heapOccupancy = 2 [default = 0];
+ // Compaction pressure. Guaranteed to be positive, between 0 and 100.
+ optional int32 compactionPressure = 3 [default = 0];
+}
+
+/**
+ * Either a Result or an Exception NameBytesPair (keyed by
+ * exception name whose value is the exception stringified)
+ * or maybe empty if no result and no exception.
+ */
+message ResultOrException {
+ // If part of a multi call, save original index of the list of all
+ // passed so can align this response w/ original request.
+ optional uint32 index = 1;
+ optional Result result = 2;
+ optional NameBytesPair exception = 3;
+ // result if this was a coprocessor service call
+ optional CoprocessorServiceResult service_result = 4;
+ // current load on the region
+ optional RegionLoadStats loadStats = 5;
+}
+
+/**
+ * The result of a RegionAction.
+ */
+message RegionActionResult {
+ repeated ResultOrException resultOrException = 1;
+ // If the operation failed globally for this region, this exception is set
+ optional NameBytesPair exception = 2;
+}
+
+/**
+ * Execute a list of actions on a given region in order.
+ * Nothing prevents a request to contains a set of RegionAction on the same region.
+ * For this reason, the matching between the MultiRequest and the MultiResponse is not
+ * done by the region specifier but by keeping the order of the RegionActionResult vs.
+ * the order of the RegionAction.
+ */
+message MultiRequest {
+ repeated RegionAction regionAction = 1;
+ optional uint64 nonceGroup = 2;
+ optional Condition condition = 3;
+}
+
+message MultiResponse {
+ repeated RegionActionResult regionActionResult = 1;
+ // used for mutate to indicate processed only
+ optional bool processed = 2;
+}
+
+
+service ClientService {
+ rpc Get(GetRequest)
+ returns(GetResponse);
+
+ rpc Mutate(MutateRequest)
+ returns(MutateResponse);
+
+ rpc Scan(ScanRequest)
+ returns(ScanResponse);
+
+ rpc BulkLoadHFile(BulkLoadHFileRequest)
+ returns(BulkLoadHFileResponse);
+
+ rpc ExecService(CoprocessorServiceRequest)
+ returns(CoprocessorServiceResponse);
+
+ rpc ExecRegionServerService(CoprocessorServiceRequest)
+ returns(CoprocessorServiceResponse);
+
+ rpc Multi(MultiRequest)
+ returns(MultiResponse);
+}
http://git-wip-us.apache.org/repos/asf/hbase/blob/967f0910/hbase-native-client/if/ClusterId.proto
----------------------------------------------------------------------
diff --git a/hbase-native-client/if/ClusterId.proto b/hbase-native-client/if/ClusterId.proto
new file mode 100644
index 0000000..aed8cfc
--- /dev/null
+++ b/hbase-native-client/if/ClusterId.proto
@@ -0,0 +1,34 @@
+/**
+ * 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.
+ */
+
+// This file contains protocol buffers that are shared throughout HBase
+package hbase.pb;
+
+option java_package = "org.apache.hadoop.hbase.protobuf.generated";
+option java_outer_classname = "ClusterIdProtos";
+option java_generate_equals_and_hash = true;
+option optimize_for = SPEED;
+
+/**
+ * Content of the '/hbase/hbaseid', cluster id, znode.
+ * Also cluster of the ${HBASE_ROOTDIR}/hbase.id file.
+ */
+message ClusterId {
+ // This is the cluster id, a uuid as a String
+ required string cluster_id = 1;
+}
http://git-wip-us.apache.org/repos/asf/hbase/blob/967f0910/hbase-native-client/if/ClusterStatus.proto
----------------------------------------------------------------------
diff --git a/hbase-native-client/if/ClusterStatus.proto b/hbase-native-client/if/ClusterStatus.proto
new file mode 100644
index 0000000..228be7e
--- /dev/null
+++ b/hbase-native-client/if/ClusterStatus.proto
@@ -0,0 +1,224 @@
+/**
+ * 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.
+ */
+
+// This file contains protocol buffers that are used for ClustStatus
+package hbase.pb;
+
+option java_package = "org.apache.hadoop.hbase.protobuf.generated";
+option java_outer_classname = "ClusterStatusProtos";
+option java_generate_equals_and_hash = true;
+option optimize_for = SPEED;
+
+import "HBase.proto";
+import "ClusterId.proto";
+import "FS.proto";
+
+message RegionState {
+ required RegionInfo region_info = 1;
+ required State state = 2;
+ optional uint64 stamp = 3;
+ enum State {
+ OFFLINE = 0; // region is in an offline state
+ PENDING_OPEN = 1; // sent rpc to server to open but has not begun
+ OPENING = 2; // server has begun to open but not yet done
+ OPEN = 3; // server opened region and updated meta
+ PENDING_CLOSE = 4; // sent rpc to server to close but has not begun
+ CLOSING = 5; // server has begun to close but not yet done
+ CLOSED = 6; // server closed region and updated meta
+ SPLITTING = 7; // server started split of a region
+ SPLIT = 8; // server completed split of a region
+ FAILED_OPEN = 9; // failed to open, and won't retry any more
+ FAILED_CLOSE = 10; // failed to close, and won't retry any more
+ MERGING = 11; // server started merge a region
+ MERGED = 12; // server completed merge of a region
+ SPLITTING_NEW = 13; // new region to be created when RS splits a parent
+ // region but hasn't be created yet, or master doesn't
+ // know it's already created
+ MERGING_NEW = 14; // new region to be created when RS merges two
+ // daughter regions but hasn't be created yet, or
+ // master doesn't know it's already created
+ }
+}
+
+message RegionInTransition {
+ required RegionSpecifier spec = 1;
+ required RegionState region_state = 2;
+}
+
+/**
+ * sequence Id of a store
+ */
+message StoreSequenceId {
+ required bytes family_name = 1;
+ required uint64 sequence_id = 2;
+}
+
+/**
+ * contains a sequence id of a region which should be the minimum of its store sequence ids and
+ * list of sequence ids of the region's stores
+ */
+message RegionStoreSequenceIds {
+ required uint64 last_flushed_sequence_id = 1;
+ repeated StoreSequenceId store_sequence_id = 2;
+}
+
+message RegionLoad {
+ /** the region specifier */
+ required RegionSpecifier region_specifier = 1;
+
+ /** the number of stores for the region */
+ optional uint32 stores = 2;
+
+ /** the number of storefiles for the region */
+ optional uint32 storefiles = 3;
+
+ /** the total size of the store files for the region, uncompressed, in MB */
+ optional uint32 store_uncompressed_size_MB = 4;
+
+ /** the current total size of the store files for the region, in MB */
+ optional uint32 storefile_size_MB = 5;
+
+ /** the current size of the memstore for the region, in MB */
+ optional uint32 memstore_size_MB = 6;
+
+ /**
+ * The current total size of root-level store file indexes for the region,
+ * in MB. The same as {@link #rootIndexSizeKB} but in MB.
+ */
+ optional uint32 storefile_index_size_MB = 7;
+
+ /** the current total read requests made to region */
+ optional uint64 read_requests_count = 8;
+
+ /** the current total write requests made to region */
+ optional uint64 write_requests_count = 9;
+
+ /** the total compacting key values in currently running compaction */
+ optional uint64 total_compacting_KVs = 10;
+
+ /** the completed count of key values in currently running compaction */
+ optional uint64 current_compacted_KVs = 11;
+
+ /** The current total size of root-level indexes for the region, in KB. */
+ optional uint32 root_index_size_KB = 12;
+
+ /** The total size of all index blocks, not just the root level, in KB. */
+ optional uint32 total_static_index_size_KB = 13;
+
+ /**
+ * The total size of all Bloom filter blocks, not just loaded into the
+ * block cache, in KB.
+ */
+ optional uint32 total_static_bloom_size_KB = 14;
+
+ /** the most recent sequence Id from cache flush */
+ optional uint64 complete_sequence_id = 15;
+
+ /** The current data locality for region in the regionserver */
+ optional float data_locality = 16;
+
+ optional uint64 last_major_compaction_ts = 17 [default = 0];
+
+ /** the most recent sequence Id of store from cache flush */
+ repeated StoreSequenceId store_complete_sequence_id = 18;
+}
+
+/* Server-level protobufs */
+
+message ReplicationLoadSink {
+ required uint64 ageOfLastAppliedOp = 1;
+ required uint64 timeStampsOfLastAppliedOp = 2;
+}
+
+message ReplicationLoadSource {
+ required string peerID = 1;
+ required uint64 ageOfLastShippedOp = 2;
+ required uint32 sizeOfLogQueue = 3;
+ required uint64 timeStampOfLastShippedOp = 4;
+ required uint64 replicationLag = 5;
+}
+
+message ServerLoad {
+ /** Number of requests since last report. */
+ optional uint64 number_of_requests = 1;
+
+ /** Total Number of requests from the start of the region server. */
+ optional uint64 total_number_of_requests = 2;
+
+ /** the amount of used heap, in MB. */
+ optional uint32 used_heap_MB = 3;
+
+ /** the maximum allowable size of the heap, in MB. */
+ optional uint32 max_heap_MB = 4;
+
+ /** Information on the load of individual regions. */
+ repeated RegionLoad region_loads = 5;
+
+ /**
+ * Regionserver-level coprocessors, e.g., WALObserver implementations.
+ * Region-level coprocessors, on the other hand, are stored inside RegionLoad
+ * objects.
+ */
+ repeated Coprocessor coprocessors = 6;
+
+ /**
+ * Time when incremental (non-total) counts began being calculated (e.g. number_of_requests)
+ * time is measured as the difference, measured in milliseconds, between the current time
+ * and midnight, January 1, 1970 UTC.
+ */
+ optional uint64 report_start_time = 7;
+
+ /**
+ * Time when report was generated.
+ * time is measured as the difference, measured in milliseconds, between the current time
+ * and midnight, January 1, 1970 UTC.
+ */
+ optional uint64 report_end_time = 8;
+
+ /**
+ * The port number that this region server is hosing an info server on.
+ */
+ optional uint32 info_server_port = 9;
+
+ /**
+ * The replicationLoadSource for the replication Source status of this region server.
+ */
+ repeated ReplicationLoadSource replLoadSource = 10;
+
+ /**
+ * The replicationLoadSink for the replication Sink status of this region server.
+ */
+ optional ReplicationLoadSink replLoadSink = 11;
+}
+
+message LiveServerInfo {
+ required ServerName server = 1;
+ required ServerLoad server_load = 2;
+}
+
+message ClusterStatus {
+ optional HBaseVersionFileContent hbase_version = 1;
+ repeated LiveServerInfo live_servers = 2;
+ repeated ServerName dead_servers = 3;
+ repeated RegionInTransition regions_in_transition = 4;
+ optional ClusterId cluster_id = 5;
+ repeated Coprocessor master_coprocessors = 6;
+ optional ServerName master = 7;
+ repeated ServerName backup_masters = 8;
+ optional bool balancer_on = 9;
+}
http://git-wip-us.apache.org/repos/asf/hbase/blob/967f0910/hbase-native-client/if/Comparator.proto
----------------------------------------------------------------------
diff --git a/hbase-native-client/if/Comparator.proto b/hbase-native-client/if/Comparator.proto
new file mode 100644
index 0000000..496b68d
--- /dev/null
+++ b/hbase-native-client/if/Comparator.proto
@@ -0,0 +1,74 @@
+/**
+ * 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.
+ */
+
+// This file contains protocol buffers that are used for filters
+package hbase.pb;
+
+option java_package = "org.apache.hadoop.hbase.protobuf.generated";
+option java_outer_classname = "ComparatorProtos";
+option java_generic_services = true;
+option java_generate_equals_and_hash = true;
+option optimize_for = SPEED;
+
+// This file contains protocol buffers that are used for comparators (e.g. in filters)
+
+message Comparator {
+ required string name = 1;
+ optional bytes serialized_comparator = 2;
+}
+
+message ByteArrayComparable {
+ optional bytes value = 1;
+}
+
+message BinaryComparator {
+ required ByteArrayComparable comparable = 1;
+}
+
+message LongComparator {
+ required ByteArrayComparable comparable = 1;
+}
+
+message BinaryPrefixComparator {
+ required ByteArrayComparable comparable = 1;
+}
+
+message BitComparator {
+ required ByteArrayComparable comparable = 1;
+ required BitwiseOp bitwise_op = 2;
+
+ enum BitwiseOp {
+ AND = 1;
+ OR = 2;
+ XOR = 3;
+ }
+}
+
+message NullComparator {
+}
+
+message RegexStringComparator {
+ required string pattern = 1;
+ required int32 pattern_flags = 2;
+ required string charset = 3;
+ optional string engine = 4;
+}
+
+message SubstringComparator {
+ required string substr = 1;
+}
http://git-wip-us.apache.org/repos/asf/hbase/blob/967f0910/hbase-native-client/if/Encryption.proto
----------------------------------------------------------------------
diff --git a/hbase-native-client/if/Encryption.proto b/hbase-native-client/if/Encryption.proto
new file mode 100644
index 0000000..97ab5b2
--- /dev/null
+++ b/hbase-native-client/if/Encryption.proto
@@ -0,0 +1,33 @@
+/**
+ * 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.
+ */
+
+// This file contains protocol buffers used for encryption
+package hbase.pb;
+
+option java_package = "org.apache.hadoop.hbase.protobuf.generated";
+option java_outer_classname = "EncryptionProtos";
+option java_generate_equals_and_hash = true;
+option optimize_for = SPEED;
+
+message WrappedKey {
+ required string algorithm = 1;
+ required uint32 length = 2;
+ required bytes data = 3;
+ optional bytes iv = 4;
+ optional bytes hash = 5;
+}
http://git-wip-us.apache.org/repos/asf/hbase/blob/967f0910/hbase-native-client/if/ErrorHandling.proto
----------------------------------------------------------------------
diff --git a/hbase-native-client/if/ErrorHandling.proto b/hbase-native-client/if/ErrorHandling.proto
new file mode 100644
index 0000000..be9a743
--- /dev/null
+++ b/hbase-native-client/if/ErrorHandling.proto
@@ -0,0 +1,58 @@
+/**
+ * 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.
+ */
+
+// This file contains protocol buffers that are used for error handling
+package hbase.pb;
+
+option java_package = "org.apache.hadoop.hbase.protobuf.generated";
+option java_outer_classname = "ErrorHandlingProtos";
+option java_generate_equals_and_hash = true;
+option optimize_for = SPEED;
+
+/**
+ * Protobuf version of a java.lang.StackTraceElement
+ * so we can serialize exceptions.
+ */
+message StackTraceElementMessage {
+ optional string declaring_class = 1;
+ optional string method_name = 2;
+ optional string file_name = 3;
+ optional int32 line_number = 4;
+}
+
+/**
+ * Cause of a remote failure for a generic exception. Contains
+ * all the information for a generic exception as well as
+ * optional info about the error for generic info passing
+ * (which should be another protobuffed class).
+ */
+message GenericExceptionMessage {
+ optional string class_name = 1;
+ optional string message = 2;
+ optional bytes error_info = 3;
+ repeated StackTraceElementMessage trace = 4;
+}
+
+/**
+ * Exception sent across the wire when a remote task needs
+ * to notify other tasks that it failed and why
+ */
+message ForeignExceptionMessage {
+ optional string source = 1;
+ optional GenericExceptionMessage generic_exception = 2;
+}
http://git-wip-us.apache.org/repos/asf/hbase/blob/967f0910/hbase-native-client/if/FS.proto
----------------------------------------------------------------------
diff --git a/hbase-native-client/if/FS.proto b/hbase-native-client/if/FS.proto
new file mode 100644
index 0000000..9e93120
--- /dev/null
+++ b/hbase-native-client/if/FS.proto
@@ -0,0 +1,45 @@
+/**
+ * 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.
+ */
+
+// This file contains protocol buffers that are written into the filesystem
+package hbase.pb;
+
+option java_package = "org.apache.hadoop.hbase.protobuf.generated";
+option java_outer_classname = "FSProtos";
+option java_generate_equals_and_hash = true;
+option optimize_for = SPEED;
+
+/**
+ * The ${HBASE_ROOTDIR}/hbase.version file content
+ */
+message HBaseVersionFileContent {
+ required string version = 1;
+}
+
+/**
+ * Reference file content used when we split an hfile under a region.
+ */
+message Reference {
+ required bytes splitkey = 1;
+ enum Range {
+ TOP = 0;
+ BOTTOM = 1;
+ }
+ required Range range = 2;
+}
+
http://git-wip-us.apache.org/repos/asf/hbase/blob/967f0910/hbase-native-client/if/Filter.proto
----------------------------------------------------------------------
diff --git a/hbase-native-client/if/Filter.proto b/hbase-native-client/if/Filter.proto
new file mode 100644
index 0000000..67d5717
--- /dev/null
+++ b/hbase-native-client/if/Filter.proto
@@ -0,0 +1,170 @@
+/**
+ * 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.
+ */
+
+// This file contains protocol buffers that are used for filters
+package hbase.pb;
+
+option java_package = "org.apache.hadoop.hbase.protobuf.generated";
+option java_outer_classname = "FilterProtos";
+option java_generic_services = true;
+option java_generate_equals_and_hash = true;
+option optimize_for = SPEED;
+
+import "HBase.proto";
+import "Comparator.proto";
+
+message Filter {
+ required string name = 1;
+ optional bytes serialized_filter = 2;
+}
+
+message ColumnCountGetFilter {
+ required int32 limit = 1;
+}
+
+message ColumnPaginationFilter {
+ required int32 limit = 1;
+ optional int32 offset = 2;
+ optional bytes column_offset = 3;
+}
+
+message ColumnPrefixFilter {
+ required bytes prefix = 1;
+}
+
+message ColumnRangeFilter {
+ optional bytes min_column = 1;
+ optional bool min_column_inclusive = 2;
+ optional bytes max_column = 3;
+ optional bool max_column_inclusive = 4;
+}
+
+message CompareFilter {
+ required CompareType compare_op = 1;
+ optional Comparator comparator = 2;
+}
+
+message DependentColumnFilter {
+ required CompareFilter compare_filter = 1;
+ optional bytes column_family = 2;
+ optional bytes column_qualifier = 3;
+ optional bool drop_dependent_column = 4;
+}
+
+message FamilyFilter {
+ required CompareFilter compare_filter = 1;
+}
+
+message FilterList {
+ required Operator operator = 1;
+ repeated Filter filters = 2;
+
+ enum Operator {
+ MUST_PASS_ALL = 1;
+ MUST_PASS_ONE = 2;
+ }
+}
+
+message FilterWrapper {
+ required Filter filter = 1;
+}
+
+message FirstKeyOnlyFilter {
+}
+
+message FirstKeyValueMatchingQualifiersFilter {
+ repeated bytes qualifiers = 1;
+}
+
+message FuzzyRowFilter {
+ repeated BytesBytesPair fuzzy_keys_data = 1;
+}
+
+message InclusiveStopFilter {
+ optional bytes stop_row_key = 1;
+}
+
+message KeyOnlyFilter {
+ required bool len_as_val = 1;
+}
+
+message MultipleColumnPrefixFilter {
+ repeated bytes sorted_prefixes = 1;
+}
+
+message PageFilter {
+ required int64 page_size = 1;
+}
+
+message PrefixFilter {
+ optional bytes prefix = 1;
+}
+
+message QualifierFilter {
+ required CompareFilter compare_filter = 1;
+}
+
+message RandomRowFilter {
+ required float chance = 1;
+}
+
+message RowFilter {
+ required CompareFilter compare_filter = 1;
+}
+
+message SingleColumnValueExcludeFilter {
+ required SingleColumnValueFilter single_column_value_filter = 1;
+}
+
+message SingleColumnValueFilter {
+ optional bytes column_family = 1;
+ optional bytes column_qualifier = 2;
+ required CompareType compare_op = 3;
+ required Comparator comparator = 4;
+ optional bool filter_if_missing = 5;
+ optional bool latest_version_only = 6;
+}
+
+message SkipFilter {
+ required Filter filter = 1;
+}
+
+message TimestampsFilter {
+ repeated int64 timestamps = 1 [packed=true];
+}
+
+message ValueFilter {
+ required CompareFilter compare_filter = 1;
+}
+
+message WhileMatchFilter {
+ required Filter filter = 1;
+}
+message FilterAllFilter {
+}
+
+message RowRange {
+ optional bytes start_row = 1;
+ optional bool start_row_inclusive = 2;
+ optional bytes stop_row = 3;
+ optional bool stop_row_inclusive =4;
+}
+
+message MultiRowRangeFilter {
+ repeated RowRange row_range_list = 1;
+}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/hbase/blob/967f0910/hbase-native-client/if/HBase.proto
----------------------------------------------------------------------
diff --git a/hbase-native-client/if/HBase.proto b/hbase-native-client/if/HBase.proto
new file mode 100644
index 0000000..e5c967a
--- /dev/null
+++ b/hbase-native-client/if/HBase.proto
@@ -0,0 +1,258 @@
+/**
+ * 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.
+ */
+
+// This file contains protocol buffers that are shared throughout HBase
+package hbase.pb;
+
+option java_package = "org.apache.hadoop.hbase.protobuf.generated";
+option java_outer_classname = "HBaseProtos";
+option java_generate_equals_and_hash = true;
+option optimize_for = SPEED;
+
+import "Cell.proto";
+
+/**
+ * Table Name
+ */
+message TableName {
+ required bytes namespace = 1;
+ required bytes qualifier = 2;
+}
+
+/**
+ * Table Schema
+ * Inspired by the rest TableSchema
+ */
+message TableSchema {
+ optional TableName table_name = 1;
+ repeated BytesBytesPair attributes = 2;
+ repeated ColumnFamilySchema column_families = 3;
+ repeated NameStringPair configuration = 4;
+}
+
+/** Denotes state of the table */
+message TableState {
+ // Table's current state
+ enum State {
+ ENABLED = 0;
+ DISABLED = 1;
+ DISABLING = 2;
+ ENABLING = 3;
+ }
+ // This is the table's state.
+ required State state = 1;
+}
+
+/** On HDFS representation of table state. */
+message TableDescriptor {
+ required TableSchema schema = 1;
+}
+
+/**
+ * Column Family Schema
+ * Inspired by the rest ColumSchemaMessage
+ */
+message ColumnFamilySchema {
+ required bytes name = 1;
+ repeated BytesBytesPair attributes = 2;
+ repeated NameStringPair configuration = 3;
+}
+
+/**
+ * Protocol buffer version of HRegionInfo.
+ */
+message RegionInfo {
+ required uint64 region_id = 1;
+ required TableName table_name = 2;
+ optional bytes start_key = 3;
+ optional bytes end_key = 4;
+ optional bool offline = 5;
+ optional bool split = 6;
+ optional int32 replica_id = 7 [default = 0];
+}
+
+/**
+ * Protocol buffer for favored nodes
+ */
+message FavoredNodes {
+ repeated ServerName favored_node = 1;
+}
+
+/**
+ * Container protocol buffer to specify a region.
+ * You can specify region by region name, or the hash
+ * of the region name, which is known as encoded
+ * region name.
+ */
+message RegionSpecifier {
+ required RegionSpecifierType type = 1;
+ required bytes value = 2;
+
+ enum RegionSpecifierType {
+ // <tablename>,<startkey>,<regionId>.<encodedName>
+ REGION_NAME = 1;
+
+ // hash of <tablename>,<startkey>,<regionId>
+ ENCODED_REGION_NAME = 2;
+ }
+}
+
+/**
+ * A range of time. Both from and to are Java time
+ * stamp in milliseconds. If you don't specify a time
+ * range, it means all time. By default, if not
+ * specified, from = 0, and to = Long.MAX_VALUE
+ */
+message TimeRange {
+ optional uint64 from = 1;
+ optional uint64 to = 2;
+}
+
+/* ColumnFamily Specific TimeRange */
+message ColumnFamilyTimeRange {
+ required bytes column_family = 1;
+ required TimeRange time_range = 2;
+}
+
+/* Comparison operators */
+enum CompareType {
+ LESS = 0;
+ LESS_OR_EQUAL = 1;
+ EQUAL = 2;
+ NOT_EQUAL = 3;
+ GREATER_OR_EQUAL = 4;
+ GREATER = 5;
+ NO_OP = 6;
+}
+
+/**
+ * Protocol buffer version of ServerName
+ */
+message ServerName {
+ required string host_name = 1;
+ optional uint32 port = 2;
+ optional uint64 start_code = 3;
+}
+
+// Comment data structures
+
+message Coprocessor {
+ required string name = 1;
+}
+
+message NameStringPair {
+ required string name = 1;
+ required string value = 2;
+}
+
+message NameBytesPair {
+ required string name = 1;
+ optional bytes value = 2;
+}
+
+message BytesBytesPair {
+ required bytes first = 1;
+ required bytes second = 2;
+}
+
+message NameInt64Pair {
+ optional string name = 1;
+ optional int64 value = 2;
+}
+
+/**
+ * Description of the snapshot to take
+ */
+message SnapshotDescription {
+ required string name = 1;
+ optional string table = 2; // not needed for delete, but checked for in taking snapshot
+ optional int64 creation_time = 3 [default = 0];
+ enum Type {
+ DISABLED = 0;
+ FLUSH = 1;
+ SKIPFLUSH = 2;
+ }
+ optional Type type = 4 [default = FLUSH];
+ optional int32 version = 5;
+ optional string owner = 6;
+}
+
+/**
+ * Description of the distributed procedure to take
+ */
+message ProcedureDescription {
+ required string signature = 1; // the unique signature of the procedure
+ optional string instance = 2; // the procedure instance name
+ optional int64 creation_time = 3 [default = 0];
+ repeated NameStringPair configuration = 4;
+}
+
+message EmptyMsg {
+}
+
+enum TimeUnit {
+ NANOSECONDS = 1;
+ MICROSECONDS = 2;
+ MILLISECONDS = 3;
+ SECONDS = 4;
+ MINUTES = 5;
+ HOURS = 6;
+ DAYS = 7;
+}
+
+message LongMsg {
+ required int64 long_msg = 1;
+}
+
+message DoubleMsg {
+ required double double_msg = 1;
+}
+
+message BigDecimalMsg {
+ required bytes bigdecimal_msg = 1;
+}
+
+message UUID {
+ required uint64 least_sig_bits = 1;
+ required uint64 most_sig_bits = 2;
+}
+
+message NamespaceDescriptor {
+ required bytes name = 1;
+ repeated NameStringPair configuration = 2;
+}
+
+// Rpc client version info proto. Included in ConnectionHeader on connection setup
+message VersionInfo {
+ required string version = 1;
+ required string url = 2;
+ required string revision = 3;
+ required string user = 4;
+ required string date = 5;
+ required string src_checksum = 6;
+ optional uint32 version_major = 7;
+ optional uint32 version_minor = 8;
+}
+
+/**
+ * Description of the region server info
+ */
+message RegionServerInfo {
+ optional int32 infoPort = 1;
+ optional VersionInfo version_info = 2;
+}
http://git-wip-us.apache.org/repos/asf/hbase/blob/967f0910/hbase-native-client/if/HFile.proto
----------------------------------------------------------------------
diff --git a/hbase-native-client/if/HFile.proto b/hbase-native-client/if/HFile.proto
new file mode 100644
index 0000000..5c5e4f3
--- /dev/null
+++ b/hbase-native-client/if/HFile.proto
@@ -0,0 +1,49 @@
+/**
+ * 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.
+ */
+
+package hbase.pb;
+
+option java_package = "org.apache.hadoop.hbase.protobuf.generated";
+option java_outer_classname = "HFileProtos";
+option java_generic_services = true;
+option java_generate_equals_and_hash = true;
+option optimize_for = SPEED;
+
+import "HBase.proto";
+
+// Map of name/values
+message FileInfoProto {
+ repeated BytesBytesPair map_entry = 1;
+}
+
+// HFile file trailer
+message FileTrailerProto {
+ optional uint64 file_info_offset = 1;
+ optional uint64 load_on_open_data_offset = 2;
+ optional uint64 uncompressed_data_index_size = 3;
+ optional uint64 total_uncompressed_bytes = 4;
+ optional uint32 data_index_count = 5;
+ optional uint32 meta_index_count = 6;
+ optional uint64 entry_count = 7;
+ optional uint32 num_data_index_levels = 8;
+ optional uint64 first_data_block_offset = 9;
+ optional uint64 last_data_block_offset = 10;
+ optional string comparator_class_name = 11;
+ optional uint32 compression_codec = 12;
+ optional bytes encryption_key = 13;
+}
http://git-wip-us.apache.org/repos/asf/hbase/blob/967f0910/hbase-native-client/if/LoadBalancer.proto
----------------------------------------------------------------------
diff --git a/hbase-native-client/if/LoadBalancer.proto b/hbase-native-client/if/LoadBalancer.proto
new file mode 100644
index 0000000..f9c5d0d
--- /dev/null
+++ b/hbase-native-client/if/LoadBalancer.proto
@@ -0,0 +1,29 @@
+/**
+ * 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.
+ */
+
+// This file contains protocol buffers to represent the state of the load balancer.
+package hbase.pb;
+
+option java_package = "org.apache.hadoop.hbase.protobuf.generated";
+option java_outer_classname = "LoadBalancerProtos";
+option java_generate_equals_and_hash = true;
+option optimize_for = SPEED;
+
+message LoadBalancerState {
+ optional bool balancer_on = 1;
+}
http://git-wip-us.apache.org/repos/asf/hbase/blob/967f0910/hbase-native-client/if/MapReduce.proto
----------------------------------------------------------------------
diff --git a/hbase-native-client/if/MapReduce.proto b/hbase-native-client/if/MapReduce.proto
new file mode 100644
index 0000000..f96ffdf
--- /dev/null
+++ b/hbase-native-client/if/MapReduce.proto
@@ -0,0 +1,37 @@
+/**
+ * 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.
+ */
+
+ //This file includes protocol buffers used in MapReduce only.
+package hbase.pb;
+
+option java_package = "org.apache.hadoop.hbase.protobuf.generated";
+option java_outer_classname = "MapReduceProtos";
+option java_generate_equals_and_hash = true;
+option optimize_for = SPEED;
+
+import "HBase.proto";
+
+message ScanMetrics {
+ repeated NameInt64Pair metrics = 1;
+}
+
+message TableSnapshotRegionSplit {
+ repeated string locations = 2;
+ optional TableSchema table = 3;
+ optional RegionInfo region = 4;
+}
[2/8] hbase git commit: HBASE-15401 Add Zookeeper to third party
Posted by ec...@apache.org.
HBASE-15401 Add Zookeeper to third party
Project: http://git-wip-us.apache.org/repos/asf/hbase/repo
Commit: http://git-wip-us.apache.org/repos/asf/hbase/commit/d518092e
Tree: http://git-wip-us.apache.org/repos/asf/hbase/tree/d518092e
Diff: http://git-wip-us.apache.org/repos/asf/hbase/diff/d518092e
Branch: refs/heads/HBASE-14850
Commit: d518092e1a44fefd55270ab6f44754fae9e8e443
Parents: 967f091
Author: Elliott Clark <ec...@apache.org>
Authored: Mon Mar 7 14:58:21 2016 -0800
Committer: Elliott Clark <ec...@apache.org>
Committed: Fri Mar 25 16:12:13 2016 -0700
----------------------------------------------------------------------
hbase-native-client/Dockerfile | 26 ++++++++-
hbase-native-client/third-party/BUCK | 96 ++++++++++++++-----------------
2 files changed, 68 insertions(+), 54 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/hbase/blob/d518092e/hbase-native-client/Dockerfile
----------------------------------------------------------------------
diff --git a/hbase-native-client/Dockerfile b/hbase-native-client/Dockerfile
index 5f17f04..1364d22 100644
--- a/hbase-native-client/Dockerfile
+++ b/hbase-native-client/Dockerfile
@@ -15,8 +15,30 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-FROM pjameson/buck-folly-watchman
+FROM cpp_update
-RUN apt-get install -y libprotobuf-dev protobuf-compiler clang-format-3.7 vim maven inetutils-ping
+ARG CC=/usr/bin/gcc-5
+ARG CXX=/usr/bin/g++-5
+ARG CFLAGS="-D_GLIBCXX_USE_CXX11_ABI=0 -fPIC -g -fno-omit-frame-pointer -O3 -pthread"
+ARG CXXFLAGS="-D_GLIBCXX_USE_CXX11_ABI=0 -fPIC -g -fno-omit-frame-pointer -O3 -pthread"
+
+RUN apt-get install -y clang-format-3.7 vim maven inetutils-ping
+RUN git clone --depth 1 --branch v2.6.1 https://github.com/google/protobuf.git /usr/src/protobuf && \
+ cd /usr/src/protobuf/ && \
+ ./autogen.sh && \
+ ./configure --disable-shared && \
+ make && \
+ make check && \
+ make install
+RUN cd /usr/src && \
+ wget http://www-us.apache.org/dist/zookeeper/zookeeper-3.4.8/zookeeper-3.4.8.tar.gz && \
+ tar zxf zookeeper-3.4.8.tar.gz && \
+ rm -rf zookeeper-3.4.8.tar.gz && \
+ cd zookeeper-3.4.8 && \
+ cd src/c && \
+ ./configure --disable-shared && \
+ make && \
+ make install && \
+ make clean
WORKDIR /usr/local/src/hbase/hbase-native-client
http://git-wip-us.apache.org/repos/asf/hbase/blob/d518092e/hbase-native-client/third-party/BUCK
----------------------------------------------------------------------
diff --git a/hbase-native-client/third-party/BUCK b/hbase-native-client/third-party/BUCK
index b7baa86..e577a5f 100644
--- a/hbase-native-client/third-party/BUCK
+++ b/hbase-native-client/third-party/BUCK
@@ -15,68 +15,60 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-def add_system_libs(names = []):
+def add_system_libs(names = [], lib_dir = "/usr/lib/x86_64-linux-gnu", deps = [], exported_linker_flags = []):
rules = []
for name in names:
- prebuilt_cxx_library(
- name = name,
- lib_name = name,
- lib_dir = "/usr/lib/x86_64-linux-gnu",
- visibility = [ 'PUBLIC', ],
- )
- rules.append(":" + name)
-
+ gen_rule_name = "gen_lib{}".format(name)
+ genrule(
+ name = gen_rule_name,
+ out = gen_rule_name,
+ bash = "mkdir -p $OUT && cp {}/lib{}.* $OUT".format(lib_dir,name),
+ )
+ prebuilt_cxx_library(
+ name = name,
+ lib_name = name,
+ lib_dir = '$(location :{})'.format(gen_rule_name),
+ force_static = True,
+ deps = deps,
+ visibility = [ 'PUBLIC' ],
+ exported_linker_flags = exported_linker_flags,
+ )
+ rules.append(":" + name)
return rules
system_libs = [
+ "unwind",
+ "lzma",
+]
+local_libs = [
"double-conversion",
"glog",
- "protobuf",
"gflags",
- "unwind",
- "lzma",
+ "protobuf",
+ "zookeeper_mt",
"boost_regex",
]
-tp_dep_rules = add_system_libs(system_libs)
-prebuilt_cxx_library(
- name = "folly",
- lib_name = "folly",
- lib_dir = "/usr/local/lib",
- deps = tp_dep_rules,
- exported_linker_flags = [
- "-pthread",
- "-lstdc++",
- ],
- visibility = [
- 'PUBLIC',
- ]
-)
-prebuilt_cxx_library(
- name = "follybenchmark",
- lib_name = "follybenchmark",
- lib_dir = "/usr/local/lib",
- deps = tp_dep_rules + [":folly"],
- exported_linker_flags = [
- "-pthread",
- "-lstdc++",
- ],
- visibility = [
- 'PUBLIC',
- ]
-)
-prebuilt_cxx_library(
- name = "wangle",
- lib_name = "wangle",
- lib_dir = "/usr/local/lib",
- deps = tp_dep_rules + [":folly"],
- exported_linker_flags = [
- "-pthread",
- "-lstdc++",
- ],
- visibility = [
- 'PUBLIC',
- ]
-)
+
+tp_dep_rules = add_system_libs(system_libs) \
+ + add_system_libs(local_libs, lib_dir = "/usr/local/lib")
+folly = add_system_libs(
+ ['folly'],
+ lib_dir = '/usr/local/lib',
+ deps = tp_dep_rules,
+ exported_linker_flags = [ "-pthread", "-lstdc++",]
+ )
+folly_bench = add_system_libs(
+ ['follybenchmark'],
+ lib_dir = '/usr/local/lib',
+ deps = tp_dep_rules + folly,
+ exported_linker_flags = [ "-pthread", "-lstdc++",]
+ )
+wangle = add_system_libs(
+ ['wangle'],
+ lib_dir = '/usr/local/lib',
+ deps = tp_dep_rules + folly,
+ exported_linker_flags = [ "-pthread", "-lstdc++",]
+ )
cxx_library(
name = 'google-test',
srcs = [
[6/8] hbase git commit: HBASE-14854 Read meta location from zk
Posted by ec...@apache.org.
HBASE-14854 Read meta location from zk
Project: http://git-wip-us.apache.org/repos/asf/hbase/repo
Commit: http://git-wip-us.apache.org/repos/asf/hbase/commit/a51ac256
Tree: http://git-wip-us.apache.org/repos/asf/hbase/tree/a51ac256
Diff: http://git-wip-us.apache.org/repos/asf/hbase/diff/a51ac256
Branch: refs/heads/HBASE-14850
Commit: a51ac256e565db1915f30ab96c4536b8edb8c270
Parents: d518092
Author: Elliott Clark <ec...@apache.org>
Authored: Sat Mar 5 00:09:08 2016 -0800
Committer: Elliott Clark <ec...@apache.org>
Committed: Fri Mar 25 16:12:13 2016 -0700
----------------------------------------------------------------------
hbase-native-client/Dockerfile | 20 ++-
hbase-native-client/bin/start-docker.sh | 5 +-
hbase-native-client/core/BUCK | 106 +++++++-------
.../core/HBaseNativeClientTestEnv.cc | 42 ------
.../core/SampleNativeClientTest.cc | 28 ----
hbase-native-client/core/location-cache-test.cc | 14 ++
hbase-native-client/core/location-cache.cc | 67 +++++++++
hbase-native-client/core/location-cache.h | 35 +++++
.../core/native-client-test-env.cc | 42 ++++++
.../core/simple-native-client-test.cc | 28 ++++
hbase-native-client/core/test_env.h | 2 +
hbase-native-client/if/BUCK | 1 +
hbase-native-client/third-party/BUCK | 138 ++++++++++---------
13 files changed, 339 insertions(+), 189 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/hbase/blob/a51ac256/hbase-native-client/Dockerfile
----------------------------------------------------------------------
diff --git a/hbase-native-client/Dockerfile b/hbase-native-client/Dockerfile
index 1364d22..36959a5 100644
--- a/hbase-native-client/Dockerfile
+++ b/hbase-native-client/Dockerfile
@@ -15,7 +15,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-FROM cpp_update
+FROM pjameson/buck-folly-watchman
ARG CC=/usr/bin/gcc-5
ARG CXX=/usr/bin/g++-5
@@ -25,20 +25,26 @@ ARG CXXFLAGS="-D_GLIBCXX_USE_CXX11_ABI=0 -fPIC -g -fno-omit-frame-pointer -O3 -p
RUN apt-get install -y clang-format-3.7 vim maven inetutils-ping
RUN git clone --depth 1 --branch v2.6.1 https://github.com/google/protobuf.git /usr/src/protobuf && \
cd /usr/src/protobuf/ && \
+ ldconfig && \
./autogen.sh && \
- ./configure --disable-shared && \
+ ./configure && \
make && \
- make check && \
- make install
+ make install && \
+ make clean && \
+ rm -rf .git
+
RUN cd /usr/src && \
wget http://www-us.apache.org/dist/zookeeper/zookeeper-3.4.8/zookeeper-3.4.8.tar.gz && \
tar zxf zookeeper-3.4.8.tar.gz && \
rm -rf zookeeper-3.4.8.tar.gz && \
cd zookeeper-3.4.8 && \
cd src/c && \
- ./configure --disable-shared && \
+ ldconfig && \
+ ./configure && \
make && \
make install && \
- make clean
+ make clean
+
+RUN ldconfig
-WORKDIR /usr/local/src/hbase/hbase-native-client
+WORKDIR /usr/src/hbase/hbase-native-client
http://git-wip-us.apache.org/repos/asf/hbase/blob/a51ac256/hbase-native-client/bin/start-docker.sh
----------------------------------------------------------------------
diff --git a/hbase-native-client/bin/start-docker.sh b/hbase-native-client/bin/start-docker.sh
index 4426705..725ed6a 100755
--- a/hbase-native-client/bin/start-docker.sh
+++ b/hbase-native-client/bin/start-docker.sh
@@ -19,8 +19,11 @@
set -e
set -x
+# Try out some standard docker machine names that could work
eval "$(docker-machine env docker-vm)"
eval "$(docker-machine env dinghy)"
+
+# Build the image
docker build -t hbase_native .
@@ -36,6 +39,6 @@ fi;
docker run -p 16010:16010/tcp \
-e "JAVA_HOME=/usr/lib/jvm/java-8-oracle" \
- -v ${PWD}/..:/usr/local/src/hbase \
+ -v ${PWD}/..:/usr/src/hbase \
-v ~/.m2:/root/.m2 \
-it hbase_native /bin/bash
http://git-wip-us.apache.org/repos/asf/hbase/blob/a51ac256/hbase-native-client/core/BUCK
----------------------------------------------------------------------
diff --git a/hbase-native-client/core/BUCK b/hbase-native-client/core/BUCK
index ef027a1..817b5a0 100644
--- a/hbase-native-client/core/BUCK
+++ b/hbase-native-client/core/BUCK
@@ -15,52 +15,62 @@
# See the License for the specific language governing permissions and
# limitations under the License.
+cxx_library(name="core",
+ headers=[
+ "admin.h",
+ "client.h",
+ "connection.h",
+ "connection_attr.h",
+ "delete.h",
+ "get.h",
+ "hbase_macros.h",
+ "mutation.h",
+ "put.h",
+ "scanner.h",
+ "location-cache.h",
+ ],
+ srcs=[
+ "admin.cc",
+ "client.cc",
+ "connection.cc",
+ "get.cc",
+ "mutation.cc",
+ "put.cc",
+ "delete.cc",
+ "scanner.cc",
+ "location-cache.cc",
+ ],
+ deps=[
+ "//if:if",
+ "//third-party:zookeeper_mt",
+ "//third-party:folly",
+ "//third-party:wangle",
+ ],
+ visibility=[
+ 'PUBLIC',
+ ], )
-cxx_binary(
- name = "core",
- headers = [
- "admin.h",
- "client.h",
- "connection.h",
- "connection_attr.h",
- "delete.h",
- "get.h",
- "hbase_macros.h",
- "mutation.h",
- "put.h",
- "scanner.h",
- ],
- srcs = [
- "admin.cc",
- "client.cc",
- "connection.cc",
- "get.cc",
- "mutation.cc",
- "put.cc",
- "delete.cc",
- "scanner.cc",
- ],
- deps = [
- "//if:if",
- "//third-party:folly",
- "//third-party:wangle",
- ],
- visibility = [
- 'PUBLIC',
- ],
-)
-
-cxx_test(
- name = "core_test",
- headers = [
- "test_env.h",
- ],
- srcs = [
- "HBaseNativeClientTestEnv.cc",
- "SampleNativeClientTest.cc",
- ],
- deps = [
- ":core",
- ],
- run_test_separately = True,
-)
+cxx_test(name="simple-test",
+ headers=[
+ "test_env.h",
+ ],
+ srcs=[
+ "native-client-test-env.cc",
+ "simple-native-client-test.cc",
+ ],
+ deps=[
+ ":core",
+ ],
+ run_test_separately=True, )
+cxx_test(name="location-cache-test",
+ headers=[
+ "test_env.h",
+ ],
+ srcs=[
+ "native-client-test-env.cc",
+ "location-cache-test.cc",
+ ],
+ deps=[
+ ":core",
+ ],
+ run_test_separately=True, )
http://git-wip-us.apache.org/repos/asf/hbase/blob/a51ac256/hbase-native-client/core/HBaseNativeClientTestEnv.cc
----------------------------------------------------------------------
diff --git a/hbase-native-client/core/HBaseNativeClientTestEnv.cc b/hbase-native-client/core/HBaseNativeClientTestEnv.cc
deleted file mode 100644
index b8cb8db..0000000
--- a/hbase-native-client/core/HBaseNativeClientTestEnv.cc
+++ /dev/null
@@ -1,42 +0,0 @@
-/*
- * 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.
- *
- */
-
-#include <gtest/gtest.h>
-#include <core/test_env.h>
-
-namespace {
-
-class HBaseNativeClientTestEnv : public ::testing::Environment {
- public:
- void SetUp() override {
- init_test_env();
- }
-
- void TearDown() override {
- clean_test_env();
- }
-};
-
-} // anonymous
-
-int main(int argc, char** argv) {
- testing::InitGoogleTest(&argc, argv);
- ::testing::AddGlobalTestEnvironment(new HBaseNativeClientTestEnv());
- return RUN_ALL_TESTS();
-}
http://git-wip-us.apache.org/repos/asf/hbase/blob/a51ac256/hbase-native-client/core/SampleNativeClientTest.cc
----------------------------------------------------------------------
diff --git a/hbase-native-client/core/SampleNativeClientTest.cc b/hbase-native-client/core/SampleNativeClientTest.cc
deleted file mode 100644
index ef564f7..0000000
--- a/hbase-native-client/core/SampleNativeClientTest.cc
+++ /dev/null
@@ -1,28 +0,0 @@
-/*
- * 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.
- *
- */
-
-#include "gtest/gtest.h"
-
-/**
- * Sample test.
- */
-TEST(SampleTest, sample) {
- EXPECT_TRUE(true);
-}
-
http://git-wip-us.apache.org/repos/asf/hbase/blob/a51ac256/hbase-native-client/core/location-cache-test.cc
----------------------------------------------------------------------
diff --git a/hbase-native-client/core/location-cache-test.cc b/hbase-native-client/core/location-cache-test.cc
new file mode 100644
index 0000000..3106e36
--- /dev/null
+++ b/hbase-native-client/core/location-cache-test.cc
@@ -0,0 +1,14 @@
+#include <gtest/gtest.h>
+#include <folly/Memory.h>
+#include <wangle/concurrent/GlobalExecutor.h>
+
+#include "location-cache.h"
+using namespace hbase;
+
+TEST(LocationCacheTest, TestGetMetaNodeContents) {
+ // TODO(elliott): need to make a test utility for this.
+ LocationCache cache{"localhost:2181", wangle::getCPUExecutor()};
+ auto result = cache.LocateMeta();
+ result.wait();
+ ASSERT_FALSE(result.hasException());
+}
http://git-wip-us.apache.org/repos/asf/hbase/blob/a51ac256/hbase-native-client/core/location-cache.cc
----------------------------------------------------------------------
diff --git a/hbase-native-client/core/location-cache.cc b/hbase-native-client/core/location-cache.cc
new file mode 100644
index 0000000..cf61e24
--- /dev/null
+++ b/hbase-native-client/core/location-cache.cc
@@ -0,0 +1,67 @@
+#include "location-cache.h"
+
+#include <folly/Logging.h>
+
+#include "if/ZooKeeper.pb.h"
+
+using namespace std;
+using namespace folly;
+using namespace hbase::pb;
+
+namespace hbase {
+
+// TODO(elliott): make this configurable on client creation
+const static string META_LOCATION = "/hbase/meta-region-server";
+
+LocationCache::LocationCache(string quorum_spec,
+ shared_ptr<folly::Executor> executor)
+ : quorum_spec_(quorum_spec), executor_(executor), meta_promise_(nullptr) {
+ zk_ = zookeeper_init(quorum_spec.c_str(), nullptr, 1000, 0, 0, 0);
+}
+
+LocationCache::~LocationCache() {
+ zookeeper_close(zk_);
+ zk_ = nullptr;
+ LOG(INFO) << "Closed connection to ZooKeeper.";
+}
+
+Future<ServerName> LocationCache::LocateMeta() {
+ lock_guard<mutex> g(meta_lock_);
+ if (meta_promise_ == nullptr) {
+ this->RefreshMetaLocation();
+ }
+ return meta_promise_->getFuture();
+}
+
+void LocationCache::InvalidateMeta() {
+ if (meta_promise_ != nullptr) {
+ lock_guard<mutex> g(meta_lock_);
+ meta_promise_ = nullptr;
+ }
+}
+
+/// MUST hold the meta_lock_
+void LocationCache::RefreshMetaLocation() {
+ meta_promise_ = make_unique<SharedPromise<ServerName>>();
+ executor_->add([&] {
+ meta_promise_->setWith([&] { return this->ReadMetaLocation(); });
+ });
+}
+
+ServerName LocationCache::ReadMetaLocation() {
+ char contents[4096];
+ int len = sizeof(contents);
+ // TODO(elliott): handle disconnects/reconntion as needed.
+ int zk_result =
+ zoo_get(this->zk_, META_LOCATION.c_str(), 0, contents, &len, nullptr);
+
+ if (zk_result != ZOK) {
+ LOG(ERROR) << "Error getting meta location.";
+ throw runtime_error("Error getting meta location");
+ }
+
+ MetaRegionServer mrs;
+ mrs.ParseFromArray(contents, len);
+ return mrs.server();
+}
+}
http://git-wip-us.apache.org/repos/asf/hbase/blob/a51ac256/hbase-native-client/core/location-cache.h
----------------------------------------------------------------------
diff --git a/hbase-native-client/core/location-cache.h b/hbase-native-client/core/location-cache.h
new file mode 100644
index 0000000..8dc2760
--- /dev/null
+++ b/hbase-native-client/core/location-cache.h
@@ -0,0 +1,35 @@
+#pragma once
+
+#include <memory>
+#include <mutex>
+
+#include <zookeeper/zookeeper.h>
+#include <folly/futures/Future.h>
+#include <folly/futures/SharedPromise.h>
+
+#include <folly/Executor.h>
+#include "if/HBase.pb.h"
+
+namespace hbase {
+class LocationCache {
+public:
+ explicit LocationCache(std::string quorum_spec,
+ std::shared_ptr<folly::Executor> executor);
+ ~LocationCache();
+ // Meta Related Methods.
+ // These are only public until testing is complete
+ folly::Future<hbase::pb::ServerName> LocateMeta();
+ void InvalidateMeta();
+
+private:
+ void RefreshMetaLocation();
+ hbase::pb::ServerName ReadMetaLocation();
+
+ std::string quorum_spec_;
+ std::shared_ptr<folly::Executor> executor_;
+ std::unique_ptr<folly::SharedPromise<hbase::pb::ServerName>> meta_promise_;
+ std::mutex meta_lock_;
+
+ zhandle_t *zk_;
+};
+} // hbase
http://git-wip-us.apache.org/repos/asf/hbase/blob/a51ac256/hbase-native-client/core/native-client-test-env.cc
----------------------------------------------------------------------
diff --git a/hbase-native-client/core/native-client-test-env.cc b/hbase-native-client/core/native-client-test-env.cc
new file mode 100644
index 0000000..a86961f
--- /dev/null
+++ b/hbase-native-client/core/native-client-test-env.cc
@@ -0,0 +1,42 @@
+/*
+ * 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.
+ *
+ */
+
+#include <gtest/gtest.h>
+#include <core/test_env.h>
+
+namespace {
+
+class NativeClientTestEnv : public ::testing::Environment {
+ public:
+ void SetUp() override {
+ init_test_env();
+ }
+
+ void TearDown() override {
+ clean_test_env();
+ }
+};
+
+} // anonymous
+
+int main(int argc, char** argv) {
+ testing::InitGoogleTest(&argc, argv);
+ ::testing::AddGlobalTestEnvironment(new NativeClientTestEnv());
+ return RUN_ALL_TESTS();
+}
http://git-wip-us.apache.org/repos/asf/hbase/blob/a51ac256/hbase-native-client/core/simple-native-client-test.cc
----------------------------------------------------------------------
diff --git a/hbase-native-client/core/simple-native-client-test.cc b/hbase-native-client/core/simple-native-client-test.cc
new file mode 100644
index 0000000..ef564f7
--- /dev/null
+++ b/hbase-native-client/core/simple-native-client-test.cc
@@ -0,0 +1,28 @@
+/*
+ * 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.
+ *
+ */
+
+#include "gtest/gtest.h"
+
+/**
+ * Sample test.
+ */
+TEST(SampleTest, sample) {
+ EXPECT_TRUE(true);
+}
+
http://git-wip-us.apache.org/repos/asf/hbase/blob/a51ac256/hbase-native-client/core/test_env.h
----------------------------------------------------------------------
diff --git a/hbase-native-client/core/test_env.h b/hbase-native-client/core/test_env.h
index 5796ae1..79bdbec 100644
--- a/hbase-native-client/core/test_env.h
+++ b/hbase-native-client/core/test_env.h
@@ -17,6 +17,8 @@
*
*/
+#pragma once
+
#include <cstdlib>
inline void init_test_env() {
http://git-wip-us.apache.org/repos/asf/hbase/blob/a51ac256/hbase-native-client/if/BUCK
----------------------------------------------------------------------
diff --git a/hbase-native-client/if/BUCK b/hbase-native-client/if/BUCK
index 3490a05..9b989b5 100644
--- a/hbase-native-client/if/BUCK
+++ b/hbase-native-client/if/BUCK
@@ -33,4 +33,5 @@ cxx_library(
+ [':' + x for x in CC_FILENAMES]
+ [ ':' + x for x in HEADER_FILENAMES ],
visibility = [ 'PUBLIC', ],
+ exported_deps = ['//third-party:protobuf']
)
http://git-wip-us.apache.org/repos/asf/hbase/blob/a51ac256/hbase-native-client/third-party/BUCK
----------------------------------------------------------------------
diff --git a/hbase-native-client/third-party/BUCK b/hbase-native-client/third-party/BUCK
index e577a5f..6548695 100644
--- a/hbase-native-client/third-party/BUCK
+++ b/hbase-native-client/third-party/BUCK
@@ -15,85 +15,97 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-def add_system_libs(names = [], lib_dir = "/usr/lib/x86_64-linux-gnu", deps = [], exported_linker_flags = []):
- rules = []
- for name in names:
- gen_rule_name = "gen_lib{}".format(name)
- genrule(
- name = gen_rule_name,
- out = gen_rule_name,
- bash = "mkdir -p $OUT && cp {}/lib{}.* $OUT".format(lib_dir,name),
- )
- prebuilt_cxx_library(
- name = name,
- lib_name = name,
- lib_dir = '$(location :{})'.format(gen_rule_name),
- force_static = True,
- deps = deps,
- visibility = [ 'PUBLIC' ],
- exported_linker_flags = exported_linker_flags,
- )
- rules.append(":" + name)
- return rules
-system_libs = [
- "unwind",
- "lzma",
-]
+def add_system_libs(names=[],
+ lib_dir="/usr/lib/x86_64-linux-gnu",
+ deps=[],
+ exported_deps=[],
+ exported_linker_flags=[]):
+ rules = []
+ for name in names:
+ gen_rule_name = "gen_lib{}".format(name)
+ genrule(name=gen_rule_name,
+ out=gen_rule_name,
+ bash="mkdir -p $OUT && cp {}/lib{}.a $OUT".format(lib_dir,
+ name), )
+ prebuilt_cxx_library(name=name,
+ lib_name=name,
+ lib_dir='$(location :{})'.format(gen_rule_name),
+ deps=deps,
+ force_static = True,
+ exported_deps=exported_deps,
+ visibility=['PUBLIC'],
+ exported_linker_flags=exported_linker_flags, )
+ rules.append(":" + name)
+ return rules
+
+
+system_libs = ["unwind", "lzma", "event", ]
local_libs = [
- "double-conversion",
- "glog",
- "gflags",
- "protobuf",
- "zookeeper_mt",
- "boost_regex",
+ "double-conversion",
+ "boost_regex",
+ "boost_context",
+ "boost_thread",
+ "boost_system",
+ "boost_filesystem",
+ "boost_program_options",
+ "boost_chrono",
+ "gflags",
+ "glog",
+ "protobuf",
]
+
+
tp_dep_rules = add_system_libs(system_libs) \
- + add_system_libs(local_libs, lib_dir = "/usr/local/lib")
-folly = add_system_libs(
- ['folly'],
- lib_dir = '/usr/local/lib',
- deps = tp_dep_rules,
- exported_linker_flags = [ "-pthread", "-lstdc++",]
- )
-folly_bench = add_system_libs(
- ['follybenchmark'],
- lib_dir = '/usr/local/lib',
- deps = tp_dep_rules + folly,
- exported_linker_flags = [ "-pthread", "-lstdc++",]
- )
-wangle = add_system_libs(
- ['wangle'],
- lib_dir = '/usr/local/lib',
- deps = tp_dep_rules + folly,
- exported_linker_flags = [ "-pthread", "-lstdc++",]
- )
+ + add_system_libs(local_libs, lib_dir = "/usr/local/lib")
+
+zookeeper = add_system_libs(["zookeeper_mt"], lib_dir = "/usr/local/lib")
+folly = add_system_libs(['folly'],
+ lib_dir='/usr/local/lib',
+ exported_deps=tp_dep_rules,
+ exported_linker_flags=["-pthread",
+ "-lstdc++", ])
+folly_bench = add_system_libs(['follybenchmark'],
+ lib_dir='/usr/local/lib',
+ exported_deps=tp_dep_rules + folly,
+ exported_linker_flags=["-pthread",
+ "-lstdc++", ])
+wangle = add_system_libs(['wangle'],
+ lib_dir='/usr/local/lib',
+ exported_deps=tp_dep_rules + folly,
+ exported_linker_flags=["-pthread",
+ "-lstdc++", ])
+
+
+genrule(
+name = "gen_zk",
+out = "gen_zk",
+bash = "mkdir -p $OUT && wget http://www-us.apache.org/dist/zookeeper/zookeeper-3.4.8/zookeeper-3.4.8.tar.gz && tar zxf zookeeper-3.4.8.tar.gz && rm -rf zookeeper-3.4.8.tar.gz && cd zookeeper-3.4.8 && cd src/c && ./configure --prefix=$OUT && make && make install && cd $OUT && rm -rf zookeeper-3.4.8*"
+)
cxx_library(
- name = 'google-test',
- srcs = [
+ name = 'google-test',
+ srcs = [
'googletest/googletest/src/gtest-all.cc',
'googletest/googlemock/src/gmock-all.cc',
'googletest/googlemock/src/gmock_main.cc',
- ],
- header_namespace = '',
- exported_headers = subdir_glob([
+ ],
+ header_namespace = '',
+ exported_headers = subdir_glob([
('googletest/googletest/include', '**/*.h'),
('googletest/googlemock/include', '**/*.h'),
- ]),
- headers = subdir_glob([
+ ]),
+ headers = subdir_glob([
('googletest/googletest', 'src/*.h'),
('googletest/googletest', 'src/*.cc'),
('googletest/googlemock', 'src/*.h'),
('googletest/googlemock', 'src/*.cc'),
- ]),
- exported_linker_flags = [
+ ]),
+ exported_linker_flags = [
"-pthread",
"-lstdc++",
- ],
- visibility = [
+ ],
+ visibility = [
'PUBLIC',
- ],
- deps = [
- ]
+ ],
)
[3/8] hbase git commit: HBASE-14852 Update build env
Posted by ec...@apache.org.
http://git-wip-us.apache.org/repos/asf/hbase/blob/3c81072b/hbase-native-client/src/async/hbase_result.h
----------------------------------------------------------------------
diff --git a/hbase-native-client/src/async/hbase_result.h b/hbase-native-client/src/async/hbase_result.h
deleted file mode 100644
index eecbbb3..0000000
--- a/hbase-native-client/src/async/hbase_result.h
+++ /dev/null
@@ -1,44 +0,0 @@
-/*
- * 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.
- *
- */
-
-#ifndef ASYNC_HBASE_RESULT_H_
-#define ASYNC_HBASE_RESULT_H_
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#include "core/hbase_macros.h"
-#include "core/hbase_types.h"
-
-HBASE_API int32_t hb_result_destroy(hb_result_t result);
-
-HBASE_API int32_t hb_result_get_cells(hb_result_t result,
- hb_cell_t ** cell_ptr, size_t * num_cells);
-
-HBASE_API int32_t hb_result_get_table(hb_result_t result,
- char ** table, size_t * table_length);
-HBASE_API int32_t hb_result_get_namespace(hb_result_t result,
- char ** name_space, size_t * name_space_length);
-
-#ifdef __cplusplus
-} // extern "C"
-#endif // __cplusplus
-
-#endif // ASYNC_HBASE_RESULT_H_
http://git-wip-us.apache.org/repos/asf/hbase/blob/3c81072b/hbase-native-client/src/async/hbase_scanner.cc
----------------------------------------------------------------------
diff --git a/hbase-native-client/src/async/hbase_scanner.cc b/hbase-native-client/src/async/hbase_scanner.cc
deleted file mode 100644
index 5a8e555..0000000
--- a/hbase-native-client/src/async/hbase_scanner.cc
+++ /dev/null
@@ -1,59 +0,0 @@
-/*
- * 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.
- *
- */
-#include "async/hbase_scanner.h"
-
-#include <stdlib.h>
-
-#include "core/hbase_types.h"
-#include "core/scanner.h"
-
-int32_t hb_scanner_create(hb_scanner_t * scanner_ptr) {
- (*scanner_ptr) = reinterpret_cast<hb_scanner_t>(new Scanner());
- return (*scanner_ptr != NULL)?0:1;
-}
-
-HBASE_API int32_t hb_scanner_set_table(hb_scanner_t scanner,
- char * table, size_t table_length) {
- return 0;
-}
-
-HBASE_API int32_t hb_scanner_set_namespace(hb_scanner_t scanner,
- char * name_space, size_t name_space_length) {
- return 0;
-}
-
-int32_t hb_scanner_set_start_row(hb_scanner_t scanner,
- unsigned char * start_row, size_t start_row_length) {
- return 0;
-}
-
-int32_t hb_scanner_set_end_row(hb_scanner_t scanner,
- unsigned char * end_row, size_t end_row_length) {
- return 0;
-}
-
-int32_t hb_scanner_set_cache_size(hb_scanner_t scanner,
- size_t cache_size) {
- return 0;
-}
-
-int32_t hb_scanner_set_num_versions(hb_scanner_t scanner,
- int8_t num_versions) {
- return 0;
-}
http://git-wip-us.apache.org/repos/asf/hbase/blob/3c81072b/hbase-native-client/src/async/hbase_scanner.h
----------------------------------------------------------------------
diff --git a/hbase-native-client/src/async/hbase_scanner.h b/hbase-native-client/src/async/hbase_scanner.h
deleted file mode 100644
index cd3f544..0000000
--- a/hbase-native-client/src/async/hbase_scanner.h
+++ /dev/null
@@ -1,80 +0,0 @@
-/*
- * 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.
- *
- */
-
-#ifndef ASYNC_HBASE_SCANNER_H_
-#define ASYNC_HBASE_SCANNER_H_
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#include "async/hbase_result.h"
-#include "core/hbase_types.h"
-
-HBASE_API int32_t hb_scanner_create(hb_scanner_t * scanner_ptr);
-
-HBASE_API int32_t hb_scanner_set_table(hb_scanner_t scanner,
- char * table, size_t table_length);
-HBASE_API int32_t hb_scanner_set_namespace(hb_scanner_t scanner,
- char * name_space, size_t name_space_length);
-
-HBASE_API int32_t hb_scanner_set_start_row(hb_scanner_t scanner,
- unsigned char * start_row, size_t start_row_length);
-HBASE_API int32_t hb_scanner_set_end_row(hb_scanner_t scanner,
- unsigned char * end_row, size_t end_row_length);
-
-HBASE_API int32_t hb_scanner_set_cache_size(hb_scanner_t scanner,
- size_t cache_size);
-HBASE_API int32_t hb_scanner_set_batch_size(hb_scanner_t scanner,
- size_t batch_size);
-HBASE_API int32_t hb_scanner_set_num_versions(hb_scanner_t scanner,
- int8_t num_versions);
-
-/*
- * Scanner call back typedef.
- *
- * This will be called when initinalization of the scanner
- * is complete. It will also be called when scanner next
- * returns results.
- */
-typedef void (* hb_scanner_cb)(int32_t status,
- hb_client_t client,
- hb_scanner_t scanner,
- hb_result_t results,
- size_t num_results,
- void * extra);
-/*
- * Get the next results from the scanner
- */
-HBASE_API int32_t hb_scanner_next(hb_client_t client,
- hb_scanner_t scanner, hb_scanner_cb cb, void * extra);
-
-/*
- * Close the scanner releasing any local and server side
- * resources held. The call back is fired just before the
- * scanner's memory is freed.
- */
-HBASE_API int32_t hb_scanner_destroy(hb_client_t client,
- hb_scanner_t scanner, hb_scanner_cb cb, void * extra);
-
-#ifdef __cplusplus
-} // extern "C"
-#endif // __cplusplus
-
-#endif // ASYNC_HBASE_SCANNER_H_
http://git-wip-us.apache.org/repos/asf/hbase/blob/3c81072b/hbase-native-client/src/async/mutations-test.cc
----------------------------------------------------------------------
diff --git a/hbase-native-client/src/async/mutations-test.cc b/hbase-native-client/src/async/mutations-test.cc
deleted file mode 100644
index be5898e..0000000
--- a/hbase-native-client/src/async/mutations-test.cc
+++ /dev/null
@@ -1,102 +0,0 @@
-/*
- * 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.
- *
- */
-
-#include <pthread.h>
-
-#include "gtest/gtest.h"
-#include "async/hbase_mutations.h"
-#include "async/hbase_client.h"
-
-pthread_cond_t cv;
-pthread_mutex_t mutex;
-
-bool sent = false;
-
-TEST(ClientTest, EasyTest) {
- EXPECT_EQ(1, 1);
-}
-
-void mutate_cb(int32_t status,
- hb_client_t client, hb_mutation_t mutation,
- hb_result_t result, void * extra) {
-
- // Test Stuff.
- EXPECT_EQ(status, 0);
- EXPECT_TRUE(client != NULL);
- EXPECT_TRUE(mutation != NULL);
-
- pthread_mutex_lock(&mutex);
- sent = true;
- pthread_cond_signal(&cv);
- pthread_mutex_unlock(&mutex);
-}
-
-void wait_send() {
- pthread_mutex_lock(&mutex);
- while (!sent) {
- pthread_cond_wait(&cv, &mutex);
- }
- pthread_mutex_unlock(&mutex);
-}
-
-TEST(MutationTest, TestPut) {
- char tn[] = "T1";
- hb_byte_t row[] = "ROW";
- char fam[] = "D";
- hb_byte_t qual[] = "QUAL";
- hb_byte_t data[] = "Z";
-
- hb_client_t client = NULL;
- hb_put_t put = NULL;
- hb_cell_t cell;
-
- cell.family = fam;
- cell.family_length = 1;
-
- cell.qual = qual;
- cell.qual_length = 4;
-
- cell.value = data;
- cell.value_length = 1;
-
- int32_t status = -1;
-
- status = hb_client_create(&client, NULL);
- EXPECT_EQ(0, status);
-
- hb_put_create(&put);
- hb_mutation_set_table((hb_mutation_t) put, tn, 2);
- hb_mutation_set_row((hb_mutation_t) put, row, 3);
- hb_put_add_cell(put, &cell);
-
- pthread_cond_init(&cv, NULL);
- pthread_mutex_init(&mutex, NULL);
-
- status = hb_mutation_send(client, (hb_mutation_t) put, &mutate_cb, NULL);
- EXPECT_EQ(0, status);
-
- // Now wait a while for things to send.
- wait_send();
- EXPECT_EQ(true, sent);
-
- hb_mutation_destroy((hb_mutation_t *) put);
- hb_client_destroy(client, NULL, NULL);
-
- EXPECT_EQ(0, status);
-}
http://git-wip-us.apache.org/repos/asf/hbase/blob/3c81072b/hbase-native-client/src/core/CMakeLists.txt
----------------------------------------------------------------------
diff --git a/hbase-native-client/src/core/CMakeLists.txt b/hbase-native-client/src/core/CMakeLists.txt
deleted file mode 100644
index 49f93b9..0000000
--- a/hbase-native-client/src/core/CMakeLists.txt
+++ /dev/null
@@ -1,31 +0,0 @@
-# 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.
-
-set( CORE_SRC
- admin.cc
- client.cc
- connection.cc
- get.cc
- mutation.cc
- put.cc
- delete.cc
- scanner.cc
- hbase_connection_attr.cc
-)
-
-
-add_library(hcore OBJECT ${CORE_SRC})
http://git-wip-us.apache.org/repos/asf/hbase/blob/3c81072b/hbase-native-client/src/core/admin.cc
----------------------------------------------------------------------
diff --git a/hbase-native-client/src/core/admin.cc b/hbase-native-client/src/core/admin.cc
deleted file mode 100644
index 897e6bf..0000000
--- a/hbase-native-client/src/core/admin.cc
+++ /dev/null
@@ -1,20 +0,0 @@
-/*
- * 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.
- *
- */
-
-#include "core/admin.h"
http://git-wip-us.apache.org/repos/asf/hbase/blob/3c81072b/hbase-native-client/src/core/admin.h
----------------------------------------------------------------------
diff --git a/hbase-native-client/src/core/admin.h b/hbase-native-client/src/core/admin.h
deleted file mode 100644
index 624c4ac..0000000
--- a/hbase-native-client/src/core/admin.h
+++ /dev/null
@@ -1,25 +0,0 @@
-/*
- * 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.
- *
- */
-
-#ifndef CORE_ADMIN_H_
-#define CORE_ADMIN_H_
-
-class Admin {
-};
-#endif // CORE_ADMIN_H_
http://git-wip-us.apache.org/repos/asf/hbase/blob/3c81072b/hbase-native-client/src/core/client.cc
----------------------------------------------------------------------
diff --git a/hbase-native-client/src/core/client.cc b/hbase-native-client/src/core/client.cc
deleted file mode 100644
index 91c235c..0000000
--- a/hbase-native-client/src/core/client.cc
+++ /dev/null
@@ -1,20 +0,0 @@
-/*
- * 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.
- *
- */
-
-#include "core/client.h"
http://git-wip-us.apache.org/repos/asf/hbase/blob/3c81072b/hbase-native-client/src/core/client.h
----------------------------------------------------------------------
diff --git a/hbase-native-client/src/core/client.h b/hbase-native-client/src/core/client.h
deleted file mode 100644
index 68348a8..0000000
--- a/hbase-native-client/src/core/client.h
+++ /dev/null
@@ -1,25 +0,0 @@
-/*
- * 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.
- *
- */
-
-#ifndef CORE_CLIENT_H_
-#define CORE_CLIENT_H_
-
-class Client {
-};
-#endif // CORE_CLIENT_H_
http://git-wip-us.apache.org/repos/asf/hbase/blob/3c81072b/hbase-native-client/src/core/connection.cc
----------------------------------------------------------------------
diff --git a/hbase-native-client/src/core/connection.cc b/hbase-native-client/src/core/connection.cc
deleted file mode 100644
index 099f31d..0000000
--- a/hbase-native-client/src/core/connection.cc
+++ /dev/null
@@ -1,22 +0,0 @@
-/*
- * 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.
- */
-#include "core/connection.h"
-
-void Connection::set_zk_quorum(char * zk_q) {
- this->zk_quorum = zk_q;
-}
http://git-wip-us.apache.org/repos/asf/hbase/blob/3c81072b/hbase-native-client/src/core/connection.h
----------------------------------------------------------------------
diff --git a/hbase-native-client/src/core/connection.h b/hbase-native-client/src/core/connection.h
deleted file mode 100644
index 463b7b5..0000000
--- a/hbase-native-client/src/core/connection.h
+++ /dev/null
@@ -1,26 +0,0 @@
-/*
- * 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.
- */
-#ifndef CORE_CONNECTION_H_
-#define CORE_CONNECTION_H_
-
-class Connection {
- char * zk_quorum;
- public:
- void set_zk_quorum(char * zk_q);
-};
-#endif // CORE_CONNECTION_H_
http://git-wip-us.apache.org/repos/asf/hbase/blob/3c81072b/hbase-native-client/src/core/connection_attr.h
----------------------------------------------------------------------
diff --git a/hbase-native-client/src/core/connection_attr.h b/hbase-native-client/src/core/connection_attr.h
deleted file mode 100644
index a7c229e..0000000
--- a/hbase-native-client/src/core/connection_attr.h
+++ /dev/null
@@ -1,30 +0,0 @@
-/*
- * 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.
- *
- */
-
-#ifndef CORE_CONNECTION_ATTR_H_
-#define CORE_CONNECTION_ATTR_H_
-
-#include "core/hbase_macros.h"
-#include "core/hbase_types.h"
-
-class ConnectionAttr {
-};
-
-#endif // CORE_CONNECTION_ATTR_H_
-
http://git-wip-us.apache.org/repos/asf/hbase/blob/3c81072b/hbase-native-client/src/core/delete.cc
----------------------------------------------------------------------
diff --git a/hbase-native-client/src/core/delete.cc b/hbase-native-client/src/core/delete.cc
deleted file mode 100644
index 695f5bf..0000000
--- a/hbase-native-client/src/core/delete.cc
+++ /dev/null
@@ -1,22 +0,0 @@
-/*
- * 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.
- */
-
-#include "core/delete.h"
-
-Delete::~Delete() {
-}
http://git-wip-us.apache.org/repos/asf/hbase/blob/3c81072b/hbase-native-client/src/core/delete.h
----------------------------------------------------------------------
diff --git a/hbase-native-client/src/core/delete.h b/hbase-native-client/src/core/delete.h
deleted file mode 100644
index 5740fd9..0000000
--- a/hbase-native-client/src/core/delete.h
+++ /dev/null
@@ -1,29 +0,0 @@
-/*
- * 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.
- *
- */
-
-#ifndef CORE_DELETE_H_
-#define CORE_DELETE_H_
-
-#include "core/mutation.h"
-
-class Delete: public Mutation {
- public:
- ~Delete();
-};
-#endif // CORE_DELETE_H_
http://git-wip-us.apache.org/repos/asf/hbase/blob/3c81072b/hbase-native-client/src/core/get.cc
----------------------------------------------------------------------
diff --git a/hbase-native-client/src/core/get.cc b/hbase-native-client/src/core/get.cc
deleted file mode 100644
index 9e11332..0000000
--- a/hbase-native-client/src/core/get.cc
+++ /dev/null
@@ -1,20 +0,0 @@
-/*
- * 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.
- *
- */
-
-#include "core/get.h"
http://git-wip-us.apache.org/repos/asf/hbase/blob/3c81072b/hbase-native-client/src/core/get.h
----------------------------------------------------------------------
diff --git a/hbase-native-client/src/core/get.h b/hbase-native-client/src/core/get.h
deleted file mode 100644
index 3a9fd28..0000000
--- a/hbase-native-client/src/core/get.h
+++ /dev/null
@@ -1,26 +0,0 @@
-/*
- * 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.
- *
- */
-
-#ifndef CORE_GET_H_
-#define CORE_GET_H_
-
-class Get {
-};
-
-#endif // CORE_GET_H_
http://git-wip-us.apache.org/repos/asf/hbase/blob/3c81072b/hbase-native-client/src/core/hbase_connection_attr.cc
----------------------------------------------------------------------
diff --git a/hbase-native-client/src/core/hbase_connection_attr.cc b/hbase-native-client/src/core/hbase_connection_attr.cc
deleted file mode 100644
index 61940e8..0000000
--- a/hbase-native-client/src/core/hbase_connection_attr.cc
+++ /dev/null
@@ -1,41 +0,0 @@
-/*
- * 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.
- *
- */
-
-#include "core/hbase_connection_attr.h"
-
-#include "core/hbase_macros.h"
-#include "core/hbase_types.h"
-#include "core/connection_attr.h"
-
-extern "C" {
-int32_t hb_connection_attr_create(hb_connection_attr_t * attr_ptr) {
- (*attr_ptr) = new ConnectionAttr();
- return (attr_ptr == NULL)?-1:0;
-}
-
-int32_t hb_connection_attr_set_zk_quorum(hb_connection_t connection,
- char * zk_quorum) {
- return 0;
-}
-
-int32_t hb_connection_attr_set_zk_root(hb_connection_t connection,
- char * zk_root) {
- return 0;
-}
-}
http://git-wip-us.apache.org/repos/asf/hbase/blob/3c81072b/hbase-native-client/src/core/hbase_connection_attr.h
----------------------------------------------------------------------
diff --git a/hbase-native-client/src/core/hbase_connection_attr.h b/hbase-native-client/src/core/hbase_connection_attr.h
deleted file mode 100644
index c73c818..0000000
--- a/hbase-native-client/src/core/hbase_connection_attr.h
+++ /dev/null
@@ -1,51 +0,0 @@
-/*
- * 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.
- *
- */
-
-#ifndef CORE_HBASE_CONNECTION_ATTR_H_
-#define CORE_HBASE_CONNECTION_ATTR_H_
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#include "core/hbase_macros.h"
-#include "core/hbase_types.h"
-
-#include <stdlib.h>
-
-HBASE_API int32_t hb_connection_attr_create(hb_connection_attr_t * attr_ptr);
-
-/**
- * Set the zk quorum of a connection that will be created.
- */
-HBASE_API int32_t hb_connection_attr_set_zk_quorum(hb_connection_t connection,
- char * zk_quorum);
-
-/**
- * Set the zk root of a connection that will be created.
- */
-HBASE_API int32_t hb_connection_attr_set_zk_root(hb_connection_t connection,
- char * zk_root);
-
-#ifdef __cplusplus
-} // extern "C"
-#endif // __cplusplus
-
-#endif // CORE_HBASE_CONNECTION_ATTR_H_
-
http://git-wip-us.apache.org/repos/asf/hbase/blob/3c81072b/hbase-native-client/src/core/hbase_macros.h
----------------------------------------------------------------------
diff --git a/hbase-native-client/src/core/hbase_macros.h b/hbase-native-client/src/core/hbase_macros.h
deleted file mode 100644
index 71765c8..0000000
--- a/hbase-native-client/src/core/hbase_macros.h
+++ /dev/null
@@ -1,60 +0,0 @@
-/*
- * 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.
- *
- */
-
-#ifndef CORE_HBASE_MACROS_H_
-#define CORE_HBASE_MACROS_H_
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/**
- * The following code block define API as the tag for exported
- * functions. The library should be compiled with symbols visibility
- * set to hidden by default and only the exported functions should be
- * tagged as HBASE_API.
- *
- * When building the library on Windows, compile with compiler flag
- * "-D_LIBHBASE_IMPLEMENTATION_", whereas when linking application with
- * this library, this compiler flag should not be used.
- */
-#if defined _WIN32 || defined __CYGWIN__
- #ifdef _LIBHBASE_IMPLEMENTATION_
- #define API __declspec(dllexport)
- #else
- #ifdef _LIBHBASE_TEST_
- #define HBASE_API
- #else
- #define HBASE_API __declspec(dllimport)
- #endif
- #endif
-#else
- #if __GNUC__ >= 4
- #define HBASE_API __attribute__ ((visibility ("default")))
- #else
- #define HBASE_API
- #endif
-#endif
-
-#ifdef __cplusplus
-} // extern "C"
-#endif // __cplusplus
-
-#endif // CORE_HBASE_MACROS_H_
-
http://git-wip-us.apache.org/repos/asf/hbase/blob/3c81072b/hbase-native-client/src/core/hbase_types.h
----------------------------------------------------------------------
diff --git a/hbase-native-client/src/core/hbase_types.h b/hbase-native-client/src/core/hbase_types.h
deleted file mode 100644
index 8889b92..0000000
--- a/hbase-native-client/src/core/hbase_types.h
+++ /dev/null
@@ -1,83 +0,0 @@
-/*
- * 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.
- *
- */
-
-#ifndef CORE_HBASE_TYPES_H_
-#define CORE_HBASE_TYPES_H_
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#include <stdint.h>
-#include <stddef.h>
-
-typedef unsigned char hb_byte_t;
-
-/*
- * Base kv type.
- */
-typedef struct {
- hb_byte_t* row;
- size_t row_length;
-
- char * family;
- size_t family_length;
-
- hb_byte_t* qual;
- size_t qual_length;
-
- hb_byte_t* value;
- size_t value_length;
-
- uint64_t timestamp;
-} hb_cell_t;
-
-typedef enum {
- DELETE_ONE_VERSION,
- DELETE_MULTIPLE_VERSIONS,
- DELETE_FAMILY,
- DELETE_FAMILY_VERSION
-} hb_delete_type;
-
-typedef enum {
- USE_DEFAULT,
- SKIP_WAL,
- ASYNC_WAL,
- SYNC_WAL,
- HSYNC_WAL
-} hb_durability_type;
-
-typedef void* hb_admin_t;
-typedef void* hb_client_t;
-typedef void* hb_connection_attr_t;
-typedef void* hb_connection_t;
-typedef void* hb_get_t;
-typedef void* hb_mutation_t;
-typedef void* hb_put_t;
-typedef void* hb_delete_t;
-typedef void* hb_increment_t;
-typedef void* hb_append_t;
-typedef void* hb_result_t;
-typedef void* hb_scanner_t;
-
-#ifdef __cplusplus
-} // extern "C"
-#endif // __cplusplus
-
-#endif // CORE_HBASE_TYPES_H_
http://git-wip-us.apache.org/repos/asf/hbase/blob/3c81072b/hbase-native-client/src/core/mutation.cc
----------------------------------------------------------------------
diff --git a/hbase-native-client/src/core/mutation.cc b/hbase-native-client/src/core/mutation.cc
deleted file mode 100644
index 4855076..0000000
--- a/hbase-native-client/src/core/mutation.cc
+++ /dev/null
@@ -1,42 +0,0 @@
-/*
- * 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.
- *
- */
-
-#include "core/mutation.h"
-
-void Mutation::set_namespace(char * name_space, size_t name_space_length) {
- this->name_space = name_space;
- this->name_space_length = name_space_length;
-}
-
-void Mutation::set_table(char * table, size_t table_length) {
- this->table = table;
- this->table_length = table_length;
-}
-
-void Mutation::set_row(unsigned char * row, size_t row_length) {
- this->row = row;
- this->row_length = row_length;
-}
-
-void Mutation::set_durability(hb_durability_type durability) {
- this->durability = durability;
-}
-
-Mutation::~Mutation() {
-}
http://git-wip-us.apache.org/repos/asf/hbase/blob/3c81072b/hbase-native-client/src/core/mutation.h
----------------------------------------------------------------------
diff --git a/hbase-native-client/src/core/mutation.h b/hbase-native-client/src/core/mutation.h
deleted file mode 100644
index e35d595..0000000
--- a/hbase-native-client/src/core/mutation.h
+++ /dev/null
@@ -1,48 +0,0 @@
-/*
- * 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.
- *
- */
-
-#ifndef CORE_MUTATION_H_
-#define CORE_MUTATION_H_
-
-#include <stdlib.h>
-
-#include "core/hbase_types.h"
-
-class Mutation {
- char * name_space;
- size_t name_space_length;
-
- char * table;
- size_t table_length;
-
- unsigned char * row;
- size_t row_length;
-
- hb_durability_type durability;
- public:
- void set_namespace(char * name_space, size_t name_space_length);
- void set_table(char * table, size_t table_length);
- void set_row(unsigned char * row, size_t row_length);
- void set_durability(hb_durability_type durability);
-
- virtual ~Mutation();
-};
-#endif // CORE_MUTATION_H_
-
-
http://git-wip-us.apache.org/repos/asf/hbase/blob/3c81072b/hbase-native-client/src/core/put.cc
----------------------------------------------------------------------
diff --git a/hbase-native-client/src/core/put.cc b/hbase-native-client/src/core/put.cc
deleted file mode 100644
index 8bedc8b..0000000
--- a/hbase-native-client/src/core/put.cc
+++ /dev/null
@@ -1,22 +0,0 @@
-/*
- * 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.
- */
-
-#include "core/put.h"
-
-Put::~Put() {
-}
http://git-wip-us.apache.org/repos/asf/hbase/blob/3c81072b/hbase-native-client/src/core/put.h
----------------------------------------------------------------------
diff --git a/hbase-native-client/src/core/put.h b/hbase-native-client/src/core/put.h
deleted file mode 100644
index 7bca3e3..0000000
--- a/hbase-native-client/src/core/put.h
+++ /dev/null
@@ -1,29 +0,0 @@
-/*
- * 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.
- *
- */
-
-#ifndef CORE_PUT_H_
-#define CORE_PUT_H_
-
-#include "core/mutation.h"
-
-class Put: public Mutation {
- public:
- ~Put();
-};
-#endif // CORE_PUT_H_
http://git-wip-us.apache.org/repos/asf/hbase/blob/3c81072b/hbase-native-client/src/core/scanner.cc
----------------------------------------------------------------------
diff --git a/hbase-native-client/src/core/scanner.cc b/hbase-native-client/src/core/scanner.cc
deleted file mode 100644
index a10e444..0000000
--- a/hbase-native-client/src/core/scanner.cc
+++ /dev/null
@@ -1,20 +0,0 @@
-/*
- * 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.
- *
- */
-
-#include "core/scanner.h"
http://git-wip-us.apache.org/repos/asf/hbase/blob/3c81072b/hbase-native-client/src/core/scanner.h
----------------------------------------------------------------------
diff --git a/hbase-native-client/src/core/scanner.h b/hbase-native-client/src/core/scanner.h
deleted file mode 100644
index 257583b..0000000
--- a/hbase-native-client/src/core/scanner.h
+++ /dev/null
@@ -1,25 +0,0 @@
-/*
- * 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.
- *
- */
-
-#ifndef CORE_SCANNER_H_
-#define CORE_SCANNER_H_
-
-class Scanner {
-};
-#endif // CORE_SCANNER_H_
http://git-wip-us.apache.org/repos/asf/hbase/blob/3c81072b/hbase-native-client/src/rpc/CMakeLists.txt
----------------------------------------------------------------------
diff --git a/hbase-native-client/src/rpc/CMakeLists.txt b/hbase-native-client/src/rpc/CMakeLists.txt
deleted file mode 100644
index 2456923..0000000
--- a/hbase-native-client/src/rpc/CMakeLists.txt
+++ /dev/null
@@ -1,17 +0,0 @@
-# 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.
-
http://git-wip-us.apache.org/repos/asf/hbase/blob/3c81072b/hbase-native-client/src/sync/CMakeLists.txt
----------------------------------------------------------------------
diff --git a/hbase-native-client/src/sync/CMakeLists.txt b/hbase-native-client/src/sync/CMakeLists.txt
deleted file mode 100644
index bfb7e6c..0000000
--- a/hbase-native-client/src/sync/CMakeLists.txt
+++ /dev/null
@@ -1,24 +0,0 @@
-# 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.
-
-set( SYNC_SRC
- hbase_connection.cc
- hbase_admin.cc
-)
-
-
-add_library(hsync OBJECT ${SYNC_SRC})
http://git-wip-us.apache.org/repos/asf/hbase/blob/3c81072b/hbase-native-client/src/sync/hbase_admin.cc
----------------------------------------------------------------------
diff --git a/hbase-native-client/src/sync/hbase_admin.cc b/hbase-native-client/src/sync/hbase_admin.cc
deleted file mode 100644
index d43c8ec..0000000
--- a/hbase-native-client/src/sync/hbase_admin.cc
+++ /dev/null
@@ -1,51 +0,0 @@
-/*
- * 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.
- *
- */
-
-#include "sync/hbase_admin.h"
-
-#include <stdlib.h>
-#include <stdbool.h>
-
-#include "core/admin.h"
-
-int32_t hb_admin_create(hb_admin_t** admin_ptr) {
- (*admin_ptr) = reinterpret_cast<hb_admin_t *>(new Admin());
- return 0;
-}
-
-/*
- * Disconnect the admin releasing any internal objects
- * or connections created in the background.
- */
-int32_t hb_admin_destroy(hb_admin_t * admin) {
- Admin * adm = reinterpret_cast<Admin *>(admin);
- delete adm;
- return 0;
-}
-
-/*
- * See if a table exists.
- */
-int32_t hb_admin_table_exists(hb_admin_t * admin,
- char * name_space, size_t name_space_length,
- char * table, size_t table_length,
- bool * exists) {
- *exists = true;
- return 0;
-}
http://git-wip-us.apache.org/repos/asf/hbase/blob/3c81072b/hbase-native-client/src/sync/hbase_admin.h
----------------------------------------------------------------------
diff --git a/hbase-native-client/src/sync/hbase_admin.h b/hbase-native-client/src/sync/hbase_admin.h
deleted file mode 100644
index 860bfba..0000000
--- a/hbase-native-client/src/sync/hbase_admin.h
+++ /dev/null
@@ -1,61 +0,0 @@
-/*
- * 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.
- *
- */
-
-#ifndef SYNC_HBASE_ADMIN_H_
-#define SYNC_HBASE_ADMIN_H_
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#include <stdlib.h>
-#include <stdbool.h>
-
-#include "core/hbase_macros.h"
-#include "core/hbase_types.h"
-#include "sync/hbase_connection.h"
-
-
-/**
- * Create a new hb_admin.
- * All fields are initialized to the defaults. If you want to set
- * connection or other properties, set those before calling any
- * RPC functions.
- */
-HBASE_API int32_t hb_admin_create(hb_admin_t* admin_ptr,
- hb_connection_t connection);
-
-/*
- * Disconnect the admin releasing any internal objects
- * or connections created in the background.
- */
-HBASE_API int32_t hb_admin_destroy(hb_admin_t admin);
-
-/*
- * See if a table exists.
- */
-HBASE_API int32_t hb_admin_table_exists(hb_admin_t admin,
- char * name_space, size_t name_space_length,
- char * table, size_t table_length, bool * exists);
-
-#ifdef __cplusplus
-} // extern "C"
-#endif // __cplusplus
-
-#endif // SYNC_HBASE_ADMIN_H_
http://git-wip-us.apache.org/repos/asf/hbase/blob/3c81072b/hbase-native-client/src/sync/hbase_connection.cc
----------------------------------------------------------------------
diff --git a/hbase-native-client/src/sync/hbase_connection.cc b/hbase-native-client/src/sync/hbase_connection.cc
deleted file mode 100644
index df05376..0000000
--- a/hbase-native-client/src/sync/hbase_connection.cc
+++ /dev/null
@@ -1,37 +0,0 @@
-/*
- * 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.
- *
- */
-
-#include "sync/hbase_connection.h"
-
-#include "core/connection.h"
-#include "core/hbase_types.h"
-
-extern "C" {
-int32_t hb_connection_create(hb_connection_t * connection_ptr,
- hb_connection_attr_t connection_attr) {
- (*connection_ptr) = reinterpret_cast<hb_connection_t>(new Connection());
- if ((*connection_ptr) == NULL)
- return -1;
- return 0;
-}
-int32_t hb_connection_destroy(hb_connection_t connection) {
- free(connection);
- return 0;
-}
-} // extern "C"
http://git-wip-us.apache.org/repos/asf/hbase/blob/3c81072b/hbase-native-client/src/sync/hbase_connection.h
----------------------------------------------------------------------
diff --git a/hbase-native-client/src/sync/hbase_connection.h b/hbase-native-client/src/sync/hbase_connection.h
deleted file mode 100644
index af9284d..0000000
--- a/hbase-native-client/src/sync/hbase_connection.h
+++ /dev/null
@@ -1,52 +0,0 @@
-/*
- * 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.
- *
- */
-
-#ifndef SYNC_HBASE_CONNECTION_H_
-#define SYNC_HBASE_CONNECTION_H_
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#include "core/hbase_macros.h"
-#include "core/hbase_types.h"
-#include "core/hbase_connection_attr.h"
-
-#include <stdlib.h>
-
-/**
- * Create an hb_connection.
- *
- * if connection_attr is null everything will be left as default
- */
-HBASE_API int32_t hb_connection_create(hb_connection_t * connection_ptr,
- hb_connection_attr_t connection_attr);
-
-/**
- * Destroy the connection and free all resources allocated at creation
- * time.
- */
-HBASE_API int32_t hb_connection_destroy(hb_connection_t connection);
-
-#ifdef __cplusplus
-} // extern "C"
-#endif // __cplusplus
-
-#endif // SYNC_HBASE_CONNECTION_H_
-
http://git-wip-us.apache.org/repos/asf/hbase/blob/3c81072b/hbase-native-client/third-party/BUCK
----------------------------------------------------------------------
diff --git a/hbase-native-client/third-party/BUCK b/hbase-native-client/third-party/BUCK
new file mode 100644
index 0000000..89d2c93
--- /dev/null
+++ b/hbase-native-client/third-party/BUCK
@@ -0,0 +1,105 @@
+##
+# 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.
+
+def add_system_libs(names = []):
+ rules = []
+ for name in names:
+ prebuilt_cxx_library(
+ name = name,
+ lib_name = name,
+ lib_dir = "/usr/lib/x86_64-linux-gnu"
+ )
+ rules.append(":" + name)
+
+ return rules
+
+system_libs = [
+ "double-conversion",
+ "glog",
+ "gflags",
+ "unwind",
+ "lzma",
+ "boost_regex",
+]
+tp_dep_rules = add_system_libs(system_libs)
+prebuilt_cxx_library(
+ name = "folly",
+ lib_name = "folly",
+ lib_dir = "/usr/local/lib",
+ deps = tp_dep_rules,
+ exported_linker_flags = [
+ "-pthread",
+ "-lstdc++",
+ ],
+ visibility = [
+ 'PUBLIC',
+ ]
+)
+prebuilt_cxx_library(
+ name = "follybenchmark",
+ lib_name = "follybenchmark",
+ lib_dir = "/usr/local/lib",
+ deps = tp_dep_rules + [":folly"],
+ exported_linker_flags = [
+ "-pthread",
+ "-lstdc++",
+ ],
+ visibility = [
+ 'PUBLIC',
+ ]
+)
+prebuilt_cxx_library(
+ name = "wangle",
+ lib_name = "wangle",
+ lib_dir = "/usr/local/lib",
+ deps = tp_dep_rules + [":folly"],
+ exported_linker_flags = [
+ "-pthread",
+ "-lstdc++",
+ ],
+ visibility = [
+ 'PUBLIC',
+ ]
+)
+cxx_library(
+ name = 'google-test',
+ srcs = [
+ 'googletest/googletest/src/gtest-all.cc',
+ 'googletest/googlemock/src/gmock-all.cc',
+ 'googletest/googlemock/src/gmock_main.cc',
+ ],
+ header_namespace = '',
+ exported_headers = subdir_glob([
+ ('googletest/googletest/include', '**/*.h'),
+ ('googletest/googlemock/include', '**/*.h'),
+ ]),
+ headers = subdir_glob([
+ ('googletest/googletest', 'src/*.h'),
+ ('googletest/googletest', 'src/*.cc'),
+ ('googletest/googlemock', 'src/*.h'),
+ ('googletest/googlemock', 'src/*.cc'),
+ ]),
+ exported_linker_flags = [
+ "-pthread",
+ "-lstdc++",
+ ],
+ visibility = [
+ 'PUBLIC',
+ ],
+ deps = [
+ ]
+)
http://git-wip-us.apache.org/repos/asf/hbase/blob/3c81072b/pom.xml
----------------------------------------------------------------------
diff --git a/pom.xml b/pom.xml
index 450275c..046d6c2 100644
--- a/pom.xml
+++ b/pom.xml
@@ -812,6 +812,10 @@
<exclude>**/CHANGES.txt</exclude>
<exclude>**/generated/**</exclude>
<exclude>**/gen-*/**</exclude>
+ <!-- native build leftovers -->
+ <exclude>**/buck-out/**</exclude>
+ <exclude>**/.buckd/**</exclude>
+ <exclude>hbase-native-client/third-party/**</exclude>
<!-- No material contents -->
<exclude>conf/regionservers</exclude>
<exclude>**/*.avpr</exclude>
[7/8] hbase git commit: HBASE-14853 Add on protobuf to c++ chain
Posted by ec...@apache.org.
http://git-wip-us.apache.org/repos/asf/hbase/blob/967f0910/hbase-native-client/if/Master.proto
----------------------------------------------------------------------
diff --git a/hbase-native-client/if/Master.proto b/hbase-native-client/if/Master.proto
new file mode 100644
index 0000000..4d3a2e1
--- /dev/null
+++ b/hbase-native-client/if/Master.proto
@@ -0,0 +1,778 @@
+/**
+ * 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.
+ */
+
+// All to do with the Master. Includes schema management since these
+// changes are run by the Master process.
+package hbase.pb;
+
+option java_package = "org.apache.hadoop.hbase.protobuf.generated";
+option java_outer_classname = "MasterProtos";
+option java_generic_services = true;
+option java_generate_equals_and_hash = true;
+option optimize_for = SPEED;
+
+import "HBase.proto";
+import "Client.proto";
+import "ClusterStatus.proto";
+import "ErrorHandling.proto";
+import "Procedure.proto";
+import "Quota.proto";
+
+/* Column-level protobufs */
+
+message AddColumnRequest {
+ required TableName table_name = 1;
+ required ColumnFamilySchema column_families = 2;
+ optional uint64 nonce_group = 3 [default = 0];
+ optional uint64 nonce = 4 [default = 0];
+}
+
+message AddColumnResponse {
+ optional uint64 proc_id = 1;
+}
+
+message DeleteColumnRequest {
+ required TableName table_name = 1;
+ required bytes column_name = 2;
+ optional uint64 nonce_group = 3 [default = 0];
+ optional uint64 nonce = 4 [default = 0];
+}
+
+message DeleteColumnResponse {
+ optional uint64 proc_id = 1;
+}
+
+message ModifyColumnRequest {
+ required TableName table_name = 1;
+ required ColumnFamilySchema column_families = 2;
+ optional uint64 nonce_group = 3 [default = 0];
+ optional uint64 nonce = 4 [default = 0];
+}
+
+message ModifyColumnResponse {
+ optional uint64 proc_id = 1;
+}
+
+/* Region-level Protos */
+
+message MoveRegionRequest {
+ required RegionSpecifier region = 1;
+ optional ServerName dest_server_name = 2;
+}
+
+message MoveRegionResponse {
+}
+
+/**
+ * Dispatch merging the specified regions.
+ */
+message DispatchMergingRegionsRequest {
+ required RegionSpecifier region_a = 1;
+ required RegionSpecifier region_b = 2;
+ optional bool forcible = 3 [default = false];
+}
+
+message DispatchMergingRegionsResponse {
+}
+
+message AssignRegionRequest {
+ required RegionSpecifier region = 1;
+}
+
+message AssignRegionResponse {
+}
+
+message UnassignRegionRequest {
+ required RegionSpecifier region = 1;
+ optional bool force = 2 [default = false];
+}
+
+message UnassignRegionResponse {
+}
+
+message OfflineRegionRequest {
+ required RegionSpecifier region = 1;
+}
+
+message OfflineRegionResponse {
+}
+
+/* Table-level protobufs */
+
+message CreateTableRequest {
+ required TableSchema table_schema = 1;
+ repeated bytes split_keys = 2;
+ optional uint64 nonce_group = 3 [default = 0];
+ optional uint64 nonce = 4 [default = 0];
+}
+
+message CreateTableResponse {
+ optional uint64 proc_id = 1;
+}
+
+message DeleteTableRequest {
+ required TableName table_name = 1;
+ optional uint64 nonce_group = 2 [default = 0];
+ optional uint64 nonce = 3 [default = 0];
+}
+
+message DeleteTableResponse {
+ optional uint64 proc_id = 1;
+}
+
+message TruncateTableRequest {
+ required TableName tableName = 1;
+ optional bool preserveSplits = 2 [default = false];
+ optional uint64 nonce_group = 3 [default = 0];
+ optional uint64 nonce = 4 [default = 0];
+}
+
+message TruncateTableResponse {
+ optional uint64 proc_id = 1;
+}
+
+message EnableTableRequest {
+ required TableName table_name = 1;
+ optional uint64 nonce_group = 2 [default = 0];
+ optional uint64 nonce = 3 [default = 0];
+}
+
+message EnableTableResponse {
+ optional uint64 proc_id = 1;
+}
+
+message DisableTableRequest {
+ required TableName table_name = 1;
+ optional uint64 nonce_group = 2 [default = 0];
+ optional uint64 nonce = 3 [default = 0];
+}
+
+message DisableTableResponse {
+ optional uint64 proc_id = 1;
+}
+
+message ModifyTableRequest {
+ required TableName table_name = 1;
+ required TableSchema table_schema = 2;
+ optional uint64 nonce_group = 3 [default = 0];
+ optional uint64 nonce = 4 [default = 0];
+}
+
+message ModifyTableResponse {
+ optional uint64 proc_id = 1;
+}
+
+/* Namespace-level protobufs */
+
+message CreateNamespaceRequest {
+ required NamespaceDescriptor namespaceDescriptor = 1;
+ optional uint64 nonce_group = 2 [default = 0];
+ optional uint64 nonce = 3 [default = 0];
+}
+
+message CreateNamespaceResponse {
+}
+
+message DeleteNamespaceRequest {
+ required string namespaceName = 1;
+ optional uint64 nonce_group = 2 [default = 0];
+ optional uint64 nonce = 3 [default = 0];
+}
+
+message DeleteNamespaceResponse {
+}
+
+message ModifyNamespaceRequest {
+ required NamespaceDescriptor namespaceDescriptor = 1;
+ optional uint64 nonce_group = 2 [default = 0];
+ optional uint64 nonce = 3 [default = 0];
+}
+
+message ModifyNamespaceResponse {
+}
+
+message GetNamespaceDescriptorRequest {
+ required string namespaceName = 1;
+}
+
+message GetNamespaceDescriptorResponse {
+ required NamespaceDescriptor namespaceDescriptor = 1;
+}
+
+message ListNamespaceDescriptorsRequest {
+}
+
+message ListNamespaceDescriptorsResponse {
+ repeated NamespaceDescriptor namespaceDescriptor = 1;
+}
+
+message ListTableDescriptorsByNamespaceRequest {
+ required string namespaceName = 1;
+}
+
+message ListTableDescriptorsByNamespaceResponse {
+ repeated TableSchema tableSchema = 1;
+}
+
+message ListTableNamesByNamespaceRequest {
+ required string namespaceName = 1;
+}
+
+message ListTableNamesByNamespaceResponse {
+ repeated TableName tableName = 1;
+}
+
+/* Cluster-level protobufs */
+
+
+message ShutdownRequest {
+}
+
+message ShutdownResponse {
+}
+
+message StopMasterRequest {
+}
+
+message StopMasterResponse {
+}
+
+message BalanceRequest {
+ optional bool force = 1;
+}
+
+message BalanceResponse {
+ required bool balancer_ran = 1;
+}
+
+message SetBalancerRunningRequest {
+ required bool on = 1;
+ optional bool synchronous = 2;
+}
+
+message SetBalancerRunningResponse {
+ optional bool prev_balance_value = 1;
+}
+
+message IsBalancerEnabledRequest {
+}
+
+message IsBalancerEnabledResponse {
+ required bool enabled = 1;
+}
+
+message NormalizeRequest {
+}
+
+message NormalizeResponse {
+ required bool normalizer_ran = 1;
+}
+
+message SetNormalizerRunningRequest {
+ required bool on = 1;
+}
+
+message SetNormalizerRunningResponse {
+ optional bool prev_normalizer_value = 1;
+}
+
+message IsNormalizerEnabledRequest {
+}
+
+message IsNormalizerEnabledResponse {
+ required bool enabled = 1;
+}
+
+message RunCatalogScanRequest {
+}
+
+message RunCatalogScanResponse {
+ optional int32 scan_result = 1;
+}
+
+message EnableCatalogJanitorRequest {
+ required bool enable = 1;
+}
+
+message EnableCatalogJanitorResponse {
+ optional bool prev_value = 1;
+}
+
+message IsCatalogJanitorEnabledRequest {
+}
+
+message IsCatalogJanitorEnabledResponse {
+ required bool value = 1;
+}
+
+message SnapshotRequest {
+ required SnapshotDescription snapshot = 1;
+}
+
+message SnapshotResponse {
+ required int64 expected_timeout = 1;
+}
+
+message GetCompletedSnapshotsRequest {
+}
+
+message GetCompletedSnapshotsResponse {
+ repeated SnapshotDescription snapshots = 1;
+}
+
+message DeleteSnapshotRequest {
+ required SnapshotDescription snapshot = 1;
+}
+
+message DeleteSnapshotResponse {
+}
+
+message RestoreSnapshotRequest {
+ required SnapshotDescription snapshot = 1;
+}
+
+message RestoreSnapshotResponse {
+}
+
+/* if you don't send the snapshot, then you will get it back
+ * in the response (if the snapshot is done) so you can check the snapshot
+ */
+message IsSnapshotDoneRequest {
+ optional SnapshotDescription snapshot = 1;
+}
+
+message IsSnapshotDoneResponse {
+ optional bool done = 1 [default = false];
+ optional SnapshotDescription snapshot = 2;
+}
+
+message IsRestoreSnapshotDoneRequest {
+ optional SnapshotDescription snapshot = 1;
+}
+
+message IsRestoreSnapshotDoneResponse {
+ optional bool done = 1 [default = false];
+}
+
+message GetSchemaAlterStatusRequest {
+ required TableName table_name = 1;
+}
+
+message GetSchemaAlterStatusResponse {
+ optional uint32 yet_to_update_regions = 1;
+ optional uint32 total_regions = 2;
+}
+
+message GetTableDescriptorsRequest {
+ repeated TableName table_names = 1;
+ optional string regex = 2;
+ optional bool include_sys_tables = 3 [default=false];
+ optional string namespace = 4;
+}
+
+message GetTableDescriptorsResponse {
+ repeated TableSchema table_schema = 1;
+}
+
+message GetTableNamesRequest {
+ optional string regex = 1;
+ optional bool include_sys_tables = 2 [default=false];
+ optional string namespace = 3;
+}
+
+message GetTableNamesResponse {
+ repeated TableName table_names = 1;
+}
+
+message GetTableStateRequest {
+ required TableName table_name = 1;
+}
+
+message GetTableStateResponse {
+ required TableState table_state = 1;
+}
+
+message GetClusterStatusRequest {
+}
+
+message GetClusterStatusResponse {
+ required ClusterStatus cluster_status = 1;
+}
+
+message IsMasterRunningRequest {
+}
+
+message IsMasterRunningResponse {
+ required bool is_master_running = 1;
+}
+
+message ExecProcedureRequest {
+ required ProcedureDescription procedure = 1;
+}
+
+message ExecProcedureResponse {
+ optional int64 expected_timeout = 1;
+ optional bytes return_data = 2;
+}
+
+message IsProcedureDoneRequest {
+ optional ProcedureDescription procedure = 1;
+}
+
+message IsProcedureDoneResponse {
+ optional bool done = 1 [default = false];
+ optional ProcedureDescription snapshot = 2;
+}
+
+message GetProcedureResultRequest {
+ required uint64 proc_id = 1;
+}
+
+message GetProcedureResultResponse {
+ enum State {
+ NOT_FOUND = 0;
+ RUNNING = 1;
+ FINISHED = 2;
+ }
+
+ required State state = 1;
+ optional uint64 start_time = 2;
+ optional uint64 last_update = 3;
+ optional bytes result = 4;
+ optional ForeignExceptionMessage exception = 5;
+}
+
+message AbortProcedureRequest {
+ required uint64 proc_id = 1;
+ optional bool mayInterruptIfRunning = 2 [default = true];
+}
+
+message AbortProcedureResponse {
+ required bool is_procedure_aborted = 1;
+}
+
+message ListProceduresRequest {
+}
+
+message ListProceduresResponse {
+ repeated Procedure procedure = 1;
+}
+
+message SetQuotaRequest {
+ optional string user_name = 1;
+ optional string user_group = 2;
+ optional string namespace = 3;
+ optional TableName table_name = 4;
+
+ optional bool remove_all = 5;
+ optional bool bypass_globals = 6;
+ optional ThrottleRequest throttle = 7;
+}
+
+message SetQuotaResponse {
+}
+
+message MajorCompactionTimestampRequest {
+ required TableName table_name = 1;
+}
+
+message MajorCompactionTimestampForRegionRequest {
+ required RegionSpecifier region = 1;
+}
+
+message MajorCompactionTimestampResponse {
+ required int64 compaction_timestamp = 1;
+}
+
+message SecurityCapabilitiesRequest {
+}
+
+message SecurityCapabilitiesResponse {
+ enum Capability {
+ SIMPLE_AUTHENTICATION = 0;
+ SECURE_AUTHENTICATION = 1;
+ AUTHORIZATION = 2;
+ CELL_AUTHORIZATION = 3;
+ CELL_VISIBILITY = 4;
+ }
+
+ repeated Capability capabilities = 1;
+}
+
+service MasterService {
+ /** Used by the client to get the number of regions that have received the updated schema */
+ rpc GetSchemaAlterStatus(GetSchemaAlterStatusRequest)
+ returns(GetSchemaAlterStatusResponse);
+
+ /** Get list of TableDescriptors for requested tables. */
+ rpc GetTableDescriptors(GetTableDescriptorsRequest)
+ returns(GetTableDescriptorsResponse);
+
+ /** Get the list of table names. */
+ rpc GetTableNames(GetTableNamesRequest)
+ returns(GetTableNamesResponse);
+
+ /** Return cluster status. */
+ rpc GetClusterStatus(GetClusterStatusRequest)
+ returns(GetClusterStatusResponse);
+
+ /** return true if master is available */
+ rpc IsMasterRunning(IsMasterRunningRequest) returns(IsMasterRunningResponse);
+
+ /** Adds a column to the specified table. */
+ rpc AddColumn(AddColumnRequest)
+ returns(AddColumnResponse);
+
+ /** Deletes a column from the specified table. Table must be disabled. */
+ rpc DeleteColumn(DeleteColumnRequest)
+ returns(DeleteColumnResponse);
+
+ /** Modifies an existing column on the specified table. */
+ rpc ModifyColumn(ModifyColumnRequest)
+ returns(ModifyColumnResponse);
+
+ /** Move the region region to the destination server. */
+ rpc MoveRegion(MoveRegionRequest)
+ returns(MoveRegionResponse);
+
+ /** Master dispatch merging the regions */
+ rpc DispatchMergingRegions(DispatchMergingRegionsRequest)
+ returns(DispatchMergingRegionsResponse);
+
+ /** Assign a region to a server chosen at random. */
+ rpc AssignRegion(AssignRegionRequest)
+ returns(AssignRegionResponse);
+
+ /**
+ * Unassign a region from current hosting regionserver. Region will then be
+ * assigned to a regionserver chosen at random. Region could be reassigned
+ * back to the same server. Use MoveRegion if you want
+ * to control the region movement.
+ */
+ rpc UnassignRegion(UnassignRegionRequest)
+ returns(UnassignRegionResponse);
+
+ /**
+ * Offline a region from the assignment manager's in-memory state. The
+ * region should be in a closed state and there will be no attempt to
+ * automatically reassign the region as in unassign. This is a special
+ * method, and should only be used by experts or hbck.
+ */
+ rpc OfflineRegion(OfflineRegionRequest)
+ returns(OfflineRegionResponse);
+
+ /** Deletes a table */
+ rpc DeleteTable(DeleteTableRequest)
+ returns(DeleteTableResponse);
+
+ /** Truncate a table */
+ rpc truncateTable(TruncateTableRequest)
+ returns(TruncateTableResponse);
+
+ /** Puts the table on-line (only needed if table has been previously taken offline) */
+ rpc EnableTable(EnableTableRequest)
+ returns(EnableTableResponse);
+
+ /** Take table offline */
+ rpc DisableTable(DisableTableRequest)
+ returns(DisableTableResponse);
+
+ /** Modify a table's metadata */
+ rpc ModifyTable(ModifyTableRequest)
+ returns(ModifyTableResponse);
+
+ /** Creates a new table asynchronously */
+ rpc CreateTable(CreateTableRequest)
+ returns(CreateTableResponse);
+
+ /** Shutdown an HBase cluster. */
+ rpc Shutdown(ShutdownRequest)
+ returns(ShutdownResponse);
+
+ /** Stop HBase Master only. Does not shutdown the cluster. */
+ rpc StopMaster(StopMasterRequest)
+ returns(StopMasterResponse);
+
+ /**
+ * Run the balancer. Will run the balancer and if regions to move, it will
+ * go ahead and do the reassignments. Can NOT run for various reasons.
+ * Check logs.
+ */
+ rpc Balance(BalanceRequest)
+ returns(BalanceResponse);
+
+ /**
+ * Turn the load balancer on or off.
+ * If synchronous is true, it waits until current balance() call, if outstanding, to return.
+ */
+ rpc SetBalancerRunning(SetBalancerRunningRequest)
+ returns(SetBalancerRunningResponse);
+
+ /**
+ * Query whether the Region Balancer is running.
+ */
+ rpc IsBalancerEnabled(IsBalancerEnabledRequest)
+ returns(IsBalancerEnabledResponse);
+
+ /**
+ * Run region normalizer. Can NOT run for various reasons. Check logs.
+ */
+ rpc Normalize(NormalizeRequest)
+ returns(NormalizeResponse);
+
+ /**
+ * Turn region normalizer on or off.
+ */
+ rpc SetNormalizerRunning(SetNormalizerRunningRequest)
+ returns(SetNormalizerRunningResponse);
+
+ /**
+ * Query whether region normalizer is enabled.
+ */
+ rpc IsNormalizerEnabled(IsNormalizerEnabledRequest)
+ returns(IsNormalizerEnabledResponse);
+
+ /** Get a run of the catalog janitor */
+ rpc RunCatalogScan(RunCatalogScanRequest)
+ returns(RunCatalogScanResponse);
+
+ /**
+ * Enable the catalog janitor on or off.
+ */
+ rpc EnableCatalogJanitor(EnableCatalogJanitorRequest)
+ returns(EnableCatalogJanitorResponse);
+
+ /**
+ * Query whether the catalog janitor is enabled.
+ */
+ rpc IsCatalogJanitorEnabled(IsCatalogJanitorEnabledRequest)
+ returns(IsCatalogJanitorEnabledResponse);
+
+ /**
+ * Call a master coprocessor endpoint
+ */
+ rpc ExecMasterService(CoprocessorServiceRequest)
+ returns(CoprocessorServiceResponse);
+
+ /**
+ * Create a snapshot for the given table.
+ */
+ rpc Snapshot(SnapshotRequest) returns(SnapshotResponse);
+
+ /**
+ * Get completed snapshots.
+ * Returns a list of snapshot descriptors for completed snapshots
+ */
+ rpc GetCompletedSnapshots(GetCompletedSnapshotsRequest) returns(GetCompletedSnapshotsResponse);
+
+ /**
+ * Delete an existing snapshot. This method can also be used to clean up an aborted snapshot.
+ */
+ rpc DeleteSnapshot(DeleteSnapshotRequest) returns(DeleteSnapshotResponse);
+
+ /**
+ * Determine if the snapshot is done yet.
+ */
+ rpc IsSnapshotDone(IsSnapshotDoneRequest) returns(IsSnapshotDoneResponse);
+
+ /**
+ * Restore a snapshot
+ */
+ rpc RestoreSnapshot(RestoreSnapshotRequest) returns(RestoreSnapshotResponse);
+
+ /**
+ * Determine if the snapshot restore is done yet.
+ */
+ rpc IsRestoreSnapshotDone(IsRestoreSnapshotDoneRequest) returns(IsRestoreSnapshotDoneResponse);
+
+ /**
+ * Execute a distributed procedure.
+ */
+ rpc ExecProcedure(ExecProcedureRequest) returns(ExecProcedureResponse);
+
+ /**
+ * Execute a distributed procedure with return data.
+ */
+ rpc ExecProcedureWithRet(ExecProcedureRequest) returns(ExecProcedureResponse);
+
+ /**
+ * Determine if the procedure is done yet.
+ */
+ rpc IsProcedureDone(IsProcedureDoneRequest) returns(IsProcedureDoneResponse);
+
+ /** return true if master is available */
+ /** rpc IsMasterRunning(IsMasterRunningRequest) returns(IsMasterRunningResponse); */
+
+ /** Modify a namespace's metadata */
+ rpc ModifyNamespace(ModifyNamespaceRequest)
+ returns(ModifyNamespaceResponse);
+
+ /** Creates a new namespace synchronously */
+ rpc CreateNamespace(CreateNamespaceRequest)
+ returns(CreateNamespaceResponse);
+
+ /** Deletes namespace synchronously */
+ rpc DeleteNamespace(DeleteNamespaceRequest)
+ returns(DeleteNamespaceResponse);
+
+ /** Get a namespace descriptor by name */
+ rpc GetNamespaceDescriptor(GetNamespaceDescriptorRequest)
+ returns(GetNamespaceDescriptorResponse);
+
+ /** returns a list of namespaces */
+ rpc ListNamespaceDescriptors(ListNamespaceDescriptorsRequest)
+ returns(ListNamespaceDescriptorsResponse);
+
+ /** returns a list of tables for a given namespace*/
+ rpc ListTableDescriptorsByNamespace(ListTableDescriptorsByNamespaceRequest)
+ returns(ListTableDescriptorsByNamespaceResponse);
+
+ /** returns a list of tables for a given namespace*/
+ rpc ListTableNamesByNamespace(ListTableNamesByNamespaceRequest)
+ returns(ListTableNamesByNamespaceResponse);
+
+ /** returns table state */
+ rpc GetTableState(GetTableStateRequest)
+ returns(GetTableStateResponse);
+
+ /** Apply the new quota settings */
+ rpc SetQuota(SetQuotaRequest) returns(SetQuotaResponse);
+
+ /** Returns the timestamp of the last major compaction */
+ rpc getLastMajorCompactionTimestamp(MajorCompactionTimestampRequest)
+ returns(MajorCompactionTimestampResponse);
+
+ /** Returns the timestamp of the last major compaction */
+ rpc getLastMajorCompactionTimestampForRegion(MajorCompactionTimestampForRegionRequest)
+ returns(MajorCompactionTimestampResponse);
+
+ rpc getProcedureResult(GetProcedureResultRequest)
+ returns(GetProcedureResultResponse);
+
+ /** Returns the security capabilities in effect on the cluster */
+ rpc getSecurityCapabilities(SecurityCapabilitiesRequest)
+ returns(SecurityCapabilitiesResponse);
+
+ /** Abort a procedure */
+ rpc AbortProcedure(AbortProcedureRequest)
+ returns(AbortProcedureResponse);
+
+ /** returns a list of procedures */
+ rpc ListProcedures(ListProceduresRequest)
+ returns(ListProceduresResponse);
+}
http://git-wip-us.apache.org/repos/asf/hbase/blob/967f0910/hbase-native-client/if/MasterProcedure.proto
----------------------------------------------------------------------
diff --git a/hbase-native-client/if/MasterProcedure.proto b/hbase-native-client/if/MasterProcedure.proto
new file mode 100644
index 0000000..2d2aff4
--- /dev/null
+++ b/hbase-native-client/if/MasterProcedure.proto
@@ -0,0 +1,245 @@
+/**
+ * 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.
+ */
+package hbase.pb;
+
+option java_package = "org.apache.hadoop.hbase.protobuf.generated";
+option java_outer_classname = "MasterProcedureProtos";
+option java_generic_services = true;
+option java_generate_equals_and_hash = true;
+option optimize_for = SPEED;
+
+import "HBase.proto";
+import "RPC.proto";
+
+// ============================================================================
+// WARNING - Compatibility rules
+// ============================================================================
+// This .proto contains the data serialized by the master procedures.
+// Each procedure has some state stored to know, which step were executed
+// and what were the parameters or data created by the previous steps.
+// new code should be able to handle the old format or at least fail cleanly
+// triggering a rollback/cleanup.
+//
+// Procedures that are inheriting from a StateMachineProcedure have an enum:
+// - Do not change the number of the 'State' enums.
+// doing so, will cause executing the wrong 'step' on the pending
+// procedures when they will be replayed.
+// - Do not remove items from the enum, new code must be able to handle
+// all the previous 'steps'. There may be pending procedure ready to be
+// recovered replayed. alternative you can make sure that not-known state
+// will result in a failure that will rollback the already executed steps.
+// ============================================================================
+
+enum CreateTableState {
+ CREATE_TABLE_PRE_OPERATION = 1;
+ CREATE_TABLE_WRITE_FS_LAYOUT = 2;
+ CREATE_TABLE_ADD_TO_META = 3;
+ CREATE_TABLE_ASSIGN_REGIONS = 4;
+ CREATE_TABLE_UPDATE_DESC_CACHE = 5;
+ CREATE_TABLE_POST_OPERATION = 6;
+}
+
+message CreateTableStateData {
+ required UserInformation user_info = 1;
+ required TableSchema table_schema = 2;
+ repeated RegionInfo region_info = 3;
+}
+
+enum ModifyTableState {
+ MODIFY_TABLE_PREPARE = 1;
+ MODIFY_TABLE_PRE_OPERATION = 2;
+ MODIFY_TABLE_UPDATE_TABLE_DESCRIPTOR = 3;
+ MODIFY_TABLE_REMOVE_REPLICA_COLUMN = 4;
+ MODIFY_TABLE_DELETE_FS_LAYOUT = 5;
+ MODIFY_TABLE_POST_OPERATION = 6;
+ MODIFY_TABLE_REOPEN_ALL_REGIONS = 7;
+}
+
+message ModifyTableStateData {
+ required UserInformation user_info = 1;
+ optional TableSchema unmodified_table_schema = 2;
+ required TableSchema modified_table_schema = 3;
+ required bool delete_column_family_in_modify = 4;
+}
+
+enum TruncateTableState {
+ TRUNCATE_TABLE_PRE_OPERATION = 1;
+ TRUNCATE_TABLE_REMOVE_FROM_META = 2;
+ TRUNCATE_TABLE_CLEAR_FS_LAYOUT = 3;
+ TRUNCATE_TABLE_CREATE_FS_LAYOUT = 4;
+ TRUNCATE_TABLE_ADD_TO_META = 5;
+ TRUNCATE_TABLE_ASSIGN_REGIONS = 6;
+ TRUNCATE_TABLE_POST_OPERATION = 7;
+}
+
+message TruncateTableStateData {
+ required UserInformation user_info = 1;
+ required bool preserve_splits = 2;
+ optional TableName table_name = 3;
+ optional TableSchema table_schema = 4;
+ repeated RegionInfo region_info = 5;
+}
+
+enum DeleteTableState {
+ DELETE_TABLE_PRE_OPERATION = 1;
+ DELETE_TABLE_REMOVE_FROM_META = 2;
+ DELETE_TABLE_CLEAR_FS_LAYOUT = 3;
+ DELETE_TABLE_UPDATE_DESC_CACHE = 4;
+ DELETE_TABLE_UNASSIGN_REGIONS = 5;
+ DELETE_TABLE_POST_OPERATION = 6;
+}
+
+message DeleteTableStateData {
+ required UserInformation user_info = 1;
+ required TableName table_name = 2;
+ repeated RegionInfo region_info = 3;
+}
+
+enum CreateNamespaceState {
+ CREATE_NAMESPACE_PREPARE = 1;
+ CREATE_NAMESPACE_CREATE_DIRECTORY = 2;
+ CREATE_NAMESPACE_INSERT_INTO_NS_TABLE = 3;
+ CREATE_NAMESPACE_UPDATE_ZK = 4;
+ CREATE_NAMESPACE_SET_NAMESPACE_QUOTA = 5;
+}
+
+message CreateNamespaceStateData {
+ required NamespaceDescriptor namespace_descriptor = 1;
+}
+
+enum ModifyNamespaceState {
+ MODIFY_NAMESPACE_PREPARE = 1;
+ MODIFY_NAMESPACE_UPDATE_NS_TABLE = 2;
+ MODIFY_NAMESPACE_UPDATE_ZK = 3;
+}
+
+message ModifyNamespaceStateData {
+ required NamespaceDescriptor namespace_descriptor = 1;
+ optional NamespaceDescriptor unmodified_namespace_descriptor = 2;
+}
+
+enum DeleteNamespaceState {
+ DELETE_NAMESPACE_PREPARE = 1;
+ DELETE_NAMESPACE_DELETE_FROM_NS_TABLE = 2;
+ DELETE_NAMESPACE_REMOVE_FROM_ZK = 3;
+ DELETE_NAMESPACE_DELETE_DIRECTORIES = 4;
+ DELETE_NAMESPACE_REMOVE_NAMESPACE_QUOTA = 5;
+}
+
+message DeleteNamespaceStateData {
+ required string namespace_name = 1;
+ optional NamespaceDescriptor namespace_descriptor = 2;
+}
+
+enum AddColumnFamilyState {
+ ADD_COLUMN_FAMILY_PREPARE = 1;
+ ADD_COLUMN_FAMILY_PRE_OPERATION = 2;
+ ADD_COLUMN_FAMILY_UPDATE_TABLE_DESCRIPTOR = 3;
+ ADD_COLUMN_FAMILY_POST_OPERATION = 4;
+ ADD_COLUMN_FAMILY_REOPEN_ALL_REGIONS = 5;
+}
+
+message AddColumnFamilyStateData {
+ required UserInformation user_info = 1;
+ required TableName table_name = 2;
+ required ColumnFamilySchema columnfamily_schema = 3;
+ optional TableSchema unmodified_table_schema = 4;
+}
+
+enum ModifyColumnFamilyState {
+ MODIFY_COLUMN_FAMILY_PREPARE = 1;
+ MODIFY_COLUMN_FAMILY_PRE_OPERATION = 2;
+ MODIFY_COLUMN_FAMILY_UPDATE_TABLE_DESCRIPTOR = 3;
+ MODIFY_COLUMN_FAMILY_POST_OPERATION = 4;
+ MODIFY_COLUMN_FAMILY_REOPEN_ALL_REGIONS = 5;
+}
+
+message ModifyColumnFamilyStateData {
+ required UserInformation user_info = 1;
+ required TableName table_name = 2;
+ required ColumnFamilySchema columnfamily_schema = 3;
+ optional TableSchema unmodified_table_schema = 4;
+}
+
+enum DeleteColumnFamilyState {
+ DELETE_COLUMN_FAMILY_PREPARE = 1;
+ DELETE_COLUMN_FAMILY_PRE_OPERATION = 2;
+ DELETE_COLUMN_FAMILY_UPDATE_TABLE_DESCRIPTOR = 3;
+ DELETE_COLUMN_FAMILY_DELETE_FS_LAYOUT = 4;
+ DELETE_COLUMN_FAMILY_POST_OPERATION = 5;
+ DELETE_COLUMN_FAMILY_REOPEN_ALL_REGIONS = 6;
+}
+
+message DeleteColumnFamilyStateData {
+ required UserInformation user_info = 1;
+ required TableName table_name = 2;
+ required bytes columnfamily_name = 3;
+ optional TableSchema unmodified_table_schema = 4;
+}
+
+enum EnableTableState {
+ ENABLE_TABLE_PREPARE = 1;
+ ENABLE_TABLE_PRE_OPERATION = 2;
+ ENABLE_TABLE_SET_ENABLING_TABLE_STATE = 3;
+ ENABLE_TABLE_MARK_REGIONS_ONLINE = 4;
+ ENABLE_TABLE_SET_ENABLED_TABLE_STATE = 5;
+ ENABLE_TABLE_POST_OPERATION = 6;
+}
+
+message EnableTableStateData {
+ required UserInformation user_info = 1;
+ required TableName table_name = 2;
+ required bool skip_table_state_check = 3;
+}
+
+enum DisableTableState {
+ DISABLE_TABLE_PREPARE = 1;
+ DISABLE_TABLE_PRE_OPERATION = 2;
+ DISABLE_TABLE_SET_DISABLING_TABLE_STATE = 3;
+ DISABLE_TABLE_MARK_REGIONS_OFFLINE = 4;
+ DISABLE_TABLE_SET_DISABLED_TABLE_STATE = 5;
+ DISABLE_TABLE_POST_OPERATION = 6;
+}
+
+message DisableTableStateData {
+ required UserInformation user_info = 1;
+ required TableName table_name = 2;
+ required bool skip_table_state_check = 3;
+}
+
+message ServerCrashStateData {
+ required ServerName server_name = 1;
+ optional bool distributed_log_replay = 2;
+ repeated RegionInfo regions_on_crashed_server = 3;
+ repeated RegionInfo regions_assigned = 4;
+ optional bool carrying_meta = 5;
+ optional bool should_split_wal = 6 [default = true];
+}
+
+enum ServerCrashState {
+ SERVER_CRASH_START = 1;
+ SERVER_CRASH_PROCESS_META = 2;
+ SERVER_CRASH_GET_REGIONS = 3;
+ SERVER_CRASH_NO_SPLIT_LOGS = 4;
+ SERVER_CRASH_SPLIT_LOGS = 5;
+ SERVER_CRASH_PREPARE_LOG_REPLAY = 6;
+ // Removed SERVER_CRASH_CALC_REGIONS_TO_ASSIGN = 7;
+ SERVER_CRASH_ASSIGN = 8;
+ SERVER_CRASH_WAIT_ON_ASSIGN = 9;
+ SERVER_CRASH_FINISH = 100;
+}
http://git-wip-us.apache.org/repos/asf/hbase/blob/967f0910/hbase-native-client/if/MultiRowMutation.proto
----------------------------------------------------------------------
diff --git a/hbase-native-client/if/MultiRowMutation.proto b/hbase-native-client/if/MultiRowMutation.proto
new file mode 100644
index 0000000..747afac
--- /dev/null
+++ b/hbase-native-client/if/MultiRowMutation.proto
@@ -0,0 +1,45 @@
+/**
+ * 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.
+ */
+package hbase.pb;
+
+import "Client.proto";
+option java_package = "org.apache.hadoop.hbase.protobuf.generated";
+option java_outer_classname = "MultiRowMutationProtos";
+option java_generate_equals_and_hash = true;
+option java_generic_services = true;
+option optimize_for = SPEED;
+
+message MultiRowMutationProcessorRequest{
+}
+
+message MultiRowMutationProcessorResponse{
+}
+
+message MutateRowsRequest {
+ repeated MutationProto mutation_request = 1;
+ optional uint64 nonce_group = 2;
+ optional uint64 nonce = 3;
+}
+
+message MutateRowsResponse {
+}
+
+service MultiRowMutationService {
+ rpc MutateRows(MutateRowsRequest)
+ returns(MutateRowsResponse);
+}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/hbase/blob/967f0910/hbase-native-client/if/Procedure.proto
----------------------------------------------------------------------
diff --git a/hbase-native-client/if/Procedure.proto b/hbase-native-client/if/Procedure.proto
new file mode 100644
index 0000000..55e44a4
--- /dev/null
+++ b/hbase-native-client/if/Procedure.proto
@@ -0,0 +1,119 @@
+/**
+ * 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.
+ */
+package hbase.pb;
+
+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 execution is completed. may need a rollback if failed.
+}
+
+/**
+ * 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
+
+ // Nonce to prevent same procedure submit by multiple times
+ optional uint64 nonce_group = 13 [default = 0];
+ optional uint64 nonce = 14 [default = 0];
+}
+
+/**
+ * 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 {
+ PROCEDURE_WAL_EOF = 1;
+ PROCEDURE_WAL_INIT = 2;
+ PROCEDURE_WAL_INSERT = 3;
+ PROCEDURE_WAL_UPDATE = 4;
+ PROCEDURE_WAL_DELETE = 5;
+ PROCEDURE_WAL_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/967f0910/hbase-native-client/if/Quota.proto
----------------------------------------------------------------------
diff --git a/hbase-native-client/if/Quota.proto b/hbase-native-client/if/Quota.proto
new file mode 100644
index 0000000..a8303b1
--- /dev/null
+++ b/hbase-native-client/if/Quota.proto
@@ -0,0 +1,76 @@
+ /**
+ * 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.
+ */
+
+package hbase.pb;
+
+option java_package = "org.apache.hadoop.hbase.protobuf.generated";
+option java_outer_classname = "QuotaProtos";
+option java_generic_services = true;
+option java_generate_equals_and_hash = true;
+option optimize_for = SPEED;
+
+import "HBase.proto";
+
+enum QuotaScope {
+ CLUSTER = 1;
+ MACHINE = 2;
+}
+
+message TimedQuota {
+ required TimeUnit time_unit = 1;
+ optional uint64 soft_limit = 2;
+ optional float share = 3;
+ optional QuotaScope scope = 4 [default = MACHINE];
+}
+
+enum ThrottleType {
+ REQUEST_NUMBER = 1;
+ REQUEST_SIZE = 2;
+ WRITE_NUMBER = 3;
+ WRITE_SIZE = 4;
+ READ_NUMBER = 5;
+ READ_SIZE = 6;
+}
+
+message Throttle {
+ optional TimedQuota req_num = 1;
+ optional TimedQuota req_size = 2;
+
+ optional TimedQuota write_num = 3;
+ optional TimedQuota write_size = 4;
+
+ optional TimedQuota read_num = 5;
+ optional TimedQuota read_size = 6;
+}
+
+message ThrottleRequest {
+ optional ThrottleType type = 1;
+ optional TimedQuota timed_quota = 2;
+}
+
+enum QuotaType {
+ THROTTLE = 1;
+}
+
+message Quotas {
+ optional bool bypass_globals = 1 [default = false];
+ optional Throttle throttle = 2;
+}
+
+message QuotaUsage {
+}
http://git-wip-us.apache.org/repos/asf/hbase/blob/967f0910/hbase-native-client/if/RPC.proto
----------------------------------------------------------------------
diff --git a/hbase-native-client/if/RPC.proto b/hbase-native-client/if/RPC.proto
new file mode 100644
index 0000000..59bb03d
--- /dev/null
+++ b/hbase-native-client/if/RPC.proto
@@ -0,0 +1,136 @@
+/**
+ * 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.
+ */
+package hbase.pb;
+
+import "Tracing.proto";
+import "HBase.proto";
+
+option java_package = "org.apache.hadoop.hbase.protobuf.generated";
+option java_outer_classname = "RPCProtos";
+option java_generate_equals_and_hash = true;
+option optimize_for = SPEED;
+
+// See https://issues.apache.org/jira/browse/HBASE-7898 for high-level
+// description of RPC specification.
+//
+// On connection setup, the client sends six bytes of preamble -- a four
+// byte magic, a byte of version, and a byte of authentication type.
+//
+// We then send a "ConnectionHeader" protobuf of user information and the
+// 'protocol' or 'service' that is to be run over this connection as well as
+// info such as codecs and compression to use when we send cell blocks(see below).
+// This connection header protobuf is prefaced by an int that holds the length
+// of this connection header (this is NOT a varint). The pb connection header
+// is sent with Message#writeTo. The server throws an exception if it doesn't
+// like what it was sent noting what it is objecting too. Otherwise, the server
+// says nothing and is open for business.
+//
+// Hereafter the client makes requests and the server returns responses.
+//
+// Requests look like this:
+//
+// <An int with the total length of the request>
+// <RequestHeader Message written out using Message#writeDelimitedTo>
+// <Optionally a Request Parameter Message written out using Message#writeDelimitedTo>
+// <Optionally a Cell block>
+//
+// ...where the Request Parameter Message is whatever the method name stipulated
+// in the RequestHeader expects; e.g. if the method is a scan, then the pb
+// Request Message is a GetRequest, or a ScanRequest. A block of Cells
+// optionally follows. The presence of a Request param Message and/or a
+// block of Cells will be noted in the RequestHeader.
+//
+// Response is the mirror of the request:
+//
+// <An int with the total length of the response>
+// <ResponseHeader Message written out using Message#writeDelimitedTo>
+// <Optionally a Response Result Message written out using Message#writeDelimitedTo>
+// <Optionally a Cell block>
+//
+// ...where the Response Message is the response type that goes with the
+// method specified when making the request and the follow on Cell blocks may
+// or may not be there -- read the response header to find out if one following.
+// If an exception, it will be included inside the Response Header.
+//
+// Any time we write a pb, we do it with Message#writeDelimitedTo EXCEPT when
+// the connection header is sent; this is prefaced by an int with its length
+// and the pb connection header is then written with Message#writeTo.
+//
+
+// User Information proto. Included in ConnectionHeader on connection setup
+message UserInformation {
+ required string effective_user = 1;
+ optional string real_user = 2;
+}
+
+// This is sent on connection setup after the connection preamble is sent.
+message ConnectionHeader {
+ optional UserInformation user_info = 1;
+ optional string service_name = 2;
+ // Cell block codec we will use sending over optional cell blocks. Server throws exception
+ // if cannot deal. Null means no codec'ing going on so we are pb all the time (SLOW!!!)
+ optional string cell_block_codec_class = 3;
+ // Compressor we will use if cell block is compressed. Server will throw exception if not supported.
+ // Class must implement hadoop's CompressionCodec Interface. Can't compress if no codec.
+ optional string cell_block_compressor_class = 4;
+ optional VersionInfo version_info = 5;
+}
+
+// Optional Cell block Message. Included in client RequestHeader
+message CellBlockMeta {
+ // Length of the following cell block. Could calculate it but convenient having it too hand.
+ optional uint32 length = 1;
+}
+
+// At the RPC layer, this message is used to carry
+// the server side exception to the RPC client.
+message ExceptionResponse {
+ // Class name of the exception thrown from the server
+ optional string exception_class_name = 1;
+ // Exception stack trace from the server side
+ optional string stack_trace = 2;
+ // Optional hostname. Filled in for some exceptions such as region moved
+ // where exception gives clue on where the region may have moved.
+ optional string hostname = 3;
+ optional int32 port = 4;
+ // Set if we are NOT to retry on receipt of this exception
+ optional bool do_not_retry = 5;
+}
+
+// Header sent making a request.
+message RequestHeader {
+ // Monotonically increasing call_id to keep track of RPC requests and their response
+ optional uint32 call_id = 1;
+ optional RPCTInfo trace_info = 2;
+ optional string method_name = 3;
+ // If true, then a pb Message param follows.
+ optional bool request_param = 4;
+ // If present, then an encoded data block follows.
+ optional CellBlockMeta cell_block_meta = 5;
+ // 0 is NORMAL priority. 200 is HIGH. If no priority, treat it as NORMAL.
+ // See HConstants.
+ optional uint32 priority = 6;
+}
+
+message ResponseHeader {
+ optional uint32 call_id = 1;
+ // If present, then request threw an exception and no response message (else we presume one)
+ optional ExceptionResponse exception = 2;
+ // If present, then an encoded data block follows.
+ optional CellBlockMeta cell_block_meta = 3;
+}
http://git-wip-us.apache.org/repos/asf/hbase/blob/967f0910/hbase-native-client/if/RegionNormalizer.proto
----------------------------------------------------------------------
diff --git a/hbase-native-client/if/RegionNormalizer.proto b/hbase-native-client/if/RegionNormalizer.proto
new file mode 100644
index 0000000..e5305d6
--- /dev/null
+++ b/hbase-native-client/if/RegionNormalizer.proto
@@ -0,0 +1,28 @@
+/**
+ * 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.
+ */
+
+// This file contains protocol buffers to represent the state of the load balancer.
+
+option java_package = "org.apache.hadoop.hbase.protobuf.generated";
+option java_outer_classname = "RegionNormalizerProtos";
+option java_generate_equals_and_hash = true;
+option optimize_for = SPEED;
+
+message RegionNormalizerState {
+ optional bool normalizer_on = 1;
+}
http://git-wip-us.apache.org/repos/asf/hbase/blob/967f0910/hbase-native-client/if/RegionServerStatus.proto
----------------------------------------------------------------------
diff --git a/hbase-native-client/if/RegionServerStatus.proto b/hbase-native-client/if/RegionServerStatus.proto
new file mode 100644
index 0000000..fda9de2
--- /dev/null
+++ b/hbase-native-client/if/RegionServerStatus.proto
@@ -0,0 +1,158 @@
+/**
+ * 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.
+ */
+
+// This file contains protocol buffers that are used for RegionServerStatusProtocol.
+package hbase.pb;
+
+option java_package = "org.apache.hadoop.hbase.protobuf.generated";
+option java_outer_classname = "RegionServerStatusProtos";
+option java_generic_services = true;
+option java_generate_equals_and_hash = true;
+option optimize_for = SPEED;
+
+import "HBase.proto";
+import "ClusterStatus.proto";
+
+message RegionServerStartupRequest {
+ /** Port number this regionserver is up on */
+ required uint32 port = 1;
+
+ /** This servers' startcode */
+ required uint64 server_start_code = 2;
+
+ /** Current time of the region server in ms */
+ required uint64 server_current_time = 3;
+
+ /** hostname for region server, optional */
+ optional string use_this_hostname_instead = 4;
+}
+
+message RegionServerStartupResponse {
+ /**
+ * Configuration for the regionserver to use: e.g. filesystem,
+ * hbase rootdir, the hostname to use creating the RegionServer ServerName,
+ * etc
+ */
+ repeated NameStringPair map_entries = 1;
+}
+
+message RegionServerReportRequest {
+ required ServerName server = 1;
+
+ /** load the server is under */
+ optional ServerLoad load = 2;
+}
+
+message RegionServerReportResponse {
+}
+
+message ReportRSFatalErrorRequest {
+ /** name of the server experiencing the error */
+ required ServerName server = 1;
+
+ /** informative text to expose in the master logs and UI */
+ required string error_message = 2;
+}
+
+message ReportRSFatalErrorResponse {
+}
+
+message GetLastFlushedSequenceIdRequest {
+ /** region name */
+ required bytes region_name = 1;
+}
+
+message GetLastFlushedSequenceIdResponse {
+ /** the last WAL sequence id flushed from MemStore to HFile for the region */
+ required uint64 last_flushed_sequence_id = 1;
+
+ /** the last WAL sequence id flushed from MemStore to HFile for stores of the region */
+ repeated StoreSequenceId store_last_flushed_sequence_id = 2;
+}
+
+message RegionStateTransition {
+ required TransitionCode transition_code = 1;
+
+ /** Mutliple regions are involved during merging/splitting */
+ repeated RegionInfo region_info = 2;
+
+ /** For newly opened region, the open seq num is needed */
+ optional uint64 open_seq_num = 3;
+
+ enum TransitionCode {
+ OPENED = 0;
+ FAILED_OPEN = 1;
+ /** No failed_close, in which case region server will abort */
+ CLOSED = 2;
+
+ /** Ask master for ok to split/merge region(s) */
+ READY_TO_SPLIT = 3;
+ READY_TO_MERGE = 4;
+
+ SPLIT_PONR = 5;
+ MERGE_PONR = 6;
+
+ SPLIT = 7;
+ MERGED = 8;
+ SPLIT_REVERTED = 9;
+ MERGE_REVERTED = 10;
+ }
+}
+
+message ReportRegionStateTransitionRequest {
+ /** This region server's server name */
+ required ServerName server = 1;
+
+ repeated RegionStateTransition transition = 2;
+}
+
+message ReportRegionStateTransitionResponse {
+ /** Error message if failed to update the region state */
+ optional string error_message = 1;
+}
+
+service RegionServerStatusService {
+ /** Called when a region server first starts. */
+ rpc RegionServerStartup(RegionServerStartupRequest)
+ returns(RegionServerStartupResponse);
+
+ /** Called to report the load the RegionServer is under. */
+ rpc RegionServerReport(RegionServerReportRequest)
+ returns(RegionServerReportResponse);
+
+ /**
+ * Called by a region server to report a fatal error that is causing it to
+ * abort.
+ */
+ rpc ReportRSFatalError(ReportRSFatalErrorRequest)
+ returns(ReportRSFatalErrorResponse);
+
+ /** Called to get the sequence id of the last MemStore entry flushed to an
+ * HFile for a specified region. Used by the region server to speed up
+ * log splitting. */
+ rpc GetLastFlushedSequenceId(GetLastFlushedSequenceIdRequest)
+ returns(GetLastFlushedSequenceIdResponse);
+
+ /**
+ * Called by a region server to report the progress of a region
+ * transition. If the request fails, the transition should
+ * be aborted.
+ */
+ rpc ReportRegionStateTransition(ReportRegionStateTransitionRequest)
+ returns(ReportRegionStateTransitionResponse);
+}
http://git-wip-us.apache.org/repos/asf/hbase/blob/967f0910/hbase-native-client/if/RowProcessor.proto
----------------------------------------------------------------------
diff --git a/hbase-native-client/if/RowProcessor.proto b/hbase-native-client/if/RowProcessor.proto
new file mode 100644
index 0000000..cf2f30f
--- /dev/null
+++ b/hbase-native-client/if/RowProcessor.proto
@@ -0,0 +1,45 @@
+/**
+ * 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.
+ */
+/**
+ * Defines a protocol to perform multi row transactions.
+ * See BaseRowProcessorEndpoint for the implementation.
+ * See HRegion#processRowsWithLocks() for details.
+ */
+package hbase.pb;
+
+option java_package = "org.apache.hadoop.hbase.protobuf.generated";
+option java_outer_classname = "RowProcessorProtos";
+option java_generic_services = true;
+option java_generate_equals_and_hash = true;
+option optimize_for = SPEED;
+
+message ProcessRequest {
+ required string row_processor_class_name = 1;
+ optional string row_processor_initializer_message_name = 2;
+ optional bytes row_processor_initializer_message = 3;
+ optional uint64 nonce_group = 4;
+ optional uint64 nonce = 5;
+}
+
+message ProcessResponse {
+ required bytes row_processor_result = 1;
+}
+
+service RowProcessorService {
+ rpc Process(ProcessRequest) returns (ProcessResponse);
+}
http://git-wip-us.apache.org/repos/asf/hbase/blob/967f0910/hbase-native-client/if/SecureBulkLoad.proto
----------------------------------------------------------------------
diff --git a/hbase-native-client/if/SecureBulkLoad.proto b/hbase-native-client/if/SecureBulkLoad.proto
new file mode 100644
index 0000000..814735b
--- /dev/null
+++ b/hbase-native-client/if/SecureBulkLoad.proto
@@ -0,0 +1,72 @@
+/**
+ * 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.
+ */
+package hbase.pb;
+
+option java_package = "org.apache.hadoop.hbase.protobuf.generated";
+option java_outer_classname = "SecureBulkLoadProtos";
+option java_generic_services = true;
+option java_generate_equals_and_hash = true;
+option optimize_for = SPEED;
+
+import 'HBase.proto';
+import 'Client.proto';
+
+message SecureBulkLoadHFilesRequest {
+ repeated BulkLoadHFileRequest.FamilyPath family_path = 1;
+ optional bool assign_seq_num = 2;
+ required DelegationToken fs_token = 3;
+ required string bulk_token = 4;
+}
+
+message SecureBulkLoadHFilesResponse {
+ required bool loaded = 1;
+}
+
+message DelegationToken {
+ optional bytes identifier = 1;
+ optional bytes password = 2;
+ optional string kind = 3;
+ optional string service = 4;
+}
+
+message PrepareBulkLoadRequest {
+ required TableName table_name = 1;
+}
+
+message PrepareBulkLoadResponse {
+ required string bulk_token = 1;
+}
+
+message CleanupBulkLoadRequest {
+ required string bulk_token = 1;
+
+}
+
+message CleanupBulkLoadResponse {
+}
+
+service SecureBulkLoadService {
+ rpc PrepareBulkLoad(PrepareBulkLoadRequest)
+ returns (PrepareBulkLoadResponse);
+
+ rpc SecureBulkLoadHFiles(SecureBulkLoadHFilesRequest)
+ returns (SecureBulkLoadHFilesResponse);
+
+ rpc CleanupBulkLoad(CleanupBulkLoadRequest)
+ returns (CleanupBulkLoadResponse);
+}
http://git-wip-us.apache.org/repos/asf/hbase/blob/967f0910/hbase-native-client/if/Snapshot.proto
----------------------------------------------------------------------
diff --git a/hbase-native-client/if/Snapshot.proto b/hbase-native-client/if/Snapshot.proto
new file mode 100644
index 0000000..ae1a1e6
--- /dev/null
+++ b/hbase-native-client/if/Snapshot.proto
@@ -0,0 +1,66 @@
+/**
+ * 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.
+ */
+package hbase.pb;
+
+option java_package = "org.apache.hadoop.hbase.protobuf.generated";
+option java_outer_classname = "SnapshotProtos";
+option java_generic_services = true;
+option java_generate_equals_and_hash = true;
+option optimize_for = SPEED;
+
+import "FS.proto";
+import "HBase.proto";
+
+message SnapshotFileInfo {
+ enum Type {
+ HFILE = 1;
+ WAL = 2;
+ }
+
+ required Type type = 1;
+
+ optional string hfile = 3;
+
+ optional string wal_server = 4;
+ optional string wal_name = 5;
+}
+
+message SnapshotRegionManifest {
+ optional int32 version = 1;
+
+ required RegionInfo region_info = 2;
+ repeated FamilyFiles family_files = 3;
+
+ message StoreFile {
+ required string name = 1;
+ optional Reference reference = 2;
+
+ // TODO: Add checksums or other fields to verify the file
+ optional uint64 file_size = 3;
+ }
+
+ message FamilyFiles {
+ required bytes family_name = 1;
+ repeated StoreFile store_files = 2;
+ }
+}
+
+message SnapshotDataManifest {
+ required TableSchema table_schema = 1;
+ repeated SnapshotRegionManifest region_manifests = 2;
+}
http://git-wip-us.apache.org/repos/asf/hbase/blob/967f0910/hbase-native-client/if/Tracing.proto
----------------------------------------------------------------------
diff --git a/hbase-native-client/if/Tracing.proto b/hbase-native-client/if/Tracing.proto
new file mode 100644
index 0000000..5a64cfc
--- /dev/null
+++ b/hbase-native-client/if/Tracing.proto
@@ -0,0 +1,33 @@
+/**
+ * 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.
+ */
+package hbase.pb;
+
+option java_package = "org.apache.hadoop.hbase.protobuf.generated";
+option java_outer_classname = "TracingProtos";
+option java_generate_equals_and_hash = true;
+option optimize_for = SPEED;
+
+//Used to pass through the information necessary to continue
+//a trace after an RPC is made. All we need is the traceid
+//(so we know the overarching trace this message is a part of), and
+//the id of the current span when this message was sent, so we know
+//what span caused the new span we will create when this message is received.
+message RPCTInfo {
+ optional int64 trace_id = 1;
+ optional int64 parent_id = 2;
+}
http://git-wip-us.apache.org/repos/asf/hbase/blob/967f0910/hbase-native-client/if/VisibilityLabels.proto
----------------------------------------------------------------------
diff --git a/hbase-native-client/if/VisibilityLabels.proto b/hbase-native-client/if/VisibilityLabels.proto
new file mode 100644
index 0000000..d2dc44d
--- /dev/null
+++ b/hbase-native-client/if/VisibilityLabels.proto
@@ -0,0 +1,83 @@
+/**
+ * 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.
+ */
+package hbase.pb;
+
+option java_package = "org.apache.hadoop.hbase.protobuf.generated";
+option java_outer_classname = "VisibilityLabelsProtos";
+option java_generic_services = true;
+option java_generate_equals_and_hash = true;
+option optimize_for = SPEED;
+
+import "Client.proto";
+
+message VisibilityLabelsRequest {
+ repeated VisibilityLabel visLabel = 1;
+}
+
+message VisibilityLabel {
+ required bytes label = 1;
+ optional uint32 ordinal = 2;
+}
+
+message VisibilityLabelsResponse {
+ repeated RegionActionResult result = 1;
+}
+
+message SetAuthsRequest {
+ required bytes user = 1;
+ repeated bytes auth = 2;
+}
+
+message UserAuthorizations {
+ required bytes user = 1;
+ repeated uint32 auth = 2;
+}
+
+message MultiUserAuthorizations {
+ repeated UserAuthorizations userAuths = 1;
+}
+
+message GetAuthsRequest {
+ required bytes user = 1;
+}
+
+message GetAuthsResponse {
+ required bytes user = 1;
+ repeated bytes auth = 2;
+}
+
+message ListLabelsRequest {
+ optional string regex = 1;
+}
+
+message ListLabelsResponse {
+ repeated bytes label = 1;
+}
+
+service VisibilityLabelsService {
+ rpc addLabels(VisibilityLabelsRequest)
+ returns (VisibilityLabelsResponse);
+ rpc setAuths(SetAuthsRequest)
+ returns (VisibilityLabelsResponse);
+ rpc clearAuths(SetAuthsRequest)
+ returns (VisibilityLabelsResponse);
+ rpc getAuths(GetAuthsRequest)
+ returns (GetAuthsResponse);
+ rpc listLabels(ListLabelsRequest)
+ returns (ListLabelsResponse);
+}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/hbase/blob/967f0910/hbase-native-client/if/WAL.proto
----------------------------------------------------------------------
diff --git a/hbase-native-client/if/WAL.proto b/hbase-native-client/if/WAL.proto
new file mode 100644
index 0000000..cb9bd8f
--- /dev/null
+++ b/hbase-native-client/if/WAL.proto
@@ -0,0 +1,172 @@
+/**
+ * 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.
+ */
+package hbase.pb;
+
+option java_package = "org.apache.hadoop.hbase.protobuf.generated";
+option java_outer_classname = "WALProtos";
+option java_generic_services = false;
+option java_generate_equals_and_hash = true;
+option optimize_for = SPEED;
+
+import "HBase.proto";
+import "Client.proto";
+
+message WALHeader {
+ optional bool has_compression = 1;
+ optional bytes encryption_key = 2;
+ optional bool has_tag_compression = 3;
+ optional string writer_cls_name = 4;
+ optional string cell_codec_cls_name = 5;
+}
+
+/*
+ * Protocol buffer version of WALKey; see WALKey comment, not really a key but WALEdit header
+ * for some KVs
+ */
+message WALKey {
+ required bytes encoded_region_name = 1;
+ required bytes table_name = 2;
+ required uint64 log_sequence_number = 3;
+ required uint64 write_time = 4;
+ /*
+ This parameter is deprecated in favor of clusters which
+ contains the list of clusters that have consumed the change.
+ It is retained so that the log created by earlier releases (0.94)
+ can be read by the newer releases.
+ */
+ optional UUID cluster_id = 5 [deprecated=true];
+
+ repeated FamilyScope scopes = 6;
+ optional uint32 following_kv_count = 7;
+
+ /*
+ This field contains the list of clusters that have
+ consumed the change
+ */
+ repeated UUID cluster_ids = 8;
+
+ optional uint64 nonceGroup = 9;
+ optional uint64 nonce = 10;
+ optional uint64 orig_sequence_number = 11;
+
+/*
+ optional CustomEntryType custom_entry_type = 9;
+
+ enum CustomEntryType {
+ COMPACTION = 0;
+ }
+*/
+}
+
+enum ScopeType {
+ REPLICATION_SCOPE_LOCAL = 0;
+ REPLICATION_SCOPE_GLOBAL = 1;
+}
+
+message FamilyScope {
+ required bytes family = 1;
+ required ScopeType scope_type = 2;
+}
+
+/**
+ * Custom WAL entries
+ */
+
+/**
+ * Special WAL entry to hold all related to a compaction.
+ * Written to WAL before completing compaction. There is
+ * sufficient info in the below message to complete later
+ * the * compaction should we fail the WAL write.
+ */
+message CompactionDescriptor {
+ required bytes table_name = 1; // TODO: WALKey already stores these, might remove
+ required bytes encoded_region_name = 2;
+ required bytes family_name = 3;
+ repeated string compaction_input = 4; // relative to store dir
+ repeated string compaction_output = 5;
+ required string store_home_dir = 6; // relative to region dir
+ optional bytes region_name = 7; // full region name
+}
+
+/**
+ * Special WAL entry to hold all related to a flush.
+ */
+message FlushDescriptor {
+ enum FlushAction {
+ START_FLUSH = 0;
+ COMMIT_FLUSH = 1;
+ ABORT_FLUSH = 2;
+ CANNOT_FLUSH = 3; // marker for indicating that a flush has been requested but cannot complete
+ }
+
+ message StoreFlushDescriptor {
+ required bytes family_name = 1;
+ required string store_home_dir = 2; //relative to region dir
+ repeated string flush_output = 3; // relative to store dir (if this is a COMMIT_FLUSH)
+ }
+
+ required FlushAction action = 1;
+ required bytes table_name = 2;
+ required bytes encoded_region_name = 3;
+ optional uint64 flush_sequence_number = 4;
+ repeated StoreFlushDescriptor store_flushes = 5;
+ optional bytes region_name = 6; // full region name
+}
+
+message StoreDescriptor {
+ required bytes family_name = 1;
+ required string store_home_dir = 2; //relative to region dir
+ repeated string store_file = 3; // relative to store dir
+}
+
+/**
+ * Special WAL entry used for writing bulk load events to WAL
+ */
+message BulkLoadDescriptor {
+ required TableName table_name = 1;
+ required bytes encoded_region_name = 2;
+ repeated StoreDescriptor stores = 3;
+ required int64 bulkload_seq_num = 4;
+}
+
+/**
+ * Special WAL entry to hold all related to a region event (open/close).
+ */
+message RegionEventDescriptor {
+ enum EventType {
+ REGION_OPEN = 0;
+ REGION_CLOSE = 1;
+ }
+
+ required EventType event_type = 1;
+ required bytes table_name = 2;
+ required bytes encoded_region_name = 3;
+ optional uint64 log_sequence_number = 4;
+ repeated StoreDescriptor stores = 5;
+ optional ServerName server = 6; // Server who opened the region
+ optional bytes region_name = 7; // full region name
+}
+
+/**
+ * A trailer that is appended to the end of a properly closed WAL file.
+ * If missing, this is either a legacy or a corrupted WAL file.
+ * N.B. This trailer currently doesn't contain any information and we
+ * purposefully don't expose it in the WAL APIs. It's for future growth.
+ */
+message WALTrailer {
+}
http://git-wip-us.apache.org/repos/asf/hbase/blob/967f0910/hbase-native-client/if/ZooKeeper.proto
----------------------------------------------------------------------
diff --git a/hbase-native-client/if/ZooKeeper.proto b/hbase-native-client/if/ZooKeeper.proto
new file mode 100644
index 0000000..54652af
--- /dev/null
+++ b/hbase-native-client/if/ZooKeeper.proto
@@ -0,0 +1,155 @@
+/**
+ * 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.
+ */
+
+// ZNode data in hbase are serialized protobufs with a four byte
+// 'magic' 'PBUF' prefix.
+package hbase.pb;
+
+option java_package = "org.apache.hadoop.hbase.protobuf.generated";
+option java_outer_classname = "ZooKeeperProtos";
+option java_generic_services = true;
+option java_generate_equals_and_hash = true;
+option optimize_for = SPEED;
+
+import "HBase.proto";
+import "ClusterStatus.proto";
+
+/**
+ * Content of the meta-region-server znode.
+ */
+message MetaRegionServer {
+ // The ServerName hosting the meta region currently, or destination server,
+ // if meta region is in transition.
+ required ServerName server = 1;
+ // The major version of the rpc the server speaks. This is used so that
+ // clients connecting to the cluster can have prior knowledge of what version
+ // to send to a RegionServer. AsyncHBase will use this to detect versions.
+ optional uint32 rpc_version = 2;
+
+ // State of the region transition. OPEN means fully operational 'hbase:meta'
+ optional RegionState.State state = 3;
+}
+
+/**
+ * Content of the master znode.
+ */
+message Master {
+ // The ServerName of the current Master
+ required ServerName master = 1;
+ // Major RPC version so that clients can know what version the master can accept.
+ optional uint32 rpc_version = 2;
+ optional uint32 info_port = 3;
+}
+
+/**
+ * Content of the '/hbase/running', cluster state, znode.
+ */
+message ClusterUp {
+ // If this znode is present, cluster is up. Currently
+ // the data is cluster start_date.
+ required string start_date = 1;
+}
+
+/**
+ * WAL SplitLog directory znodes have this for content. Used doing distributed
+ * WAL splitting. Holds current state and name of server that originated split.
+ */
+message SplitLogTask {
+ enum State {
+ UNASSIGNED = 0;
+ OWNED = 1;
+ RESIGNED = 2;
+ DONE = 3;
+ ERR = 4;
+ }
+ enum RecoveryMode {
+ UNKNOWN = 0;
+ LOG_SPLITTING = 1;
+ LOG_REPLAY = 2;
+ }
+ required State state = 1;
+ required ServerName server_name = 2;
+ optional RecoveryMode mode = 3 [default = UNKNOWN];
+}
+
+/**
+ * The znode that holds state of table.
+ * Deprected, table state is stored in table descriptor on HDFS.
+ */
+message DeprecatedTableState {
+ // Table's current state
+ enum State {
+ ENABLED = 0;
+ DISABLED = 1;
+ DISABLING = 2;
+ ENABLING = 3;
+ }
+ // This is the table's state. If no znode for a table,
+ // its state is presumed enabled. See o.a.h.h.zookeeper.ZKTable class
+ // for more.
+ required State state = 1 [default = ENABLED];
+}
+
+/**
+ * Used by replication. Holds a replication peer key.
+ */
+message ReplicationPeer {
+ // clusterkey is the concatenation of the slave cluster's
+ // hbase.zookeeper.quorum:hbase.zookeeper.property.clientPort:zookeeper.znode.parent
+ required string clusterkey = 1;
+ optional string replicationEndpointImpl = 2;
+ repeated BytesBytesPair data = 3;
+ repeated NameStringPair configuration = 4;
+}
+
+/**
+ * Used by replication. Holds whether enabled or disabled
+ */
+message ReplicationState {
+ enum State {
+ ENABLED = 0;
+ DISABLED = 1;
+ }
+ required State state = 1;
+}
+
+/**
+ * Used by replication. Holds the current position in an WAL file.
+ */
+message ReplicationHLogPosition {
+ required int64 position = 1;
+}
+
+/**
+ * Used by replication. Used to lock a region server during failover.
+ */
+message ReplicationLock {
+ required string lock_owner = 1;
+}
+
+/**
+ * Metadata associated with a table lock in zookeeper
+ */
+message TableLock {
+ optional TableName table_name = 1;
+ optional ServerName lock_owner = 2;
+ optional int64 thread_id = 3;
+ optional bool is_shared = 4;
+ optional string purpose = 5;
+ optional int64 create_time = 6;
+}
http://git-wip-us.apache.org/repos/asf/hbase/blob/967f0910/hbase-native-client/rpc/CMakeLists.txt
----------------------------------------------------------------------
diff --git a/hbase-native-client/rpc/CMakeLists.txt b/hbase-native-client/rpc/CMakeLists.txt
deleted file mode 100644
index 2456923..0000000
--- a/hbase-native-client/rpc/CMakeLists.txt
+++ /dev/null
@@ -1,17 +0,0 @@
-# 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.
-
http://git-wip-us.apache.org/repos/asf/hbase/blob/967f0910/hbase-native-client/third-party/BUCK
----------------------------------------------------------------------
diff --git a/hbase-native-client/third-party/BUCK b/hbase-native-client/third-party/BUCK
index 89d2c93..b7baa86 100644
--- a/hbase-native-client/third-party/BUCK
+++ b/hbase-native-client/third-party/BUCK
@@ -21,7 +21,8 @@ def add_system_libs(names = []):
prebuilt_cxx_library(
name = name,
lib_name = name,
- lib_dir = "/usr/lib/x86_64-linux-gnu"
+ lib_dir = "/usr/lib/x86_64-linux-gnu",
+ visibility = [ 'PUBLIC', ],
)
rules.append(":" + name)
@@ -30,6 +31,7 @@ def add_system_libs(names = []):
system_libs = [
"double-conversion",
"glog",
+ "protobuf",
"gflags",
"unwind",
"lzma",