From 6cadc3828b714c31380df8f274c9a7fd6916a475 Mon Sep 17 00:00:00 2001 From: Elliott Clark Date: Tue, 12 Jul 2016 12:21:11 -0700 Subject: [PATCH] HBASE-16216 Clean up source code. --- hbase-native-client/core/cell-test.cc | 8 +++---- hbase-native-client/core/cell.cc | 40 ++++++++----------------------- hbase-native-client/core/cell.h | 4 ++-- hbase-native-client/if/HBase.proto | 5 ---- hbase-native-client/test-util/test-util.h | 2 +- hbase-native-client/third-party/BUCK | 6 ++--- hbase-native-client/utils/user-util.h | 2 +- 7 files changed, 21 insertions(+), 46 deletions(-) diff --git a/hbase-native-client/core/cell-test.cc b/hbase-native-client/core/cell-test.cc index 49f567b..1d5c0eb 100644 --- a/hbase-native-client/core/cell-test.cc +++ b/hbase-native-client/core/cell-test.cc @@ -19,9 +19,9 @@ #include "core/cell.h" -#include -#include #include +#include +#include using namespace hbase; TEST(CellTest, CellFailureTest) { @@ -74,8 +74,8 @@ TEST(CellTest, MultipleCellsTest) { row += std::to_string(i); value += std::to_string(i); CellType cell_type = CellType::PUT; - const Cell *cell = new Cell(row, family, column, timestamp, value, - cell_type); + const Cell *cell = + new Cell(row, family, column, timestamp, value, cell_type); cells.push_back(cell); } int i = 0; diff --git a/hbase-native-client/core/cell.cc b/hbase-native-client/core/cell.cc index f214479..5129bc9 100644 --- a/hbase-native-client/core/cell.cc +++ b/hbase-native-client/core/cell.cc @@ -25,13 +25,8 @@ namespace hbase { Cell::Cell(const std::string &row, const std::string &family, const std::string &qualifier, const long ×tamp, const std::string &value, const hbase::CellType &cell_type) - : row_(row), - family_(family), - qualifier_(qualifier), - timestamp_(timestamp), - cell_type_(cell_type), - value_(value), - sequence_id_(0) { + : row_(row), family_(family), qualifier_(qualifier), timestamp_(timestamp), + cell_type_(cell_type), value_(value), sequence_id_(0) { if (0 == row.size()) throw std::runtime_error("Row size should be greater than 0"); @@ -43,35 +38,20 @@ Cell::Cell(const std::string &row, const std::string &family, throw std::runtime_error("Timestamp should be greater than 0"); } -Cell::~Cell() { -} +Cell::~Cell() {} -const std::string &Cell::Row() const { - return row_; -} +const std::string &Cell::Row() const { return row_; } -const std::string &Cell::Family() const { - return family_; -} +const std::string &Cell::Family() const { return family_; } -const std::string &Cell::Qualifier() const { - return qualifier_; -} +const std::string &Cell::Qualifier() const { return qualifier_; } -unsigned long Cell::Timestamp() const { - return timestamp_; -} +unsigned long Cell::Timestamp() const { return timestamp_; } -const std::string &Cell::Value() const { - return value_; -} +const std::string &Cell::Value() const { return value_; } -hbase::CellType Cell::Type() const { - return cell_type_; -} +hbase::CellType Cell::Type() const { return cell_type_; } -long Cell::SequenceId() const { - return sequence_id_; -} +long Cell::SequenceId() const { return sequence_id_; } } /* namespace hbase */ diff --git a/hbase-native-client/core/cell.h b/hbase-native-client/core/cell.h index 16ed280..2b15ad6 100644 --- a/hbase-native-client/core/cell.h +++ b/hbase-native-client/core/cell.h @@ -34,7 +34,7 @@ enum CellType { }; class Cell { - public: +public: Cell(const std::string &row, const std::string &family, const std::string &qualifier, const long ×tamp, const std::string &value, const hbase::CellType &cell_type); @@ -47,7 +47,7 @@ class Cell { CellType Type() const; long SequenceId() const; - private: +private: std::string row_; std::string family_; std::string qualifier_; diff --git a/hbase-native-client/if/HBase.proto b/hbase-native-client/if/HBase.proto index e5c967a..c36b214 100644 --- a/hbase-native-client/if/HBase.proto +++ b/hbase-native-client/if/HBase.proto @@ -58,11 +58,6 @@ message TableState { required State state = 1; } -/** On HDFS representation of table state. */ -message TableDescriptor { - required TableSchema schema = 1; -} - /** * Column Family Schema * Inspired by the rest ColumSchemaMessage diff --git a/hbase-native-client/test-util/test-util.h b/hbase-native-client/test-util/test-util.h index 20e4981..9050961 100644 --- a/hbase-native-client/test-util/test-util.h +++ b/hbase-native-client/test-util/test-util.h @@ -18,8 +18,8 @@ */ #pragma once -#include #include +#include #include #include diff --git a/hbase-native-client/third-party/BUCK b/hbase-native-client/third-party/BUCK index 6561b2a..8c0b5f9 100644 --- a/hbase-native-client/third-party/BUCK +++ b/hbase-native-client/third-party/BUCK @@ -51,7 +51,8 @@ def add_dynamic_libs(names=[]): return rules -system_libs = ["lzma", "event", ] +system_libs = ["lzma", + "event", ] local_libs = [ "double-conversion", "boost_regex", @@ -85,8 +86,7 @@ wangle = add_system_libs(['wangle'], 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*") + 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=[ 'googletest/googletest/src/gtest-all.cc', diff --git a/hbase-native-client/utils/user-util.h b/hbase-native-client/utils/user-util.h index fdfc0c8..0704bc6 100644 --- a/hbase-native-client/utils/user-util.h +++ b/hbase-native-client/utils/user-util.h @@ -19,8 +19,8 @@ #pragma once -#include #include +#include namespace hbase { -- 2.8.0-rc2