Return-Path: X-Original-To: apmail-accumulo-commits-archive@www.apache.org Delivered-To: apmail-accumulo-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 65F88103E7 for ; Tue, 4 Feb 2014 22:19:32 +0000 (UTC) Received: (qmail 44251 invoked by uid 500); 4 Feb 2014 22:19:27 -0000 Delivered-To: apmail-accumulo-commits-archive@accumulo.apache.org Received: (qmail 44021 invoked by uid 500); 4 Feb 2014 22:19:22 -0000 Mailing-List: contact commits-help@accumulo.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@accumulo.apache.org Delivered-To: mailing list commits@accumulo.apache.org Received: (qmail 43738 invoked by uid 99); 4 Feb 2014 22:19:17 -0000 Received: from tyr.zones.apache.org (HELO tyr.zones.apache.org) (140.211.11.114) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 04 Feb 2014 22:19:17 +0000 Received: by tyr.zones.apache.org (Postfix, from userid 65534) id 668E5824B43; Tue, 4 Feb 2014 22:19:17 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: vines@apache.org To: commits@accumulo.apache.org Date: Tue, 04 Feb 2014 22:19:22 -0000 Message-Id: In-Reply-To: <917926a365474387a643db3aeb00c1cf@git.apache.org> References: <917926a365474387a643db3aeb00c1cf@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: [07/10] ACCUMULO-2197 provide generated proxy libraries, with modified generate-thrift script which tacks on headers http://git-wip-us.apache.org/repos/asf/accumulo/blob/3d436e7b/proxy/src/main/cpp/AccumuloProxy_server.skeleton.cpp ---------------------------------------------------------------------- diff --git a/proxy/src/main/cpp/AccumuloProxy_server.skeleton.cpp b/proxy/src/main/cpp/AccumuloProxy_server.skeleton.cpp new file mode 100644 index 0000000..36d2655 --- /dev/null +++ b/proxy/src/main/cpp/AccumuloProxy_server.skeleton.cpp @@ -0,0 +1,415 @@ +/* + * 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 autogenerated skeleton file illustrates how to build a server. +// You should copy it to another filename to avoid overwriting it. + +#include "AccumuloProxy.h" +#include +#include +#include +#include + +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 ::accumulo; + +class AccumuloProxyHandler : virtual public AccumuloProxyIf { + public: + AccumuloProxyHandler() { + // Your initialization goes here + } + + void login(std::string& _return, const std::string& principal, const std::map & loginProperties) { + // Your implementation goes here + printf("login\n"); + } + + int32_t addConstraint(const std::string& login, const std::string& tableName, const std::string& constraintClassName) { + // Your implementation goes here + printf("addConstraint\n"); + } + + void addSplits(const std::string& login, const std::string& tableName, const std::set & splits) { + // Your implementation goes here + printf("addSplits\n"); + } + + void attachIterator(const std::string& login, const std::string& tableName, const IteratorSetting& setting, const std::set & scopes) { + // Your implementation goes here + printf("attachIterator\n"); + } + + void checkIteratorConflicts(const std::string& login, const std::string& tableName, const IteratorSetting& setting, const std::set & scopes) { + // Your implementation goes here + printf("checkIteratorConflicts\n"); + } + + void clearLocatorCache(const std::string& login, const std::string& tableName) { + // Your implementation goes here + printf("clearLocatorCache\n"); + } + + void cloneTable(const std::string& login, const std::string& tableName, const std::string& newTableName, const bool flush, const std::map & propertiesToSet, const std::set & propertiesToExclude) { + // Your implementation goes here + printf("cloneTable\n"); + } + + void compactTable(const std::string& login, const std::string& tableName, const std::string& startRow, const std::string& endRow, const std::vector & iterators, const bool flush, const bool wait) { + // Your implementation goes here + printf("compactTable\n"); + } + + void cancelCompaction(const std::string& login, const std::string& tableName) { + // Your implementation goes here + printf("cancelCompaction\n"); + } + + void createTable(const std::string& login, const std::string& tableName, const bool versioningIter, const TimeType::type type) { + // Your implementation goes here + printf("createTable\n"); + } + + void deleteTable(const std::string& login, const std::string& tableName) { + // Your implementation goes here + printf("deleteTable\n"); + } + + void deleteRows(const std::string& login, const std::string& tableName, const std::string& startRow, const std::string& endRow) { + // Your implementation goes here + printf("deleteRows\n"); + } + + void exportTable(const std::string& login, const std::string& tableName, const std::string& exportDir) { + // Your implementation goes here + printf("exportTable\n"); + } + + void flushTable(const std::string& login, const std::string& tableName, const std::string& startRow, const std::string& endRow, const bool wait) { + // Your implementation goes here + printf("flushTable\n"); + } + + void getLocalityGroups(std::map > & _return, const std::string& login, const std::string& tableName) { + // Your implementation goes here + printf("getLocalityGroups\n"); + } + + void getIteratorSetting(IteratorSetting& _return, const std::string& login, const std::string& tableName, const std::string& iteratorName, const IteratorScope::type scope) { + // Your implementation goes here + printf("getIteratorSetting\n"); + } + + void getMaxRow(std::string& _return, const std::string& login, const std::string& tableName, const std::set & auths, const std::string& startRow, const bool startInclusive, const std::string& endRow, const bool endInclusive) { + // Your implementation goes here + printf("getMaxRow\n"); + } + + void getTableProperties(std::map & _return, const std::string& login, const std::string& tableName) { + // Your implementation goes here + printf("getTableProperties\n"); + } + + void importDirectory(const std::string& login, const std::string& tableName, const std::string& importDir, const std::string& failureDir, const bool setTime) { + // Your implementation goes here + printf("importDirectory\n"); + } + + void importTable(const std::string& login, const std::string& tableName, const std::string& importDir) { + // Your implementation goes here + printf("importTable\n"); + } + + void listSplits(std::vector & _return, const std::string& login, const std::string& tableName, const int32_t maxSplits) { + // Your implementation goes here + printf("listSplits\n"); + } + + void listTables(std::set & _return, const std::string& login) { + // Your implementation goes here + printf("listTables\n"); + } + + void listIterators(std::map > & _return, const std::string& login, const std::string& tableName) { + // Your implementation goes here + printf("listIterators\n"); + } + + void listConstraints(std::map & _return, const std::string& login, const std::string& tableName) { + // Your implementation goes here + printf("listConstraints\n"); + } + + void mergeTablets(const std::string& login, const std::string& tableName, const std::string& startRow, const std::string& endRow) { + // Your implementation goes here + printf("mergeTablets\n"); + } + + void offlineTable(const std::string& login, const std::string& tableName) { + // Your implementation goes here + printf("offlineTable\n"); + } + + void onlineTable(const std::string& login, const std::string& tableName) { + // Your implementation goes here + printf("onlineTable\n"); + } + + void removeConstraint(const std::string& login, const std::string& tableName, const int32_t constraint) { + // Your implementation goes here + printf("removeConstraint\n"); + } + + void removeIterator(const std::string& login, const std::string& tableName, const std::string& iterName, const std::set & scopes) { + // Your implementation goes here + printf("removeIterator\n"); + } + + void removeTableProperty(const std::string& login, const std::string& tableName, const std::string& property) { + // Your implementation goes here + printf("removeTableProperty\n"); + } + + void renameTable(const std::string& login, const std::string& oldTableName, const std::string& newTableName) { + // Your implementation goes here + printf("renameTable\n"); + } + + void setLocalityGroups(const std::string& login, const std::string& tableName, const std::map > & groups) { + // Your implementation goes here + printf("setLocalityGroups\n"); + } + + void setTableProperty(const std::string& login, const std::string& tableName, const std::string& property, const std::string& value) { + // Your implementation goes here + printf("setTableProperty\n"); + } + + void splitRangeByTablets(std::set & _return, const std::string& login, const std::string& tableName, const Range& range, const int32_t maxSplits) { + // Your implementation goes here + printf("splitRangeByTablets\n"); + } + + bool tableExists(const std::string& login, const std::string& tableName) { + // Your implementation goes here + printf("tableExists\n"); + } + + void tableIdMap(std::map & _return, const std::string& login) { + // Your implementation goes here + printf("tableIdMap\n"); + } + + bool testTableClassLoad(const std::string& login, const std::string& tableName, const std::string& className, const std::string& asTypeName) { + // Your implementation goes here + printf("testTableClassLoad\n"); + } + + void pingTabletServer(const std::string& login, const std::string& tserver) { + // Your implementation goes here + printf("pingTabletServer\n"); + } + + void getActiveScans(std::vector & _return, const std::string& login, const std::string& tserver) { + // Your implementation goes here + printf("getActiveScans\n"); + } + + void getActiveCompactions(std::vector & _return, const std::string& login, const std::string& tserver) { + // Your implementation goes here + printf("getActiveCompactions\n"); + } + + void getSiteConfiguration(std::map & _return, const std::string& login) { + // Your implementation goes here + printf("getSiteConfiguration\n"); + } + + void getSystemConfiguration(std::map & _return, const std::string& login) { + // Your implementation goes here + printf("getSystemConfiguration\n"); + } + + void getTabletServers(std::vector & _return, const std::string& login) { + // Your implementation goes here + printf("getTabletServers\n"); + } + + void removeProperty(const std::string& login, const std::string& property) { + // Your implementation goes here + printf("removeProperty\n"); + } + + void setProperty(const std::string& login, const std::string& property, const std::string& value) { + // Your implementation goes here + printf("setProperty\n"); + } + + bool testClassLoad(const std::string& login, const std::string& className, const std::string& asTypeName) { + // Your implementation goes here + printf("testClassLoad\n"); + } + + bool authenticateUser(const std::string& login, const std::string& user, const std::map & properties) { + // Your implementation goes here + printf("authenticateUser\n"); + } + + void changeUserAuthorizations(const std::string& login, const std::string& user, const std::set & authorizations) { + // Your implementation goes here + printf("changeUserAuthorizations\n"); + } + + void changeLocalUserPassword(const std::string& login, const std::string& user, const std::string& password) { + // Your implementation goes here + printf("changeLocalUserPassword\n"); + } + + void createLocalUser(const std::string& login, const std::string& user, const std::string& password) { + // Your implementation goes here + printf("createLocalUser\n"); + } + + void dropLocalUser(const std::string& login, const std::string& user) { + // Your implementation goes here + printf("dropLocalUser\n"); + } + + void getUserAuthorizations(std::vector & _return, const std::string& login, const std::string& user) { + // Your implementation goes here + printf("getUserAuthorizations\n"); + } + + void grantSystemPermission(const std::string& login, const std::string& user, const SystemPermission::type perm) { + // Your implementation goes here + printf("grantSystemPermission\n"); + } + + void grantTablePermission(const std::string& login, const std::string& user, const std::string& table, const TablePermission::type perm) { + // Your implementation goes here + printf("grantTablePermission\n"); + } + + bool hasSystemPermission(const std::string& login, const std::string& user, const SystemPermission::type perm) { + // Your implementation goes here + printf("hasSystemPermission\n"); + } + + bool hasTablePermission(const std::string& login, const std::string& user, const std::string& table, const TablePermission::type perm) { + // Your implementation goes here + printf("hasTablePermission\n"); + } + + void listLocalUsers(std::set & _return, const std::string& login) { + // Your implementation goes here + printf("listLocalUsers\n"); + } + + void revokeSystemPermission(const std::string& login, const std::string& user, const SystemPermission::type perm) { + // Your implementation goes here + printf("revokeSystemPermission\n"); + } + + void revokeTablePermission(const std::string& login, const std::string& user, const std::string& table, const TablePermission::type perm) { + // Your implementation goes here + printf("revokeTablePermission\n"); + } + + void createBatchScanner(std::string& _return, const std::string& login, const std::string& tableName, const BatchScanOptions& options) { + // Your implementation goes here + printf("createBatchScanner\n"); + } + + void createScanner(std::string& _return, const std::string& login, const std::string& tableName, const ScanOptions& options) { + // Your implementation goes here + printf("createScanner\n"); + } + + bool hasNext(const std::string& scanner) { + // Your implementation goes here + printf("hasNext\n"); + } + + void nextEntry(KeyValueAndPeek& _return, const std::string& scanner) { + // Your implementation goes here + printf("nextEntry\n"); + } + + void nextK(ScanResult& _return, const std::string& scanner, const int32_t k) { + // Your implementation goes here + printf("nextK\n"); + } + + void closeScanner(const std::string& scanner) { + // Your implementation goes here + printf("closeScanner\n"); + } + + void updateAndFlush(const std::string& login, const std::string& tableName, const std::map > & cells) { + // Your implementation goes here + printf("updateAndFlush\n"); + } + + void createWriter(std::string& _return, const std::string& login, const std::string& tableName, const WriterOptions& opts) { + // Your implementation goes here + printf("createWriter\n"); + } + + void update(const std::string& writer, const std::map > & cells) { + // Your implementation goes here + printf("update\n"); + } + + void flush(const std::string& writer) { + // Your implementation goes here + printf("flush\n"); + } + + void closeWriter(const std::string& writer) { + // Your implementation goes here + printf("closeWriter\n"); + } + + void getRowRange(Range& _return, const std::string& row) { + // Your implementation goes here + printf("getRowRange\n"); + } + + void getFollowing(Key& _return, const Key& key, const PartialKey::type part) { + // Your implementation goes here + printf("getFollowing\n"); + } + +}; + +int main(int argc, char **argv) { + int port = 9090; + shared_ptr handler(new AccumuloProxyHandler()); + shared_ptr processor(new AccumuloProxyProcessor(handler)); + shared_ptr serverTransport(new TServerSocket(port)); + shared_ptr transportFactory(new TBufferedTransportFactory()); + shared_ptr protocolFactory(new TBinaryProtocolFactory()); + + TSimpleServer server(processor, serverTransport, transportFactory, protocolFactory); + server.serve(); + return 0; +} + http://git-wip-us.apache.org/repos/asf/accumulo/blob/3d436e7b/proxy/src/main/cpp/proxy_constants.cpp ---------------------------------------------------------------------- diff --git a/proxy/src/main/cpp/proxy_constants.cpp b/proxy/src/main/cpp/proxy_constants.cpp new file mode 100644 index 0000000..960af82 --- /dev/null +++ b/proxy/src/main/cpp/proxy_constants.cpp @@ -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. + */ +/** + * Autogenerated by Thrift Compiler (0.9.0) + * + * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING + * @generated + */ +#include "proxy_constants.h" + +namespace accumulo { + +const proxyConstants g_proxy_constants; + +proxyConstants::proxyConstants() { +} + +} // namespace + http://git-wip-us.apache.org/repos/asf/accumulo/blob/3d436e7b/proxy/src/main/cpp/proxy_constants.h ---------------------------------------------------------------------- diff --git a/proxy/src/main/cpp/proxy_constants.h b/proxy/src/main/cpp/proxy_constants.h new file mode 100644 index 0000000..7c9a50b --- /dev/null +++ b/proxy/src/main/cpp/proxy_constants.h @@ -0,0 +1,40 @@ +/* + * 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. + */ +/** + * Autogenerated by Thrift Compiler (0.9.0) + * + * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING + * @generated + */ +#ifndef proxy_CONSTANTS_H +#define proxy_CONSTANTS_H + +#include "proxy_types.h" + +namespace accumulo { + +class proxyConstants { + public: + proxyConstants(); + +}; + +extern const proxyConstants g_proxy_constants; + +} // namespace + +#endif