You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hbase.apache.org by st...@apache.org on 2012/11/06 22:22:30 UTC
svn commit: r1406339 [4/17] - in /hbase/trunk: ./ examples/ hbase-examples/
hbase-examples/src/ hbase-examples/src/main/ hbase-examples/src/main/cpp/
hbase-examples/src/main/cpp/gen-cpp/ hbase-examples/src/main/java/
hbase-examples/src/main/java/org/ h...
Added: hbase/trunk/hbase-examples/src/main/cpp/gen-cpp/Hbase_constants.cpp
URL: http://svn.apache.org/viewvc/hbase/trunk/hbase-examples/src/main/cpp/gen-cpp/Hbase_constants.cpp?rev=1406339&view=auto
==============================================================================
--- hbase/trunk/hbase-examples/src/main/cpp/gen-cpp/Hbase_constants.cpp (added)
+++ hbase/trunk/hbase-examples/src/main/cpp/gen-cpp/Hbase_constants.cpp Tue Nov 6 21:22:27 2012
@@ -0,0 +1,17 @@
+/**
+ * Autogenerated by Thrift Compiler (0.9.0)
+ *
+ * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
+ * @generated
+ */
+#include "Hbase_constants.h"
+
+namespace apache { namespace hadoop { namespace hbase { namespace thrift {
+
+const HbaseConstants g_Hbase_constants;
+
+HbaseConstants::HbaseConstants() {
+}
+
+}}}} // namespace
+
Added: hbase/trunk/hbase-examples/src/main/cpp/gen-cpp/Hbase_constants.h
URL: http://svn.apache.org/viewvc/hbase/trunk/hbase-examples/src/main/cpp/gen-cpp/Hbase_constants.h?rev=1406339&view=auto
==============================================================================
--- hbase/trunk/hbase-examples/src/main/cpp/gen-cpp/Hbase_constants.h (added)
+++ hbase/trunk/hbase-examples/src/main/cpp/gen-cpp/Hbase_constants.h Tue Nov 6 21:22:27 2012
@@ -0,0 +1,24 @@
+/**
+ * Autogenerated by Thrift Compiler (0.9.0)
+ *
+ * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
+ * @generated
+ */
+#ifndef Hbase_CONSTANTS_H
+#define Hbase_CONSTANTS_H
+
+#include "Hbase_types.h"
+
+namespace apache { namespace hadoop { namespace hbase { namespace thrift {
+
+class HbaseConstants {
+ public:
+ HbaseConstants();
+
+};
+
+extern const HbaseConstants g_Hbase_constants;
+
+}}}} // namespace
+
+#endif
Added: hbase/trunk/hbase-examples/src/main/cpp/gen-cpp/Hbase_server.skeleton.cpp
URL: http://svn.apache.org/viewvc/hbase/trunk/hbase-examples/src/main/cpp/gen-cpp/Hbase_server.skeleton.cpp?rev=1406339&view=auto
==============================================================================
--- hbase/trunk/hbase-examples/src/main/cpp/gen-cpp/Hbase_server.skeleton.cpp (added)
+++ hbase/trunk/hbase-examples/src/main/cpp/gen-cpp/Hbase_server.skeleton.cpp Tue Nov 6 21:22:27 2012
@@ -0,0 +1,254 @@
+// This autogenerated skeleton file illustrates how to build a server.
+// You should copy it to another filename to avoid overwriting it.
+
+#include "Hbase.h"
+#include <thrift/protocol/TBinaryProtocol.h>
+#include <thrift/server/TSimpleServer.h>
+#include <thrift/transport/TServerSocket.h>
+#include <thrift/transport/TBufferTransports.h>
+
+using namespace ::apache::thrift;
+using namespace ::apache::thrift::protocol;
+using namespace ::apache::thrift::transport;
+using namespace ::apache::thrift::server;
+
+using boost::shared_ptr;
+
+using namespace ::apache::hadoop::hbase::thrift;
+
+class HbaseHandler : virtual public HbaseIf {
+ public:
+ HbaseHandler() {
+ // Your initialization goes here
+ }
+
+ void enableTable(const Bytes& tableName) {
+ // Your implementation goes here
+ printf("enableTable\n");
+ }
+
+ void disableTable(const Bytes& tableName) {
+ // Your implementation goes here
+ printf("disableTable\n");
+ }
+
+ bool isTableEnabled(const Bytes& tableName) {
+ // Your implementation goes here
+ printf("isTableEnabled\n");
+ }
+
+ void compact(const Bytes& tableNameOrRegionName) {
+ // Your implementation goes here
+ printf("compact\n");
+ }
+
+ void majorCompact(const Bytes& tableNameOrRegionName) {
+ // Your implementation goes here
+ printf("majorCompact\n");
+ }
+
+ void getTableNames(std::vector<Text> & _return) {
+ // Your implementation goes here
+ printf("getTableNames\n");
+ }
+
+ void getColumnDescriptors(std::map<Text, ColumnDescriptor> & _return, const Text& tableName) {
+ // Your implementation goes here
+ printf("getColumnDescriptors\n");
+ }
+
+ void getTableRegions(std::vector<TRegionInfo> & _return, const Text& tableName) {
+ // Your implementation goes here
+ printf("getTableRegions\n");
+ }
+
+ void createTable(const Text& tableName, const std::vector<ColumnDescriptor> & columnFamilies) {
+ // Your implementation goes here
+ printf("createTable\n");
+ }
+
+ void deleteTable(const Text& tableName) {
+ // Your implementation goes here
+ printf("deleteTable\n");
+ }
+
+ void get(std::vector<TCell> & _return, const Text& tableName, const Text& row, const Text& column, const std::map<Text, Text> & attributes) {
+ // Your implementation goes here
+ printf("get\n");
+ }
+
+ void getVer(std::vector<TCell> & _return, const Text& tableName, const Text& row, const Text& column, const int32_t numVersions, const std::map<Text, Text> & attributes) {
+ // Your implementation goes here
+ printf("getVer\n");
+ }
+
+ void getVerTs(std::vector<TCell> & _return, const Text& tableName, const Text& row, const Text& column, const int64_t timestamp, const int32_t numVersions, const std::map<Text, Text> & attributes) {
+ // Your implementation goes here
+ printf("getVerTs\n");
+ }
+
+ void getRow(std::vector<TRowResult> & _return, const Text& tableName, const Text& row, const std::map<Text, Text> & attributes) {
+ // Your implementation goes here
+ printf("getRow\n");
+ }
+
+ void getRowWithColumns(std::vector<TRowResult> & _return, const Text& tableName, const Text& row, const std::vector<Text> & columns, const std::map<Text, Text> & attributes) {
+ // Your implementation goes here
+ printf("getRowWithColumns\n");
+ }
+
+ void getRowTs(std::vector<TRowResult> & _return, const Text& tableName, const Text& row, const int64_t timestamp, const std::map<Text, Text> & attributes) {
+ // Your implementation goes here
+ printf("getRowTs\n");
+ }
+
+ void getRowWithColumnsTs(std::vector<TRowResult> & _return, const Text& tableName, const Text& row, const std::vector<Text> & columns, const int64_t timestamp, const std::map<Text, Text> & attributes) {
+ // Your implementation goes here
+ printf("getRowWithColumnsTs\n");
+ }
+
+ void getRows(std::vector<TRowResult> & _return, const Text& tableName, const std::vector<Text> & rows, const std::map<Text, Text> & attributes) {
+ // Your implementation goes here
+ printf("getRows\n");
+ }
+
+ void getRowsWithColumns(std::vector<TRowResult> & _return, const Text& tableName, const std::vector<Text> & rows, const std::vector<Text> & columns, const std::map<Text, Text> & attributes) {
+ // Your implementation goes here
+ printf("getRowsWithColumns\n");
+ }
+
+ void getRowsTs(std::vector<TRowResult> & _return, const Text& tableName, const std::vector<Text> & rows, const int64_t timestamp, const std::map<Text, Text> & attributes) {
+ // Your implementation goes here
+ printf("getRowsTs\n");
+ }
+
+ void getRowsWithColumnsTs(std::vector<TRowResult> & _return, const Text& tableName, const std::vector<Text> & rows, const std::vector<Text> & columns, const int64_t timestamp, const std::map<Text, Text> & attributes) {
+ // Your implementation goes here
+ printf("getRowsWithColumnsTs\n");
+ }
+
+ void mutateRow(const Text& tableName, const Text& row, const std::vector<Mutation> & mutations, const std::map<Text, Text> & attributes) {
+ // Your implementation goes here
+ printf("mutateRow\n");
+ }
+
+ void mutateRowTs(const Text& tableName, const Text& row, const std::vector<Mutation> & mutations, const int64_t timestamp, const std::map<Text, Text> & attributes) {
+ // Your implementation goes here
+ printf("mutateRowTs\n");
+ }
+
+ void mutateRows(const Text& tableName, const std::vector<BatchMutation> & rowBatches, const std::map<Text, Text> & attributes) {
+ // Your implementation goes here
+ printf("mutateRows\n");
+ }
+
+ void mutateRowsTs(const Text& tableName, const std::vector<BatchMutation> & rowBatches, const int64_t timestamp, const std::map<Text, Text> & attributes) {
+ // Your implementation goes here
+ printf("mutateRowsTs\n");
+ }
+
+ int64_t atomicIncrement(const Text& tableName, const Text& row, const Text& column, const int64_t value) {
+ // Your implementation goes here
+ printf("atomicIncrement\n");
+ }
+
+ void deleteAll(const Text& tableName, const Text& row, const Text& column, const std::map<Text, Text> & attributes) {
+ // Your implementation goes here
+ printf("deleteAll\n");
+ }
+
+ void deleteAllTs(const Text& tableName, const Text& row, const Text& column, const int64_t timestamp, const std::map<Text, Text> & attributes) {
+ // Your implementation goes here
+ printf("deleteAllTs\n");
+ }
+
+ void deleteAllRow(const Text& tableName, const Text& row, const std::map<Text, Text> & attributes) {
+ // Your implementation goes here
+ printf("deleteAllRow\n");
+ }
+
+ void increment(const TIncrement& increment) {
+ // Your implementation goes here
+ printf("increment\n");
+ }
+
+ void incrementRows(const std::vector<TIncrement> & increments) {
+ // Your implementation goes here
+ printf("incrementRows\n");
+ }
+
+ void deleteAllRowTs(const Text& tableName, const Text& row, const int64_t timestamp, const std::map<Text, Text> & attributes) {
+ // Your implementation goes here
+ printf("deleteAllRowTs\n");
+ }
+
+ ScannerID scannerOpenWithScan(const Text& tableName, const TScan& scan, const std::map<Text, Text> & attributes) {
+ // Your implementation goes here
+ printf("scannerOpenWithScan\n");
+ }
+
+ ScannerID scannerOpen(const Text& tableName, const Text& startRow, const std::vector<Text> & columns, const std::map<Text, Text> & attributes) {
+ // Your implementation goes here
+ printf("scannerOpen\n");
+ }
+
+ ScannerID scannerOpenWithStop(const Text& tableName, const Text& startRow, const Text& stopRow, const std::vector<Text> & columns, const std::map<Text, Text> & attributes) {
+ // Your implementation goes here
+ printf("scannerOpenWithStop\n");
+ }
+
+ ScannerID scannerOpenWithPrefix(const Text& tableName, const Text& startAndPrefix, const std::vector<Text> & columns, const std::map<Text, Text> & attributes) {
+ // Your implementation goes here
+ printf("scannerOpenWithPrefix\n");
+ }
+
+ ScannerID scannerOpenTs(const Text& tableName, const Text& startRow, const std::vector<Text> & columns, const int64_t timestamp, const std::map<Text, Text> & attributes) {
+ // Your implementation goes here
+ printf("scannerOpenTs\n");
+ }
+
+ ScannerID scannerOpenWithStopTs(const Text& tableName, const Text& startRow, const Text& stopRow, const std::vector<Text> & columns, const int64_t timestamp, const std::map<Text, Text> & attributes) {
+ // Your implementation goes here
+ printf("scannerOpenWithStopTs\n");
+ }
+
+ void scannerGet(std::vector<TRowResult> & _return, const ScannerID id) {
+ // Your implementation goes here
+ printf("scannerGet\n");
+ }
+
+ void scannerGetList(std::vector<TRowResult> & _return, const ScannerID id, const int32_t nbRows) {
+ // Your implementation goes here
+ printf("scannerGetList\n");
+ }
+
+ void scannerClose(const ScannerID id) {
+ // Your implementation goes here
+ printf("scannerClose\n");
+ }
+
+ void getRowOrBefore(std::vector<TCell> & _return, const Text& tableName, const Text& row, const Text& family) {
+ // Your implementation goes here
+ printf("getRowOrBefore\n");
+ }
+
+ void getRegionInfo(TRegionInfo& _return, const Text& row) {
+ // Your implementation goes here
+ printf("getRegionInfo\n");
+ }
+
+};
+
+int main(int argc, char **argv) {
+ int port = 9090;
+ shared_ptr<HbaseHandler> handler(new HbaseHandler());
+ shared_ptr<TProcessor> processor(new HbaseProcessor(handler));
+ shared_ptr<TServerTransport> serverTransport(new TServerSocket(port));
+ shared_ptr<TTransportFactory> transportFactory(new TBufferedTransportFactory());
+ shared_ptr<TProtocolFactory> protocolFactory(new TBinaryProtocolFactory());
+
+ TSimpleServer server(processor, serverTransport, transportFactory, protocolFactory);
+ server.serve();
+ return 0;
+}
+
Added: hbase/trunk/hbase-examples/src/main/cpp/gen-cpp/Hbase_types.cpp
URL: http://svn.apache.org/viewvc/hbase/trunk/hbase-examples/src/main/cpp/gen-cpp/Hbase_types.cpp?rev=1406339&view=auto
==============================================================================
--- hbase/trunk/hbase-examples/src/main/cpp/gen-cpp/Hbase_types.cpp (added)
+++ hbase/trunk/hbase-examples/src/main/cpp/gen-cpp/Hbase_types.cpp Tue Nov 6 21:22:27 2012
@@ -0,0 +1,1129 @@
+/**
+ * Autogenerated by Thrift Compiler (0.9.0)
+ *
+ * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
+ * @generated
+ */
+#include "Hbase_types.h"
+
+#include <algorithm>
+
+namespace apache { namespace hadoop { namespace hbase { namespace thrift {
+
+const char* TCell::ascii_fingerprint = "1CCCF6FC31CFD1D61BBBB1BAF3590620";
+const uint8_t TCell::binary_fingerprint[16] = {0x1C,0xCC,0xF6,0xFC,0x31,0xCF,0xD1,0xD6,0x1B,0xBB,0xB1,0xBA,0xF3,0x59,0x06,0x20};
+
+uint32_t TCell::read(::apache::thrift::protocol::TProtocol* iprot) {
+
+ uint32_t xfer = 0;
+ std::string fname;
+ ::apache::thrift::protocol::TType ftype;
+ int16_t fid;
+
+ xfer += iprot->readStructBegin(fname);
+
+ using ::apache::thrift::protocol::TProtocolException;
+
+
+ while (true)
+ {
+ xfer += iprot->readFieldBegin(fname, ftype, fid);
+ if (ftype == ::apache::thrift::protocol::T_STOP) {
+ break;
+ }
+ switch (fid)
+ {
+ case 1:
+ if (ftype == ::apache::thrift::protocol::T_STRING) {
+ xfer += iprot->readBinary(this->value);
+ this->__isset.value = true;
+ } else {
+ xfer += iprot->skip(ftype);
+ }
+ break;
+ case 2:
+ if (ftype == ::apache::thrift::protocol::T_I64) {
+ xfer += iprot->readI64(this->timestamp);
+ this->__isset.timestamp = true;
+ } else {
+ xfer += iprot->skip(ftype);
+ }
+ break;
+ default:
+ xfer += iprot->skip(ftype);
+ break;
+ }
+ xfer += iprot->readFieldEnd();
+ }
+
+ xfer += iprot->readStructEnd();
+
+ return xfer;
+}
+
+uint32_t TCell::write(::apache::thrift::protocol::TProtocol* oprot) const {
+ uint32_t xfer = 0;
+ xfer += oprot->writeStructBegin("TCell");
+
+ xfer += oprot->writeFieldBegin("value", ::apache::thrift::protocol::T_STRING, 1);
+ xfer += oprot->writeBinary(this->value);
+ xfer += oprot->writeFieldEnd();
+
+ xfer += oprot->writeFieldBegin("timestamp", ::apache::thrift::protocol::T_I64, 2);
+ xfer += oprot->writeI64(this->timestamp);
+ xfer += oprot->writeFieldEnd();
+
+ xfer += oprot->writeFieldStop();
+ xfer += oprot->writeStructEnd();
+ return xfer;
+}
+
+void swap(TCell &a, TCell &b) {
+ using ::std::swap;
+ swap(a.value, b.value);
+ swap(a.timestamp, b.timestamp);
+ swap(a.__isset, b.__isset);
+}
+
+const char* ColumnDescriptor::ascii_fingerprint = "3B18638852FDF9DD911BC1174265F92E";
+const uint8_t ColumnDescriptor::binary_fingerprint[16] = {0x3B,0x18,0x63,0x88,0x52,0xFD,0xF9,0xDD,0x91,0x1B,0xC1,0x17,0x42,0x65,0xF9,0x2E};
+
+uint32_t ColumnDescriptor::read(::apache::thrift::protocol::TProtocol* iprot) {
+
+ uint32_t xfer = 0;
+ std::string fname;
+ ::apache::thrift::protocol::TType ftype;
+ int16_t fid;
+
+ xfer += iprot->readStructBegin(fname);
+
+ using ::apache::thrift::protocol::TProtocolException;
+
+
+ while (true)
+ {
+ xfer += iprot->readFieldBegin(fname, ftype, fid);
+ if (ftype == ::apache::thrift::protocol::T_STOP) {
+ break;
+ }
+ switch (fid)
+ {
+ case 1:
+ if (ftype == ::apache::thrift::protocol::T_STRING) {
+ xfer += iprot->readBinary(this->name);
+ this->__isset.name = true;
+ } else {
+ xfer += iprot->skip(ftype);
+ }
+ break;
+ case 2:
+ if (ftype == ::apache::thrift::protocol::T_I32) {
+ xfer += iprot->readI32(this->maxVersions);
+ this->__isset.maxVersions = true;
+ } else {
+ xfer += iprot->skip(ftype);
+ }
+ break;
+ case 3:
+ if (ftype == ::apache::thrift::protocol::T_STRING) {
+ xfer += iprot->readString(this->compression);
+ this->__isset.compression = true;
+ } else {
+ xfer += iprot->skip(ftype);
+ }
+ break;
+ case 4:
+ if (ftype == ::apache::thrift::protocol::T_BOOL) {
+ xfer += iprot->readBool(this->inMemory);
+ this->__isset.inMemory = true;
+ } else {
+ xfer += iprot->skip(ftype);
+ }
+ break;
+ case 5:
+ if (ftype == ::apache::thrift::protocol::T_STRING) {
+ xfer += iprot->readString(this->bloomFilterType);
+ this->__isset.bloomFilterType = true;
+ } else {
+ xfer += iprot->skip(ftype);
+ }
+ break;
+ case 6:
+ if (ftype == ::apache::thrift::protocol::T_I32) {
+ xfer += iprot->readI32(this->bloomFilterVectorSize);
+ this->__isset.bloomFilterVectorSize = true;
+ } else {
+ xfer += iprot->skip(ftype);
+ }
+ break;
+ case 7:
+ if (ftype == ::apache::thrift::protocol::T_I32) {
+ xfer += iprot->readI32(this->bloomFilterNbHashes);
+ this->__isset.bloomFilterNbHashes = true;
+ } else {
+ xfer += iprot->skip(ftype);
+ }
+ break;
+ case 8:
+ if (ftype == ::apache::thrift::protocol::T_BOOL) {
+ xfer += iprot->readBool(this->blockCacheEnabled);
+ this->__isset.blockCacheEnabled = true;
+ } else {
+ xfer += iprot->skip(ftype);
+ }
+ break;
+ case 9:
+ if (ftype == ::apache::thrift::protocol::T_I32) {
+ xfer += iprot->readI32(this->timeToLive);
+ this->__isset.timeToLive = true;
+ } else {
+ xfer += iprot->skip(ftype);
+ }
+ break;
+ default:
+ xfer += iprot->skip(ftype);
+ break;
+ }
+ xfer += iprot->readFieldEnd();
+ }
+
+ xfer += iprot->readStructEnd();
+
+ return xfer;
+}
+
+uint32_t ColumnDescriptor::write(::apache::thrift::protocol::TProtocol* oprot) const {
+ uint32_t xfer = 0;
+ xfer += oprot->writeStructBegin("ColumnDescriptor");
+
+ xfer += oprot->writeFieldBegin("name", ::apache::thrift::protocol::T_STRING, 1);
+ xfer += oprot->writeBinary(this->name);
+ xfer += oprot->writeFieldEnd();
+
+ xfer += oprot->writeFieldBegin("maxVersions", ::apache::thrift::protocol::T_I32, 2);
+ xfer += oprot->writeI32(this->maxVersions);
+ xfer += oprot->writeFieldEnd();
+
+ xfer += oprot->writeFieldBegin("compression", ::apache::thrift::protocol::T_STRING, 3);
+ xfer += oprot->writeString(this->compression);
+ xfer += oprot->writeFieldEnd();
+
+ xfer += oprot->writeFieldBegin("inMemory", ::apache::thrift::protocol::T_BOOL, 4);
+ xfer += oprot->writeBool(this->inMemory);
+ xfer += oprot->writeFieldEnd();
+
+ xfer += oprot->writeFieldBegin("bloomFilterType", ::apache::thrift::protocol::T_STRING, 5);
+ xfer += oprot->writeString(this->bloomFilterType);
+ xfer += oprot->writeFieldEnd();
+
+ xfer += oprot->writeFieldBegin("bloomFilterVectorSize", ::apache::thrift::protocol::T_I32, 6);
+ xfer += oprot->writeI32(this->bloomFilterVectorSize);
+ xfer += oprot->writeFieldEnd();
+
+ xfer += oprot->writeFieldBegin("bloomFilterNbHashes", ::apache::thrift::protocol::T_I32, 7);
+ xfer += oprot->writeI32(this->bloomFilterNbHashes);
+ xfer += oprot->writeFieldEnd();
+
+ xfer += oprot->writeFieldBegin("blockCacheEnabled", ::apache::thrift::protocol::T_BOOL, 8);
+ xfer += oprot->writeBool(this->blockCacheEnabled);
+ xfer += oprot->writeFieldEnd();
+
+ xfer += oprot->writeFieldBegin("timeToLive", ::apache::thrift::protocol::T_I32, 9);
+ xfer += oprot->writeI32(this->timeToLive);
+ xfer += oprot->writeFieldEnd();
+
+ xfer += oprot->writeFieldStop();
+ xfer += oprot->writeStructEnd();
+ return xfer;
+}
+
+void swap(ColumnDescriptor &a, ColumnDescriptor &b) {
+ using ::std::swap;
+ swap(a.name, b.name);
+ swap(a.maxVersions, b.maxVersions);
+ swap(a.compression, b.compression);
+ swap(a.inMemory, b.inMemory);
+ swap(a.bloomFilterType, b.bloomFilterType);
+ swap(a.bloomFilterVectorSize, b.bloomFilterVectorSize);
+ swap(a.bloomFilterNbHashes, b.bloomFilterNbHashes);
+ swap(a.blockCacheEnabled, b.blockCacheEnabled);
+ swap(a.timeToLive, b.timeToLive);
+ swap(a.__isset, b.__isset);
+}
+
+const char* TRegionInfo::ascii_fingerprint = "B58AB7A239831F8614F7B6709C89DC7B";
+const uint8_t TRegionInfo::binary_fingerprint[16] = {0xB5,0x8A,0xB7,0xA2,0x39,0x83,0x1F,0x86,0x14,0xF7,0xB6,0x70,0x9C,0x89,0xDC,0x7B};
+
+uint32_t TRegionInfo::read(::apache::thrift::protocol::TProtocol* iprot) {
+
+ uint32_t xfer = 0;
+ std::string fname;
+ ::apache::thrift::protocol::TType ftype;
+ int16_t fid;
+
+ xfer += iprot->readStructBegin(fname);
+
+ using ::apache::thrift::protocol::TProtocolException;
+
+
+ while (true)
+ {
+ xfer += iprot->readFieldBegin(fname, ftype, fid);
+ if (ftype == ::apache::thrift::protocol::T_STOP) {
+ break;
+ }
+ switch (fid)
+ {
+ case 1:
+ if (ftype == ::apache::thrift::protocol::T_STRING) {
+ xfer += iprot->readBinary(this->startKey);
+ this->__isset.startKey = true;
+ } else {
+ xfer += iprot->skip(ftype);
+ }
+ break;
+ case 2:
+ if (ftype == ::apache::thrift::protocol::T_STRING) {
+ xfer += iprot->readBinary(this->endKey);
+ this->__isset.endKey = true;
+ } else {
+ xfer += iprot->skip(ftype);
+ }
+ break;
+ case 3:
+ if (ftype == ::apache::thrift::protocol::T_I64) {
+ xfer += iprot->readI64(this->id);
+ this->__isset.id = true;
+ } else {
+ xfer += iprot->skip(ftype);
+ }
+ break;
+ case 4:
+ if (ftype == ::apache::thrift::protocol::T_STRING) {
+ xfer += iprot->readBinary(this->name);
+ this->__isset.name = true;
+ } else {
+ xfer += iprot->skip(ftype);
+ }
+ break;
+ case 5:
+ if (ftype == ::apache::thrift::protocol::T_BYTE) {
+ xfer += iprot->readByte(this->version);
+ this->__isset.version = true;
+ } else {
+ xfer += iprot->skip(ftype);
+ }
+ break;
+ case 6:
+ if (ftype == ::apache::thrift::protocol::T_STRING) {
+ xfer += iprot->readBinary(this->serverName);
+ this->__isset.serverName = true;
+ } else {
+ xfer += iprot->skip(ftype);
+ }
+ break;
+ case 7:
+ if (ftype == ::apache::thrift::protocol::T_I32) {
+ xfer += iprot->readI32(this->port);
+ this->__isset.port = true;
+ } else {
+ xfer += iprot->skip(ftype);
+ }
+ break;
+ default:
+ xfer += iprot->skip(ftype);
+ break;
+ }
+ xfer += iprot->readFieldEnd();
+ }
+
+ xfer += iprot->readStructEnd();
+
+ return xfer;
+}
+
+uint32_t TRegionInfo::write(::apache::thrift::protocol::TProtocol* oprot) const {
+ uint32_t xfer = 0;
+ xfer += oprot->writeStructBegin("TRegionInfo");
+
+ xfer += oprot->writeFieldBegin("startKey", ::apache::thrift::protocol::T_STRING, 1);
+ xfer += oprot->writeBinary(this->startKey);
+ xfer += oprot->writeFieldEnd();
+
+ xfer += oprot->writeFieldBegin("endKey", ::apache::thrift::protocol::T_STRING, 2);
+ xfer += oprot->writeBinary(this->endKey);
+ xfer += oprot->writeFieldEnd();
+
+ xfer += oprot->writeFieldBegin("id", ::apache::thrift::protocol::T_I64, 3);
+ xfer += oprot->writeI64(this->id);
+ xfer += oprot->writeFieldEnd();
+
+ xfer += oprot->writeFieldBegin("name", ::apache::thrift::protocol::T_STRING, 4);
+ xfer += oprot->writeBinary(this->name);
+ xfer += oprot->writeFieldEnd();
+
+ xfer += oprot->writeFieldBegin("version", ::apache::thrift::protocol::T_BYTE, 5);
+ xfer += oprot->writeByte(this->version);
+ xfer += oprot->writeFieldEnd();
+
+ xfer += oprot->writeFieldBegin("serverName", ::apache::thrift::protocol::T_STRING, 6);
+ xfer += oprot->writeBinary(this->serverName);
+ xfer += oprot->writeFieldEnd();
+
+ xfer += oprot->writeFieldBegin("port", ::apache::thrift::protocol::T_I32, 7);
+ xfer += oprot->writeI32(this->port);
+ xfer += oprot->writeFieldEnd();
+
+ xfer += oprot->writeFieldStop();
+ xfer += oprot->writeStructEnd();
+ return xfer;
+}
+
+void swap(TRegionInfo &a, TRegionInfo &b) {
+ using ::std::swap;
+ swap(a.startKey, b.startKey);
+ swap(a.endKey, b.endKey);
+ swap(a.id, b.id);
+ swap(a.name, b.name);
+ swap(a.version, b.version);
+ swap(a.serverName, b.serverName);
+ swap(a.port, b.port);
+ swap(a.__isset, b.__isset);
+}
+
+const char* Mutation::ascii_fingerprint = "CD9E9D4A6406AD402C90440434AE18A0";
+const uint8_t Mutation::binary_fingerprint[16] = {0xCD,0x9E,0x9D,0x4A,0x64,0x06,0xAD,0x40,0x2C,0x90,0x44,0x04,0x34,0xAE,0x18,0xA0};
+
+uint32_t Mutation::read(::apache::thrift::protocol::TProtocol* iprot) {
+
+ uint32_t xfer = 0;
+ std::string fname;
+ ::apache::thrift::protocol::TType ftype;
+ int16_t fid;
+
+ xfer += iprot->readStructBegin(fname);
+
+ using ::apache::thrift::protocol::TProtocolException;
+
+
+ while (true)
+ {
+ xfer += iprot->readFieldBegin(fname, ftype, fid);
+ if (ftype == ::apache::thrift::protocol::T_STOP) {
+ break;
+ }
+ switch (fid)
+ {
+ case 1:
+ if (ftype == ::apache::thrift::protocol::T_BOOL) {
+ xfer += iprot->readBool(this->isDelete);
+ this->__isset.isDelete = true;
+ } else {
+ xfer += iprot->skip(ftype);
+ }
+ break;
+ case 2:
+ if (ftype == ::apache::thrift::protocol::T_STRING) {
+ xfer += iprot->readBinary(this->column);
+ this->__isset.column = true;
+ } else {
+ xfer += iprot->skip(ftype);
+ }
+ break;
+ case 3:
+ if (ftype == ::apache::thrift::protocol::T_STRING) {
+ xfer += iprot->readBinary(this->value);
+ this->__isset.value = true;
+ } else {
+ xfer += iprot->skip(ftype);
+ }
+ break;
+ case 4:
+ if (ftype == ::apache::thrift::protocol::T_BOOL) {
+ xfer += iprot->readBool(this->writeToWAL);
+ this->__isset.writeToWAL = true;
+ } else {
+ xfer += iprot->skip(ftype);
+ }
+ break;
+ default:
+ xfer += iprot->skip(ftype);
+ break;
+ }
+ xfer += iprot->readFieldEnd();
+ }
+
+ xfer += iprot->readStructEnd();
+
+ return xfer;
+}
+
+uint32_t Mutation::write(::apache::thrift::protocol::TProtocol* oprot) const {
+ uint32_t xfer = 0;
+ xfer += oprot->writeStructBegin("Mutation");
+
+ xfer += oprot->writeFieldBegin("isDelete", ::apache::thrift::protocol::T_BOOL, 1);
+ xfer += oprot->writeBool(this->isDelete);
+ xfer += oprot->writeFieldEnd();
+
+ xfer += oprot->writeFieldBegin("column", ::apache::thrift::protocol::T_STRING, 2);
+ xfer += oprot->writeBinary(this->column);
+ xfer += oprot->writeFieldEnd();
+
+ xfer += oprot->writeFieldBegin("value", ::apache::thrift::protocol::T_STRING, 3);
+ xfer += oprot->writeBinary(this->value);
+ xfer += oprot->writeFieldEnd();
+
+ xfer += oprot->writeFieldBegin("writeToWAL", ::apache::thrift::protocol::T_BOOL, 4);
+ xfer += oprot->writeBool(this->writeToWAL);
+ xfer += oprot->writeFieldEnd();
+
+ xfer += oprot->writeFieldStop();
+ xfer += oprot->writeStructEnd();
+ return xfer;
+}
+
+void swap(Mutation &a, Mutation &b) {
+ using ::std::swap;
+ swap(a.isDelete, b.isDelete);
+ swap(a.column, b.column);
+ swap(a.value, b.value);
+ swap(a.writeToWAL, b.writeToWAL);
+ swap(a.__isset, b.__isset);
+}
+
+const char* BatchMutation::ascii_fingerprint = "4B8A4A9E051CAFF532E1C0D54F6AD2AB";
+const uint8_t BatchMutation::binary_fingerprint[16] = {0x4B,0x8A,0x4A,0x9E,0x05,0x1C,0xAF,0xF5,0x32,0xE1,0xC0,0xD5,0x4F,0x6A,0xD2,0xAB};
+
+uint32_t BatchMutation::read(::apache::thrift::protocol::TProtocol* iprot) {
+
+ uint32_t xfer = 0;
+ std::string fname;
+ ::apache::thrift::protocol::TType ftype;
+ int16_t fid;
+
+ xfer += iprot->readStructBegin(fname);
+
+ using ::apache::thrift::protocol::TProtocolException;
+
+
+ while (true)
+ {
+ xfer += iprot->readFieldBegin(fname, ftype, fid);
+ if (ftype == ::apache::thrift::protocol::T_STOP) {
+ break;
+ }
+ switch (fid)
+ {
+ case 1:
+ if (ftype == ::apache::thrift::protocol::T_STRING) {
+ xfer += iprot->readBinary(this->row);
+ this->__isset.row = true;
+ } else {
+ xfer += iprot->skip(ftype);
+ }
+ break;
+ case 2:
+ if (ftype == ::apache::thrift::protocol::T_LIST) {
+ {
+ this->mutations.clear();
+ uint32_t _size0;
+ ::apache::thrift::protocol::TType _etype3;
+ xfer += iprot->readListBegin(_etype3, _size0);
+ this->mutations.resize(_size0);
+ uint32_t _i4;
+ for (_i4 = 0; _i4 < _size0; ++_i4)
+ {
+ xfer += this->mutations[_i4].read(iprot);
+ }
+ xfer += iprot->readListEnd();
+ }
+ this->__isset.mutations = true;
+ } else {
+ xfer += iprot->skip(ftype);
+ }
+ break;
+ default:
+ xfer += iprot->skip(ftype);
+ break;
+ }
+ xfer += iprot->readFieldEnd();
+ }
+
+ xfer += iprot->readStructEnd();
+
+ return xfer;
+}
+
+uint32_t BatchMutation::write(::apache::thrift::protocol::TProtocol* oprot) const {
+ uint32_t xfer = 0;
+ xfer += oprot->writeStructBegin("BatchMutation");
+
+ xfer += oprot->writeFieldBegin("row", ::apache::thrift::protocol::T_STRING, 1);
+ xfer += oprot->writeBinary(this->row);
+ xfer += oprot->writeFieldEnd();
+
+ xfer += oprot->writeFieldBegin("mutations", ::apache::thrift::protocol::T_LIST, 2);
+ {
+ xfer += oprot->writeListBegin(::apache::thrift::protocol::T_STRUCT, static_cast<uint32_t>(this->mutations.size()));
+ std::vector<Mutation> ::const_iterator _iter5;
+ for (_iter5 = this->mutations.begin(); _iter5 != this->mutations.end(); ++_iter5)
+ {
+ xfer += (*_iter5).write(oprot);
+ }
+ xfer += oprot->writeListEnd();
+ }
+ xfer += oprot->writeFieldEnd();
+
+ xfer += oprot->writeFieldStop();
+ xfer += oprot->writeStructEnd();
+ return xfer;
+}
+
+void swap(BatchMutation &a, BatchMutation &b) {
+ using ::std::swap;
+ swap(a.row, b.row);
+ swap(a.mutations, b.mutations);
+ swap(a.__isset, b.__isset);
+}
+
+const char* TIncrement::ascii_fingerprint = "5F9965D46A4F3845985AC0F9B81C3C69";
+const uint8_t TIncrement::binary_fingerprint[16] = {0x5F,0x99,0x65,0xD4,0x6A,0x4F,0x38,0x45,0x98,0x5A,0xC0,0xF9,0xB8,0x1C,0x3C,0x69};
+
+uint32_t TIncrement::read(::apache::thrift::protocol::TProtocol* iprot) {
+
+ uint32_t xfer = 0;
+ std::string fname;
+ ::apache::thrift::protocol::TType ftype;
+ int16_t fid;
+
+ xfer += iprot->readStructBegin(fname);
+
+ using ::apache::thrift::protocol::TProtocolException;
+
+
+ while (true)
+ {
+ xfer += iprot->readFieldBegin(fname, ftype, fid);
+ if (ftype == ::apache::thrift::protocol::T_STOP) {
+ break;
+ }
+ switch (fid)
+ {
+ case 1:
+ if (ftype == ::apache::thrift::protocol::T_STRING) {
+ xfer += iprot->readBinary(this->table);
+ this->__isset.table = true;
+ } else {
+ xfer += iprot->skip(ftype);
+ }
+ break;
+ case 2:
+ if (ftype == ::apache::thrift::protocol::T_STRING) {
+ xfer += iprot->readBinary(this->row);
+ this->__isset.row = true;
+ } else {
+ xfer += iprot->skip(ftype);
+ }
+ break;
+ case 3:
+ if (ftype == ::apache::thrift::protocol::T_STRING) {
+ xfer += iprot->readBinary(this->column);
+ this->__isset.column = true;
+ } else {
+ xfer += iprot->skip(ftype);
+ }
+ break;
+ case 4:
+ if (ftype == ::apache::thrift::protocol::T_I64) {
+ xfer += iprot->readI64(this->ammount);
+ this->__isset.ammount = true;
+ } else {
+ xfer += iprot->skip(ftype);
+ }
+ break;
+ default:
+ xfer += iprot->skip(ftype);
+ break;
+ }
+ xfer += iprot->readFieldEnd();
+ }
+
+ xfer += iprot->readStructEnd();
+
+ return xfer;
+}
+
+uint32_t TIncrement::write(::apache::thrift::protocol::TProtocol* oprot) const {
+ uint32_t xfer = 0;
+ xfer += oprot->writeStructBegin("TIncrement");
+
+ xfer += oprot->writeFieldBegin("table", ::apache::thrift::protocol::T_STRING, 1);
+ xfer += oprot->writeBinary(this->table);
+ xfer += oprot->writeFieldEnd();
+
+ xfer += oprot->writeFieldBegin("row", ::apache::thrift::protocol::T_STRING, 2);
+ xfer += oprot->writeBinary(this->row);
+ xfer += oprot->writeFieldEnd();
+
+ xfer += oprot->writeFieldBegin("column", ::apache::thrift::protocol::T_STRING, 3);
+ xfer += oprot->writeBinary(this->column);
+ xfer += oprot->writeFieldEnd();
+
+ xfer += oprot->writeFieldBegin("ammount", ::apache::thrift::protocol::T_I64, 4);
+ xfer += oprot->writeI64(this->ammount);
+ xfer += oprot->writeFieldEnd();
+
+ xfer += oprot->writeFieldStop();
+ xfer += oprot->writeStructEnd();
+ return xfer;
+}
+
+void swap(TIncrement &a, TIncrement &b) {
+ using ::std::swap;
+ swap(a.table, b.table);
+ swap(a.row, b.row);
+ swap(a.column, b.column);
+ swap(a.ammount, b.ammount);
+ swap(a.__isset, b.__isset);
+}
+
+const char* TRowResult::ascii_fingerprint = "AE98EA4F344566FAFE04FA5E5823D1ED";
+const uint8_t TRowResult::binary_fingerprint[16] = {0xAE,0x98,0xEA,0x4F,0x34,0x45,0x66,0xFA,0xFE,0x04,0xFA,0x5E,0x58,0x23,0xD1,0xED};
+
+uint32_t TRowResult::read(::apache::thrift::protocol::TProtocol* iprot) {
+
+ uint32_t xfer = 0;
+ std::string fname;
+ ::apache::thrift::protocol::TType ftype;
+ int16_t fid;
+
+ xfer += iprot->readStructBegin(fname);
+
+ using ::apache::thrift::protocol::TProtocolException;
+
+
+ while (true)
+ {
+ xfer += iprot->readFieldBegin(fname, ftype, fid);
+ if (ftype == ::apache::thrift::protocol::T_STOP) {
+ break;
+ }
+ switch (fid)
+ {
+ case 1:
+ if (ftype == ::apache::thrift::protocol::T_STRING) {
+ xfer += iprot->readBinary(this->row);
+ this->__isset.row = true;
+ } else {
+ xfer += iprot->skip(ftype);
+ }
+ break;
+ case 2:
+ if (ftype == ::apache::thrift::protocol::T_MAP) {
+ {
+ this->columns.clear();
+ uint32_t _size6;
+ ::apache::thrift::protocol::TType _ktype7;
+ ::apache::thrift::protocol::TType _vtype8;
+ xfer += iprot->readMapBegin(_ktype7, _vtype8, _size6);
+ uint32_t _i10;
+ for (_i10 = 0; _i10 < _size6; ++_i10)
+ {
+ Text _key11;
+ xfer += iprot->readBinary(_key11);
+ TCell& _val12 = this->columns[_key11];
+ xfer += _val12.read(iprot);
+ }
+ xfer += iprot->readMapEnd();
+ }
+ this->__isset.columns = true;
+ } else {
+ xfer += iprot->skip(ftype);
+ }
+ break;
+ default:
+ xfer += iprot->skip(ftype);
+ break;
+ }
+ xfer += iprot->readFieldEnd();
+ }
+
+ xfer += iprot->readStructEnd();
+
+ return xfer;
+}
+
+uint32_t TRowResult::write(::apache::thrift::protocol::TProtocol* oprot) const {
+ uint32_t xfer = 0;
+ xfer += oprot->writeStructBegin("TRowResult");
+
+ xfer += oprot->writeFieldBegin("row", ::apache::thrift::protocol::T_STRING, 1);
+ xfer += oprot->writeBinary(this->row);
+ xfer += oprot->writeFieldEnd();
+
+ xfer += oprot->writeFieldBegin("columns", ::apache::thrift::protocol::T_MAP, 2);
+ {
+ xfer += oprot->writeMapBegin(::apache::thrift::protocol::T_STRING, ::apache::thrift::protocol::T_STRUCT, static_cast<uint32_t>(this->columns.size()));
+ std::map<Text, TCell> ::const_iterator _iter13;
+ for (_iter13 = this->columns.begin(); _iter13 != this->columns.end(); ++_iter13)
+ {
+ xfer += oprot->writeBinary(_iter13->first);
+ xfer += _iter13->second.write(oprot);
+ }
+ xfer += oprot->writeMapEnd();
+ }
+ xfer += oprot->writeFieldEnd();
+
+ xfer += oprot->writeFieldStop();
+ xfer += oprot->writeStructEnd();
+ return xfer;
+}
+
+void swap(TRowResult &a, TRowResult &b) {
+ using ::std::swap;
+ swap(a.row, b.row);
+ swap(a.columns, b.columns);
+ swap(a.__isset, b.__isset);
+}
+
+const char* TScan::ascii_fingerprint = "2C111FDF8CD162886ECCCBB9C9051083";
+const uint8_t TScan::binary_fingerprint[16] = {0x2C,0x11,0x1F,0xDF,0x8C,0xD1,0x62,0x88,0x6E,0xCC,0xCB,0xB9,0xC9,0x05,0x10,0x83};
+
+uint32_t TScan::read(::apache::thrift::protocol::TProtocol* iprot) {
+
+ uint32_t xfer = 0;
+ std::string fname;
+ ::apache::thrift::protocol::TType ftype;
+ int16_t fid;
+
+ xfer += iprot->readStructBegin(fname);
+
+ using ::apache::thrift::protocol::TProtocolException;
+
+
+ while (true)
+ {
+ xfer += iprot->readFieldBegin(fname, ftype, fid);
+ if (ftype == ::apache::thrift::protocol::T_STOP) {
+ break;
+ }
+ switch (fid)
+ {
+ case 1:
+ if (ftype == ::apache::thrift::protocol::T_STRING) {
+ xfer += iprot->readBinary(this->startRow);
+ this->__isset.startRow = true;
+ } else {
+ xfer += iprot->skip(ftype);
+ }
+ break;
+ case 2:
+ if (ftype == ::apache::thrift::protocol::T_STRING) {
+ xfer += iprot->readBinary(this->stopRow);
+ this->__isset.stopRow = true;
+ } else {
+ xfer += iprot->skip(ftype);
+ }
+ break;
+ case 3:
+ if (ftype == ::apache::thrift::protocol::T_I64) {
+ xfer += iprot->readI64(this->timestamp);
+ this->__isset.timestamp = true;
+ } else {
+ xfer += iprot->skip(ftype);
+ }
+ break;
+ case 4:
+ if (ftype == ::apache::thrift::protocol::T_LIST) {
+ {
+ this->columns.clear();
+ uint32_t _size14;
+ ::apache::thrift::protocol::TType _etype17;
+ xfer += iprot->readListBegin(_etype17, _size14);
+ this->columns.resize(_size14);
+ uint32_t _i18;
+ for (_i18 = 0; _i18 < _size14; ++_i18)
+ {
+ xfer += iprot->readBinary(this->columns[_i18]);
+ }
+ xfer += iprot->readListEnd();
+ }
+ this->__isset.columns = true;
+ } else {
+ xfer += iprot->skip(ftype);
+ }
+ break;
+ case 5:
+ if (ftype == ::apache::thrift::protocol::T_I32) {
+ xfer += iprot->readI32(this->caching);
+ this->__isset.caching = true;
+ } else {
+ xfer += iprot->skip(ftype);
+ }
+ break;
+ case 6:
+ if (ftype == ::apache::thrift::protocol::T_STRING) {
+ xfer += iprot->readBinary(this->filterString);
+ this->__isset.filterString = true;
+ } else {
+ xfer += iprot->skip(ftype);
+ }
+ break;
+ default:
+ xfer += iprot->skip(ftype);
+ break;
+ }
+ xfer += iprot->readFieldEnd();
+ }
+
+ xfer += iprot->readStructEnd();
+
+ return xfer;
+}
+
+uint32_t TScan::write(::apache::thrift::protocol::TProtocol* oprot) const {
+ uint32_t xfer = 0;
+ xfer += oprot->writeStructBegin("TScan");
+
+ if (this->__isset.startRow) {
+ xfer += oprot->writeFieldBegin("startRow", ::apache::thrift::protocol::T_STRING, 1);
+ xfer += oprot->writeBinary(this->startRow);
+ xfer += oprot->writeFieldEnd();
+ }
+ if (this->__isset.stopRow) {
+ xfer += oprot->writeFieldBegin("stopRow", ::apache::thrift::protocol::T_STRING, 2);
+ xfer += oprot->writeBinary(this->stopRow);
+ xfer += oprot->writeFieldEnd();
+ }
+ if (this->__isset.timestamp) {
+ xfer += oprot->writeFieldBegin("timestamp", ::apache::thrift::protocol::T_I64, 3);
+ xfer += oprot->writeI64(this->timestamp);
+ xfer += oprot->writeFieldEnd();
+ }
+ if (this->__isset.columns) {
+ xfer += oprot->writeFieldBegin("columns", ::apache::thrift::protocol::T_LIST, 4);
+ {
+ xfer += oprot->writeListBegin(::apache::thrift::protocol::T_STRING, static_cast<uint32_t>(this->columns.size()));
+ std::vector<Text> ::const_iterator _iter19;
+ for (_iter19 = this->columns.begin(); _iter19 != this->columns.end(); ++_iter19)
+ {
+ xfer += oprot->writeBinary((*_iter19));
+ }
+ xfer += oprot->writeListEnd();
+ }
+ xfer += oprot->writeFieldEnd();
+ }
+ if (this->__isset.caching) {
+ xfer += oprot->writeFieldBegin("caching", ::apache::thrift::protocol::T_I32, 5);
+ xfer += oprot->writeI32(this->caching);
+ xfer += oprot->writeFieldEnd();
+ }
+ if (this->__isset.filterString) {
+ xfer += oprot->writeFieldBegin("filterString", ::apache::thrift::protocol::T_STRING, 6);
+ xfer += oprot->writeBinary(this->filterString);
+ xfer += oprot->writeFieldEnd();
+ }
+ xfer += oprot->writeFieldStop();
+ xfer += oprot->writeStructEnd();
+ return xfer;
+}
+
+void swap(TScan &a, TScan &b) {
+ using ::std::swap;
+ swap(a.startRow, b.startRow);
+ swap(a.stopRow, b.stopRow);
+ swap(a.timestamp, b.timestamp);
+ swap(a.columns, b.columns);
+ swap(a.caching, b.caching);
+ swap(a.filterString, b.filterString);
+ swap(a.__isset, b.__isset);
+}
+
+const char* IOError::ascii_fingerprint = "EFB929595D312AC8F305D5A794CFEDA1";
+const uint8_t IOError::binary_fingerprint[16] = {0xEF,0xB9,0x29,0x59,0x5D,0x31,0x2A,0xC8,0xF3,0x05,0xD5,0xA7,0x94,0xCF,0xED,0xA1};
+
+uint32_t IOError::read(::apache::thrift::protocol::TProtocol* iprot) {
+
+ uint32_t xfer = 0;
+ std::string fname;
+ ::apache::thrift::protocol::TType ftype;
+ int16_t fid;
+
+ xfer += iprot->readStructBegin(fname);
+
+ using ::apache::thrift::protocol::TProtocolException;
+
+
+ while (true)
+ {
+ xfer += iprot->readFieldBegin(fname, ftype, fid);
+ if (ftype == ::apache::thrift::protocol::T_STOP) {
+ break;
+ }
+ switch (fid)
+ {
+ case 1:
+ if (ftype == ::apache::thrift::protocol::T_STRING) {
+ xfer += iprot->readString(this->message);
+ this->__isset.message = true;
+ } else {
+ xfer += iprot->skip(ftype);
+ }
+ break;
+ default:
+ xfer += iprot->skip(ftype);
+ break;
+ }
+ xfer += iprot->readFieldEnd();
+ }
+
+ xfer += iprot->readStructEnd();
+
+ return xfer;
+}
+
+uint32_t IOError::write(::apache::thrift::protocol::TProtocol* oprot) const {
+ uint32_t xfer = 0;
+ xfer += oprot->writeStructBegin("IOError");
+
+ xfer += oprot->writeFieldBegin("message", ::apache::thrift::protocol::T_STRING, 1);
+ xfer += oprot->writeString(this->message);
+ xfer += oprot->writeFieldEnd();
+
+ xfer += oprot->writeFieldStop();
+ xfer += oprot->writeStructEnd();
+ return xfer;
+}
+
+void swap(IOError &a, IOError &b) {
+ using ::std::swap;
+ swap(a.message, b.message);
+ swap(a.__isset, b.__isset);
+}
+
+const char* IllegalArgument::ascii_fingerprint = "EFB929595D312AC8F305D5A794CFEDA1";
+const uint8_t IllegalArgument::binary_fingerprint[16] = {0xEF,0xB9,0x29,0x59,0x5D,0x31,0x2A,0xC8,0xF3,0x05,0xD5,0xA7,0x94,0xCF,0xED,0xA1};
+
+uint32_t IllegalArgument::read(::apache::thrift::protocol::TProtocol* iprot) {
+
+ uint32_t xfer = 0;
+ std::string fname;
+ ::apache::thrift::protocol::TType ftype;
+ int16_t fid;
+
+ xfer += iprot->readStructBegin(fname);
+
+ using ::apache::thrift::protocol::TProtocolException;
+
+
+ while (true)
+ {
+ xfer += iprot->readFieldBegin(fname, ftype, fid);
+ if (ftype == ::apache::thrift::protocol::T_STOP) {
+ break;
+ }
+ switch (fid)
+ {
+ case 1:
+ if (ftype == ::apache::thrift::protocol::T_STRING) {
+ xfer += iprot->readString(this->message);
+ this->__isset.message = true;
+ } else {
+ xfer += iprot->skip(ftype);
+ }
+ break;
+ default:
+ xfer += iprot->skip(ftype);
+ break;
+ }
+ xfer += iprot->readFieldEnd();
+ }
+
+ xfer += iprot->readStructEnd();
+
+ return xfer;
+}
+
+uint32_t IllegalArgument::write(::apache::thrift::protocol::TProtocol* oprot) const {
+ uint32_t xfer = 0;
+ xfer += oprot->writeStructBegin("IllegalArgument");
+
+ xfer += oprot->writeFieldBegin("message", ::apache::thrift::protocol::T_STRING, 1);
+ xfer += oprot->writeString(this->message);
+ xfer += oprot->writeFieldEnd();
+
+ xfer += oprot->writeFieldStop();
+ xfer += oprot->writeStructEnd();
+ return xfer;
+}
+
+void swap(IllegalArgument &a, IllegalArgument &b) {
+ using ::std::swap;
+ swap(a.message, b.message);
+ swap(a.__isset, b.__isset);
+}
+
+const char* AlreadyExists::ascii_fingerprint = "EFB929595D312AC8F305D5A794CFEDA1";
+const uint8_t AlreadyExists::binary_fingerprint[16] = {0xEF,0xB9,0x29,0x59,0x5D,0x31,0x2A,0xC8,0xF3,0x05,0xD5,0xA7,0x94,0xCF,0xED,0xA1};
+
+uint32_t AlreadyExists::read(::apache::thrift::protocol::TProtocol* iprot) {
+
+ uint32_t xfer = 0;
+ std::string fname;
+ ::apache::thrift::protocol::TType ftype;
+ int16_t fid;
+
+ xfer += iprot->readStructBegin(fname);
+
+ using ::apache::thrift::protocol::TProtocolException;
+
+
+ while (true)
+ {
+ xfer += iprot->readFieldBegin(fname, ftype, fid);
+ if (ftype == ::apache::thrift::protocol::T_STOP) {
+ break;
+ }
+ switch (fid)
+ {
+ case 1:
+ if (ftype == ::apache::thrift::protocol::T_STRING) {
+ xfer += iprot->readString(this->message);
+ this->__isset.message = true;
+ } else {
+ xfer += iprot->skip(ftype);
+ }
+ break;
+ default:
+ xfer += iprot->skip(ftype);
+ break;
+ }
+ xfer += iprot->readFieldEnd();
+ }
+
+ xfer += iprot->readStructEnd();
+
+ return xfer;
+}
+
+uint32_t AlreadyExists::write(::apache::thrift::protocol::TProtocol* oprot) const {
+ uint32_t xfer = 0;
+ xfer += oprot->writeStructBegin("AlreadyExists");
+
+ xfer += oprot->writeFieldBegin("message", ::apache::thrift::protocol::T_STRING, 1);
+ xfer += oprot->writeString(this->message);
+ xfer += oprot->writeFieldEnd();
+
+ xfer += oprot->writeFieldStop();
+ xfer += oprot->writeStructEnd();
+ return xfer;
+}
+
+void swap(AlreadyExists &a, AlreadyExists &b) {
+ using ::std::swap;
+ swap(a.message, b.message);
+ swap(a.__isset, b.__isset);
+}
+
+}}}} // namespace
Added: hbase/trunk/hbase-examples/src/main/cpp/gen-cpp/Hbase_types.h
URL: http://svn.apache.org/viewvc/hbase/trunk/hbase-examples/src/main/cpp/gen-cpp/Hbase_types.h?rev=1406339&view=auto
==============================================================================
--- hbase/trunk/hbase-examples/src/main/cpp/gen-cpp/Hbase_types.h (added)
+++ hbase/trunk/hbase-examples/src/main/cpp/gen-cpp/Hbase_types.h Tue Nov 6 21:22:27 2012
@@ -0,0 +1,742 @@
+/**
+ * Autogenerated by Thrift Compiler (0.9.0)
+ *
+ * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
+ * @generated
+ */
+#ifndef Hbase_TYPES_H
+#define Hbase_TYPES_H
+
+#include <thrift/Thrift.h>
+#include <thrift/TApplicationException.h>
+#include <thrift/protocol/TProtocol.h>
+#include <thrift/transport/TTransport.h>
+
+
+
+namespace apache { namespace hadoop { namespace hbase { namespace thrift {
+
+typedef std::string Text;
+
+typedef std::string Bytes;
+
+typedef int32_t ScannerID;
+
+typedef struct _TCell__isset {
+ _TCell__isset() : value(false), timestamp(false) {}
+ bool value;
+ bool timestamp;
+} _TCell__isset;
+
+class TCell {
+ public:
+
+ static const char* ascii_fingerprint; // = "1CCCF6FC31CFD1D61BBBB1BAF3590620";
+ static const uint8_t binary_fingerprint[16]; // = {0x1C,0xCC,0xF6,0xFC,0x31,0xCF,0xD1,0xD6,0x1B,0xBB,0xB1,0xBA,0xF3,0x59,0x06,0x20};
+
+ TCell() : value(), timestamp(0) {
+ }
+
+ virtual ~TCell() throw() {}
+
+ Bytes value;
+ int64_t timestamp;
+
+ _TCell__isset __isset;
+
+ void __set_value(const Bytes& val) {
+ value = val;
+ }
+
+ void __set_timestamp(const int64_t val) {
+ timestamp = val;
+ }
+
+ bool operator == (const TCell & rhs) const
+ {
+ if (!(value == rhs.value))
+ return false;
+ if (!(timestamp == rhs.timestamp))
+ return false;
+ return true;
+ }
+ bool operator != (const TCell &rhs) const {
+ return !(*this == rhs);
+ }
+
+ bool operator < (const TCell & ) const;
+
+ uint32_t read(::apache::thrift::protocol::TProtocol* iprot);
+ uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const;
+
+};
+
+void swap(TCell &a, TCell &b);
+
+typedef struct _ColumnDescriptor__isset {
+ _ColumnDescriptor__isset() : name(false), maxVersions(true), compression(true), inMemory(true), bloomFilterType(true), bloomFilterVectorSize(true), bloomFilterNbHashes(true), blockCacheEnabled(true), timeToLive(true) {}
+ bool name;
+ bool maxVersions;
+ bool compression;
+ bool inMemory;
+ bool bloomFilterType;
+ bool bloomFilterVectorSize;
+ bool bloomFilterNbHashes;
+ bool blockCacheEnabled;
+ bool timeToLive;
+} _ColumnDescriptor__isset;
+
+class ColumnDescriptor {
+ public:
+
+ static const char* ascii_fingerprint; // = "3B18638852FDF9DD911BC1174265F92E";
+ static const uint8_t binary_fingerprint[16]; // = {0x3B,0x18,0x63,0x88,0x52,0xFD,0xF9,0xDD,0x91,0x1B,0xC1,0x17,0x42,0x65,0xF9,0x2E};
+
+ ColumnDescriptor() : name(), maxVersions(3), compression("NONE"), inMemory(false), bloomFilterType("NONE"), bloomFilterVectorSize(0), bloomFilterNbHashes(0), blockCacheEnabled(false), timeToLive(-1) {
+ }
+
+ virtual ~ColumnDescriptor() throw() {}
+
+ Text name;
+ int32_t maxVersions;
+ std::string compression;
+ bool inMemory;
+ std::string bloomFilterType;
+ int32_t bloomFilterVectorSize;
+ int32_t bloomFilterNbHashes;
+ bool blockCacheEnabled;
+ int32_t timeToLive;
+
+ _ColumnDescriptor__isset __isset;
+
+ void __set_name(const Text& val) {
+ name = val;
+ }
+
+ void __set_maxVersions(const int32_t val) {
+ maxVersions = val;
+ }
+
+ void __set_compression(const std::string& val) {
+ compression = val;
+ }
+
+ void __set_inMemory(const bool val) {
+ inMemory = val;
+ }
+
+ void __set_bloomFilterType(const std::string& val) {
+ bloomFilterType = val;
+ }
+
+ void __set_bloomFilterVectorSize(const int32_t val) {
+ bloomFilterVectorSize = val;
+ }
+
+ void __set_bloomFilterNbHashes(const int32_t val) {
+ bloomFilterNbHashes = val;
+ }
+
+ void __set_blockCacheEnabled(const bool val) {
+ blockCacheEnabled = val;
+ }
+
+ void __set_timeToLive(const int32_t val) {
+ timeToLive = val;
+ }
+
+ bool operator == (const ColumnDescriptor & rhs) const
+ {
+ if (!(name == rhs.name))
+ return false;
+ if (!(maxVersions == rhs.maxVersions))
+ return false;
+ if (!(compression == rhs.compression))
+ return false;
+ if (!(inMemory == rhs.inMemory))
+ return false;
+ if (!(bloomFilterType == rhs.bloomFilterType))
+ return false;
+ if (!(bloomFilterVectorSize == rhs.bloomFilterVectorSize))
+ return false;
+ if (!(bloomFilterNbHashes == rhs.bloomFilterNbHashes))
+ return false;
+ if (!(blockCacheEnabled == rhs.blockCacheEnabled))
+ return false;
+ if (!(timeToLive == rhs.timeToLive))
+ return false;
+ return true;
+ }
+ bool operator != (const ColumnDescriptor &rhs) const {
+ return !(*this == rhs);
+ }
+
+ bool operator < (const ColumnDescriptor & ) const;
+
+ uint32_t read(::apache::thrift::protocol::TProtocol* iprot);
+ uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const;
+
+};
+
+void swap(ColumnDescriptor &a, ColumnDescriptor &b);
+
+typedef struct _TRegionInfo__isset {
+ _TRegionInfo__isset() : startKey(false), endKey(false), id(false), name(false), version(false), serverName(false), port(false) {}
+ bool startKey;
+ bool endKey;
+ bool id;
+ bool name;
+ bool version;
+ bool serverName;
+ bool port;
+} _TRegionInfo__isset;
+
+class TRegionInfo {
+ public:
+
+ static const char* ascii_fingerprint; // = "B58AB7A239831F8614F7B6709C89DC7B";
+ static const uint8_t binary_fingerprint[16]; // = {0xB5,0x8A,0xB7,0xA2,0x39,0x83,0x1F,0x86,0x14,0xF7,0xB6,0x70,0x9C,0x89,0xDC,0x7B};
+
+ TRegionInfo() : startKey(), endKey(), id(0), name(), version(0), serverName(), port(0) {
+ }
+
+ virtual ~TRegionInfo() throw() {}
+
+ Text startKey;
+ Text endKey;
+ int64_t id;
+ Text name;
+ int8_t version;
+ Text serverName;
+ int32_t port;
+
+ _TRegionInfo__isset __isset;
+
+ void __set_startKey(const Text& val) {
+ startKey = val;
+ }
+
+ void __set_endKey(const Text& val) {
+ endKey = val;
+ }
+
+ void __set_id(const int64_t val) {
+ id = val;
+ }
+
+ void __set_name(const Text& val) {
+ name = val;
+ }
+
+ void __set_version(const int8_t val) {
+ version = val;
+ }
+
+ void __set_serverName(const Text& val) {
+ serverName = val;
+ }
+
+ void __set_port(const int32_t val) {
+ port = val;
+ }
+
+ bool operator == (const TRegionInfo & rhs) const
+ {
+ if (!(startKey == rhs.startKey))
+ return false;
+ if (!(endKey == rhs.endKey))
+ return false;
+ if (!(id == rhs.id))
+ return false;
+ if (!(name == rhs.name))
+ return false;
+ if (!(version == rhs.version))
+ return false;
+ if (!(serverName == rhs.serverName))
+ return false;
+ if (!(port == rhs.port))
+ return false;
+ return true;
+ }
+ bool operator != (const TRegionInfo &rhs) const {
+ return !(*this == rhs);
+ }
+
+ bool operator < (const TRegionInfo & ) const;
+
+ uint32_t read(::apache::thrift::protocol::TProtocol* iprot);
+ uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const;
+
+};
+
+void swap(TRegionInfo &a, TRegionInfo &b);
+
+typedef struct _Mutation__isset {
+ _Mutation__isset() : isDelete(true), column(false), value(false), writeToWAL(true) {}
+ bool isDelete;
+ bool column;
+ bool value;
+ bool writeToWAL;
+} _Mutation__isset;
+
+class Mutation {
+ public:
+
+ static const char* ascii_fingerprint; // = "CD9E9D4A6406AD402C90440434AE18A0";
+ static const uint8_t binary_fingerprint[16]; // = {0xCD,0x9E,0x9D,0x4A,0x64,0x06,0xAD,0x40,0x2C,0x90,0x44,0x04,0x34,0xAE,0x18,0xA0};
+
+ Mutation() : isDelete(false), column(), value(), writeToWAL(true) {
+ }
+
+ virtual ~Mutation() throw() {}
+
+ bool isDelete;
+ Text column;
+ Text value;
+ bool writeToWAL;
+
+ _Mutation__isset __isset;
+
+ void __set_isDelete(const bool val) {
+ isDelete = val;
+ }
+
+ void __set_column(const Text& val) {
+ column = val;
+ }
+
+ void __set_value(const Text& val) {
+ value = val;
+ }
+
+ void __set_writeToWAL(const bool val) {
+ writeToWAL = val;
+ }
+
+ bool operator == (const Mutation & rhs) const
+ {
+ if (!(isDelete == rhs.isDelete))
+ return false;
+ if (!(column == rhs.column))
+ return false;
+ if (!(value == rhs.value))
+ return false;
+ if (!(writeToWAL == rhs.writeToWAL))
+ return false;
+ return true;
+ }
+ bool operator != (const Mutation &rhs) const {
+ return !(*this == rhs);
+ }
+
+ bool operator < (const Mutation & ) const;
+
+ uint32_t read(::apache::thrift::protocol::TProtocol* iprot);
+ uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const;
+
+};
+
+void swap(Mutation &a, Mutation &b);
+
+typedef struct _BatchMutation__isset {
+ _BatchMutation__isset() : row(false), mutations(false) {}
+ bool row;
+ bool mutations;
+} _BatchMutation__isset;
+
+class BatchMutation {
+ public:
+
+ static const char* ascii_fingerprint; // = "4B8A4A9E051CAFF532E1C0D54F6AD2AB";
+ static const uint8_t binary_fingerprint[16]; // = {0x4B,0x8A,0x4A,0x9E,0x05,0x1C,0xAF,0xF5,0x32,0xE1,0xC0,0xD5,0x4F,0x6A,0xD2,0xAB};
+
+ BatchMutation() : row() {
+ }
+
+ virtual ~BatchMutation() throw() {}
+
+ Text row;
+ std::vector<Mutation> mutations;
+
+ _BatchMutation__isset __isset;
+
+ void __set_row(const Text& val) {
+ row = val;
+ }
+
+ void __set_mutations(const std::vector<Mutation> & val) {
+ mutations = val;
+ }
+
+ bool operator == (const BatchMutation & rhs) const
+ {
+ if (!(row == rhs.row))
+ return false;
+ if (!(mutations == rhs.mutations))
+ return false;
+ return true;
+ }
+ bool operator != (const BatchMutation &rhs) const {
+ return !(*this == rhs);
+ }
+
+ bool operator < (const BatchMutation & ) const;
+
+ uint32_t read(::apache::thrift::protocol::TProtocol* iprot);
+ uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const;
+
+};
+
+void swap(BatchMutation &a, BatchMutation &b);
+
+typedef struct _TIncrement__isset {
+ _TIncrement__isset() : table(false), row(false), column(false), ammount(false) {}
+ bool table;
+ bool row;
+ bool column;
+ bool ammount;
+} _TIncrement__isset;
+
+class TIncrement {
+ public:
+
+ static const char* ascii_fingerprint; // = "5F9965D46A4F3845985AC0F9B81C3C69";
+ static const uint8_t binary_fingerprint[16]; // = {0x5F,0x99,0x65,0xD4,0x6A,0x4F,0x38,0x45,0x98,0x5A,0xC0,0xF9,0xB8,0x1C,0x3C,0x69};
+
+ TIncrement() : table(), row(), column(), ammount(0) {
+ }
+
+ virtual ~TIncrement() throw() {}
+
+ Text table;
+ Text row;
+ Text column;
+ int64_t ammount;
+
+ _TIncrement__isset __isset;
+
+ void __set_table(const Text& val) {
+ table = val;
+ }
+
+ void __set_row(const Text& val) {
+ row = val;
+ }
+
+ void __set_column(const Text& val) {
+ column = val;
+ }
+
+ void __set_ammount(const int64_t val) {
+ ammount = val;
+ }
+
+ bool operator == (const TIncrement & rhs) const
+ {
+ if (!(table == rhs.table))
+ return false;
+ if (!(row == rhs.row))
+ return false;
+ if (!(column == rhs.column))
+ return false;
+ if (!(ammount == rhs.ammount))
+ return false;
+ return true;
+ }
+ bool operator != (const TIncrement &rhs) const {
+ return !(*this == rhs);
+ }
+
+ bool operator < (const TIncrement & ) const;
+
+ uint32_t read(::apache::thrift::protocol::TProtocol* iprot);
+ uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const;
+
+};
+
+void swap(TIncrement &a, TIncrement &b);
+
+typedef struct _TRowResult__isset {
+ _TRowResult__isset() : row(false), columns(false) {}
+ bool row;
+ bool columns;
+} _TRowResult__isset;
+
+class TRowResult {
+ public:
+
+ static const char* ascii_fingerprint; // = "AE98EA4F344566FAFE04FA5E5823D1ED";
+ static const uint8_t binary_fingerprint[16]; // = {0xAE,0x98,0xEA,0x4F,0x34,0x45,0x66,0xFA,0xFE,0x04,0xFA,0x5E,0x58,0x23,0xD1,0xED};
+
+ TRowResult() : row() {
+ }
+
+ virtual ~TRowResult() throw() {}
+
+ Text row;
+ std::map<Text, TCell> columns;
+
+ _TRowResult__isset __isset;
+
+ void __set_row(const Text& val) {
+ row = val;
+ }
+
+ void __set_columns(const std::map<Text, TCell> & val) {
+ columns = val;
+ }
+
+ bool operator == (const TRowResult & rhs) const
+ {
+ if (!(row == rhs.row))
+ return false;
+ if (!(columns == rhs.columns))
+ return false;
+ return true;
+ }
+ bool operator != (const TRowResult &rhs) const {
+ return !(*this == rhs);
+ }
+
+ bool operator < (const TRowResult & ) const;
+
+ uint32_t read(::apache::thrift::protocol::TProtocol* iprot);
+ uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const;
+
+};
+
+void swap(TRowResult &a, TRowResult &b);
+
+typedef struct _TScan__isset {
+ _TScan__isset() : startRow(false), stopRow(false), timestamp(false), columns(false), caching(false), filterString(false) {}
+ bool startRow;
+ bool stopRow;
+ bool timestamp;
+ bool columns;
+ bool caching;
+ bool filterString;
+} _TScan__isset;
+
+class TScan {
+ public:
+
+ static const char* ascii_fingerprint; // = "2C111FDF8CD162886ECCCBB9C9051083";
+ static const uint8_t binary_fingerprint[16]; // = {0x2C,0x11,0x1F,0xDF,0x8C,0xD1,0x62,0x88,0x6E,0xCC,0xCB,0xB9,0xC9,0x05,0x10,0x83};
+
+ TScan() : startRow(), stopRow(), timestamp(0), caching(0), filterString() {
+ }
+
+ virtual ~TScan() throw() {}
+
+ Text startRow;
+ Text stopRow;
+ int64_t timestamp;
+ std::vector<Text> columns;
+ int32_t caching;
+ Text filterString;
+
+ _TScan__isset __isset;
+
+ void __set_startRow(const Text& val) {
+ startRow = val;
+ __isset.startRow = true;
+ }
+
+ void __set_stopRow(const Text& val) {
+ stopRow = val;
+ __isset.stopRow = true;
+ }
+
+ void __set_timestamp(const int64_t val) {
+ timestamp = val;
+ __isset.timestamp = true;
+ }
+
+ void __set_columns(const std::vector<Text> & val) {
+ columns = val;
+ __isset.columns = true;
+ }
+
+ void __set_caching(const int32_t val) {
+ caching = val;
+ __isset.caching = true;
+ }
+
+ void __set_filterString(const Text& val) {
+ filterString = val;
+ __isset.filterString = true;
+ }
+
+ bool operator == (const TScan & rhs) const
+ {
+ if (__isset.startRow != rhs.__isset.startRow)
+ return false;
+ else if (__isset.startRow && !(startRow == rhs.startRow))
+ return false;
+ if (__isset.stopRow != rhs.__isset.stopRow)
+ return false;
+ else if (__isset.stopRow && !(stopRow == rhs.stopRow))
+ return false;
+ if (__isset.timestamp != rhs.__isset.timestamp)
+ return false;
+ else if (__isset.timestamp && !(timestamp == rhs.timestamp))
+ return false;
+ if (__isset.columns != rhs.__isset.columns)
+ return false;
+ else if (__isset.columns && !(columns == rhs.columns))
+ return false;
+ if (__isset.caching != rhs.__isset.caching)
+ return false;
+ else if (__isset.caching && !(caching == rhs.caching))
+ return false;
+ if (__isset.filterString != rhs.__isset.filterString)
+ return false;
+ else if (__isset.filterString && !(filterString == rhs.filterString))
+ return false;
+ return true;
+ }
+ bool operator != (const TScan &rhs) const {
+ return !(*this == rhs);
+ }
+
+ bool operator < (const TScan & ) const;
+
+ uint32_t read(::apache::thrift::protocol::TProtocol* iprot);
+ uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const;
+
+};
+
+void swap(TScan &a, TScan &b);
+
+typedef struct _IOError__isset {
+ _IOError__isset() : message(false) {}
+ bool message;
+} _IOError__isset;
+
+class IOError : public ::apache::thrift::TException {
+ public:
+
+ static const char* ascii_fingerprint; // = "EFB929595D312AC8F305D5A794CFEDA1";
+ static const uint8_t binary_fingerprint[16]; // = {0xEF,0xB9,0x29,0x59,0x5D,0x31,0x2A,0xC8,0xF3,0x05,0xD5,0xA7,0x94,0xCF,0xED,0xA1};
+
+ IOError() : message() {
+ }
+
+ virtual ~IOError() throw() {}
+
+ std::string message;
+
+ _IOError__isset __isset;
+
+ void __set_message(const std::string& val) {
+ message = val;
+ }
+
+ bool operator == (const IOError & rhs) const
+ {
+ if (!(message == rhs.message))
+ return false;
+ return true;
+ }
+ bool operator != (const IOError &rhs) const {
+ return !(*this == rhs);
+ }
+
+ bool operator < (const IOError & ) const;
+
+ uint32_t read(::apache::thrift::protocol::TProtocol* iprot);
+ uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const;
+
+};
+
+void swap(IOError &a, IOError &b);
+
+typedef struct _IllegalArgument__isset {
+ _IllegalArgument__isset() : message(false) {}
+ bool message;
+} _IllegalArgument__isset;
+
+class IllegalArgument : public ::apache::thrift::TException {
+ public:
+
+ static const char* ascii_fingerprint; // = "EFB929595D312AC8F305D5A794CFEDA1";
+ static const uint8_t binary_fingerprint[16]; // = {0xEF,0xB9,0x29,0x59,0x5D,0x31,0x2A,0xC8,0xF3,0x05,0xD5,0xA7,0x94,0xCF,0xED,0xA1};
+
+ IllegalArgument() : message() {
+ }
+
+ virtual ~IllegalArgument() throw() {}
+
+ std::string message;
+
+ _IllegalArgument__isset __isset;
+
+ void __set_message(const std::string& val) {
+ message = val;
+ }
+
+ bool operator == (const IllegalArgument & rhs) const
+ {
+ if (!(message == rhs.message))
+ return false;
+ return true;
+ }
+ bool operator != (const IllegalArgument &rhs) const {
+ return !(*this == rhs);
+ }
+
+ bool operator < (const IllegalArgument & ) const;
+
+ uint32_t read(::apache::thrift::protocol::TProtocol* iprot);
+ uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const;
+
+};
+
+void swap(IllegalArgument &a, IllegalArgument &b);
+
+typedef struct _AlreadyExists__isset {
+ _AlreadyExists__isset() : message(false) {}
+ bool message;
+} _AlreadyExists__isset;
+
+class AlreadyExists : public ::apache::thrift::TException {
+ public:
+
+ static const char* ascii_fingerprint; // = "EFB929595D312AC8F305D5A794CFEDA1";
+ static const uint8_t binary_fingerprint[16]; // = {0xEF,0xB9,0x29,0x59,0x5D,0x31,0x2A,0xC8,0xF3,0x05,0xD5,0xA7,0x94,0xCF,0xED,0xA1};
+
+ AlreadyExists() : message() {
+ }
+
+ virtual ~AlreadyExists() throw() {}
+
+ std::string message;
+
+ _AlreadyExists__isset __isset;
+
+ void __set_message(const std::string& val) {
+ message = val;
+ }
+
+ bool operator == (const AlreadyExists & rhs) const
+ {
+ if (!(message == rhs.message))
+ return false;
+ return true;
+ }
+ bool operator != (const AlreadyExists &rhs) const {
+ return !(*this == rhs);
+ }
+
+ bool operator < (const AlreadyExists & ) const;
+
+ uint32_t read(::apache::thrift::protocol::TProtocol* iprot);
+ uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const;
+
+};
+
+void swap(AlreadyExists &a, AlreadyExists &b);
+
+}}}} // namespace
+
+#endif
Added: hbase/trunk/hbase-examples/src/main/java/org/apache/hadoop/hbase/mapreduce/IndexBuilder.java
URL: http://svn.apache.org/viewvc/hbase/trunk/hbase-examples/src/main/java/org/apache/hadoop/hbase/mapreduce/IndexBuilder.java?rev=1406339&view=auto
==============================================================================
--- hbase/trunk/hbase-examples/src/main/java/org/apache/hadoop/hbase/mapreduce/IndexBuilder.java (added)
+++ hbase/trunk/hbase-examples/src/main/java/org/apache/hadoop/hbase/mapreduce/IndexBuilder.java Tue Nov 6 21:22:27 2012
@@ -0,0 +1,153 @@
+/**
+ *
+ * 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 org.apache.hadoop.hbase.mapreduce;
+
+import java.io.IOException;
+import java.util.HashMap;
+
+import org.apache.hadoop.conf.Configuration;
+import org.apache.hadoop.hbase.HBaseConfiguration;
+import org.apache.hadoop.hbase.client.Put;
+import org.apache.hadoop.hbase.client.Result;
+import org.apache.hadoop.hbase.client.Scan;
+import org.apache.hadoop.hbase.io.ImmutableBytesWritable;
+import org.apache.hadoop.hbase.util.Bytes;
+import org.apache.hadoop.io.Writable;
+import org.apache.hadoop.mapreduce.Job;
+import org.apache.hadoop.mapreduce.Mapper;
+import org.apache.hadoop.util.GenericOptionsParser;
+
+/**
+ * Example map/reduce job to construct index tables that can be used to quickly
+ * find a row based on the value of a column. It demonstrates:
+ * <ul>
+ * <li>Using TableInputFormat and TableMapReduceUtil to use an HTable as input
+ * to a map/reduce job.</li>
+ * <li>Passing values from main method to children via the configuration.</li>
+ * <li>Using MultiTableOutputFormat to output to multiple tables from a
+ * map/reduce job.</li>
+ * <li>A real use case of building a secondary index over a table.</li>
+ * </ul>
+ *
+ * <h3>Usage</h3>
+ *
+ * <p>
+ * Modify ${HADOOP_HOME}/conf/hadoop-env.sh to include the hbase jar, the
+ * zookeeper jar (can be found in lib/ directory under HBase root, the examples output directory,
+ * and the hbase conf directory in HADOOP_CLASSPATH, and then run
+ * <tt><strong>bin/hadoop org.apache.hadoop.hbase.mapreduce.IndexBuilder TABLE_NAME COLUMN_FAMILY ATTR [ATTR ...]</strong></tt>
+ * </p>
+ *
+ * <p>
+ * To run with the sample data provided in index-builder-setup.rb, use the
+ * arguments <strong><tt>people attributes name email phone</tt></strong>.
+ * </p>
+ *
+ * <p>
+ * This code was written against HBase 0.21 trunk.
+ * </p>
+ */
+public class IndexBuilder {
+ /** the column family containing the indexed row key */
+ public static final byte[] INDEX_COLUMN = Bytes.toBytes("INDEX");
+ /** the qualifier containing the indexed row key */
+ public static final byte[] INDEX_QUALIFIER = Bytes.toBytes("ROW");
+
+ /**
+ * Internal Mapper to be run by Hadoop.
+ */
+ public static class Map extends
+ Mapper<ImmutableBytesWritable, Result, ImmutableBytesWritable, Writable> {
+ private byte[] family;
+ private HashMap<byte[], ImmutableBytesWritable> indexes;
+
+ @Override
+ protected void map(ImmutableBytesWritable rowKey, Result result, Context context)
+ throws IOException, InterruptedException {
+ for(java.util.Map.Entry<byte[], ImmutableBytesWritable> index : indexes.entrySet()) {
+ byte[] qualifier = index.getKey();
+ ImmutableBytesWritable tableName = index.getValue();
+ byte[] value = result.getValue(family, qualifier);
+ if (value != null) {
+ // original: row 123 attribute:phone 555-1212
+ // index: row 555-1212 INDEX:ROW 123
+ Put put = new Put(value);
+ put.add(INDEX_COLUMN, INDEX_QUALIFIER, rowKey.get());
+ context.write(tableName, put);
+ }
+ }
+ }
+
+ @Override
+ protected void setup(Context context) throws IOException,
+ InterruptedException {
+ Configuration configuration = context.getConfiguration();
+ String tableName = configuration.get("index.tablename");
+ String[] fields = configuration.getStrings("index.fields");
+ String familyName = configuration.get("index.familyname");
+ family = Bytes.toBytes(familyName);
+ indexes = new HashMap<byte[], ImmutableBytesWritable>();
+ for(String field : fields) {
+ // if the table is "people" and the field to index is "email", then the
+ // index table will be called "people-email"
+ indexes.put(Bytes.toBytes(field),
+ new ImmutableBytesWritable(Bytes.toBytes(tableName + "-" + field)));
+ }
+ }
+ }
+
+ /**
+ * Job configuration.
+ */
+ public static Job configureJob(Configuration conf, String [] args)
+ throws IOException {
+ String tableName = args[0];
+ String columnFamily = args[1];
+ System.out.println("****" + tableName);
+ conf.set(TableInputFormat.SCAN, TableMapReduceUtil.convertScanToString(new Scan()));
+ conf.set(TableInputFormat.INPUT_TABLE, tableName);
+ conf.set("index.tablename", tableName);
+ conf.set("index.familyname", columnFamily);
+ String[] fields = new String[args.length - 2];
+ for(int i = 0; i < fields.length; i++) {
+ fields[i] = args[i + 2];
+ }
+ conf.setStrings("index.fields", fields);
+ conf.set("index.familyname", "attributes");
+ Job job = new Job(conf, tableName);
+ job.setJarByClass(IndexBuilder.class);
+ job.setMapperClass(Map.class);
+ job.setNumReduceTasks(0);
+ job.setInputFormatClass(TableInputFormat.class);
+ job.setOutputFormatClass(MultiTableOutputFormat.class);
+ return job;
+ }
+
+ public static void main(String[] args) throws Exception {
+ Configuration conf = HBaseConfiguration.create();
+ String[] otherArgs = new GenericOptionsParser(conf, args).getRemainingArgs();
+ if(otherArgs.length < 3) {
+ System.err.println("Only " + otherArgs.length + " arguments supplied, required: 3");
+ System.err.println("Usage: IndexBuilder <TABLE_NAME> <COLUMN_FAMILY> <ATTR> [<ATTR> ...]");
+ System.exit(-1);
+ }
+ Job job = configureJob(conf, otherArgs);
+ System.exit(job.waitForCompletion(true) ? 0 : 1);
+ }
+}
Added: hbase/trunk/hbase-examples/src/main/java/org/apache/hadoop/hbase/mapreduce/SampleUploader.java
URL: http://svn.apache.org/viewvc/hbase/trunk/hbase-examples/src/main/java/org/apache/hadoop/hbase/mapreduce/SampleUploader.java?rev=1406339&view=auto
==============================================================================
--- hbase/trunk/hbase-examples/src/main/java/org/apache/hadoop/hbase/mapreduce/SampleUploader.java (added)
+++ hbase/trunk/hbase-examples/src/main/java/org/apache/hadoop/hbase/mapreduce/SampleUploader.java Tue Nov 6 21:22:27 2012
@@ -0,0 +1,147 @@
+/**
+ *
+ * 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 org.apache.hadoop.hbase.mapreduce;
+
+import java.io.IOException;
+
+import org.apache.hadoop.conf.Configuration;
+import org.apache.hadoop.fs.Path;
+import org.apache.hadoop.hbase.HBaseConfiguration;
+import org.apache.hadoop.hbase.client.Put;
+import org.apache.hadoop.hbase.io.ImmutableBytesWritable;
+import org.apache.hadoop.hbase.mapreduce.TableMapReduceUtil;
+import org.apache.hadoop.hbase.util.Bytes;
+import org.apache.hadoop.io.LongWritable;
+import org.apache.hadoop.io.Text;
+import org.apache.hadoop.mapreduce.Job;
+import org.apache.hadoop.mapreduce.Mapper;
+import org.apache.hadoop.mapreduce.lib.input.FileInputFormat;
+import org.apache.hadoop.mapreduce.lib.input.SequenceFileInputFormat;
+import org.apache.hadoop.util.GenericOptionsParser;
+
+/**
+ * Sample Uploader MapReduce
+ * <p>
+ * This is EXAMPLE code. You will need to change it to work for your context.
+ * <p>
+ * Uses {@link TableReducer} to put the data into HBase. Change the InputFormat
+ * to suit your data. In this example, we are importing a CSV file.
+ * <p>
+ * <pre>row,family,qualifier,value</pre>
+ * <p>
+ * The table and columnfamily we're to insert into must preexist.
+ * <p>
+ * There is no reducer in this example as it is not necessary and adds
+ * significant overhead. If you need to do any massaging of data before
+ * inserting into HBase, you can do this in the map as well.
+ * <p>Do the following to start the MR job:
+ * <pre>
+ * ./bin/hadoop org.apache.hadoop.hbase.mapreduce.SampleUploader /tmp/input.csv TABLE_NAME
+ * </pre>
+ * <p>
+ * This code was written against HBase 0.21 trunk.
+ */
+public class SampleUploader {
+
+ private static final String NAME = "SampleUploader";
+
+ static class Uploader
+ extends Mapper<LongWritable, Text, ImmutableBytesWritable, Put> {
+
+ private long checkpoint = 100;
+ private long count = 0;
+
+ @Override
+ public void map(LongWritable key, Text line, Context context)
+ throws IOException {
+
+ // Input is a CSV file
+ // Each map() is a single line, where the key is the line number
+ // Each line is comma-delimited; row,family,qualifier,value
+
+ // Split CSV line
+ String [] values = line.toString().split(",");
+ if(values.length != 4) {
+ return;
+ }
+
+ // Extract each value
+ byte [] row = Bytes.toBytes(values[0]);
+ byte [] family = Bytes.toBytes(values[1]);
+ byte [] qualifier = Bytes.toBytes(values[2]);
+ byte [] value = Bytes.toBytes(values[3]);
+
+ // Create Put
+ Put put = new Put(row);
+ put.add(family, qualifier, value);
+
+ // Uncomment below to disable WAL. This will improve performance but means
+ // you will experience data loss in the case of a RegionServer crash.
+ // put.setWriteToWAL(false);
+
+ try {
+ context.write(new ImmutableBytesWritable(row), put);
+ } catch (InterruptedException e) {
+ e.printStackTrace();
+ }
+
+ // Set status every checkpoint lines
+ if(++count % checkpoint == 0) {
+ context.setStatus("Emitting Put " + count);
+ }
+ }
+ }
+
+ /**
+ * Job configuration.
+ */
+ public static Job configureJob(Configuration conf, String [] args)
+ throws IOException {
+ Path inputPath = new Path(args[0]);
+ String tableName = args[1];
+ Job job = new Job(conf, NAME + "_" + tableName);
+ job.setJarByClass(Uploader.class);
+ FileInputFormat.setInputPaths(job, inputPath);
+ job.setInputFormatClass(SequenceFileInputFormat.class);
+ job.setMapperClass(Uploader.class);
+ // No reducers. Just write straight to table. Call initTableReducerJob
+ // because it sets up the TableOutputFormat.
+ TableMapReduceUtil.initTableReducerJob(tableName, null, job);
+ job.setNumReduceTasks(0);
+ return job;
+ }
+
+ /**
+ * Main entry point.
+ *
+ * @param args The command line parameters.
+ * @throws Exception When running the job fails.
+ */
+ public static void main(String[] args) throws Exception {
+ Configuration conf = HBaseConfiguration.create();
+ String[] otherArgs = new GenericOptionsParser(conf, args).getRemainingArgs();
+ if(otherArgs.length != 2) {
+ System.err.println("Wrong number of arguments: " + otherArgs.length);
+ System.err.println("Usage: " + NAME + " <input> <tablename>");
+ System.exit(-1);
+ }
+ Job job = configureJob(conf, otherArgs);
+ System.exit(job.waitForCompletion(true) ? 0 : 1);
+ }
+}