You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@iotdb.apache.org by GitBox <gi...@apache.org> on 2020/05/17 03:30:30 UTC
[GitHub] [incubator-iotdb] iiint opened a new pull request #1218: [IoTDB-682]Add client-cpp and update docs/UserGuide/3-Server/1-Download.md
iiint opened a new pull request #1218:
URL: https://github.com/apache/incubator-iotdb/pull/1218
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [incubator-iotdb] HTHou commented on a change in pull request #1218: [IoTDB-682]Add client-cpp and update docs/UserGuide/3-Server/1-Download.md
Posted by GitBox <gi...@apache.org>.
HTHou commented on a change in pull request #1218:
URL: https://github.com/apache/incubator-iotdb/pull/1218#discussion_r426464818
##########
File path: client-cpp/README.md
##########
@@ -0,0 +1,40 @@
+# client-cpp
+Client in language C++ for Apache IoTDB using CMake on Linux
+
Review comment:
Missing apache header.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [incubator-iotdb] wshao08 commented on a change in pull request #1218: [IoTDB-682]Add client-cpp and update docs/UserGuide/3-Server/1-Download.md
Posted by GitBox <gi...@apache.org>.
wshao08 commented on a change in pull request #1218:
URL: https://github.com/apache/incubator-iotdb/pull/1218#discussion_r427093612
##########
File path: client-cpp/compile.sh
##########
@@ -0,0 +1,36 @@
+# 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.
+#
+
+export THRIFT_EXE=thrift
+export CMAKE_EXE=cmake
+export MAKE_EXE=make
+export SH_DIR=$(dirname $0)/
+export THRIFT_SCRIPT=${SH_DIR}rpc.thrift
+export THRIFT_OUT=${SH_DIR}gen-cpp
+export USELESS_FILE=${SH_DIR}/gen-cpp/TSIService_server.skeleton.cpp
+export SUB_CMAKELISTS=${SH_DIR}/gen-cpp/CMakeLists.txt
+export BUILD_FOLDER=${SH_DIR}/build
+
+rm -rf ${THRIFT_OUT}
+${THRIFT_EXE} -gen cpp ${THRIFT_SCRIPT}
+rm -rf ${USELESS_FILE}
+touch ${SUB_CMAKELISTS}
+cd ${BUILD_FOLDER}
Review comment:
Add directory check before accessing ${BUILD_FOLDER}
if [ ! -d ${BUILD_FOLDER} ]; then
mkdir ${BUILD_FOLDER}
fi
##########
File path: client-cpp/README.md
##########
@@ -0,0 +1,40 @@
+# client-cpp
+Client in language C++ for Apache IoTDB using CMake on Linux
+
+# 0. Apache IoTDB:
+* [Apache IoTDB website](http://iotdb.apache.org/)
+
+* [Apache IoTDB github](https://github.com/apache/incubator-iotdb)
+
+# 1. Description of client-cpp structure
+* `SessionExample.cpp` : the main function of the project, containing examples of the client methods to use IoTDB
+* `compile.sh` : The script to compile the client automatically.
+* `Session` (folder) : Class Session which wrap the rpc interfaces generated by thrift
+* `CMakeLists.txt` (the one under project root directory) : the CMakeLists for the whole project
+* `build` (folder) : The files generated by cmake while compiling and after compiled. Before compiling, this folder is empty.
+* `libthrift.a, libthriftnb.a` : thrift cpp static library
+
+# 2. How to run
+Under the project root directory, run commands:
+```
+./chmod u+x compile.sh
+
+./compile.sh
+
+./client-cpp
+```
+
+# 3. Prerequisites
Review comment:
I think Boost should be added here as a prerequisite. It is required by thrift.
##########
File path: client-cpp/CMakeLists.txt
##########
@@ -0,0 +1,39 @@
+# 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.
+#
+
+project(client-cpp)
+cmake_minimum_required(VERSION 3.16)
+add_subdirectory(Session)
+add_subdirectory(gen-cpp)
Review comment:
I tested it on my Mac. It looks I had to specify "-std=c++11" flag to proceed the compilation.
```set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -Wall)```
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [incubator-iotdb] wshao08 commented on a change in pull request #1218: [IoTDB-682]Add client-cpp and update docs/UserGuide/3-Server/1-Download.md
Posted by GitBox <gi...@apache.org>.
wshao08 commented on a change in pull request #1218:
URL: https://github.com/apache/incubator-iotdb/pull/1218#discussion_r429022388
##########
File path: client-cpp/CMakeLists.txt
##########
@@ -0,0 +1,39 @@
+# 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.
+#
+
+project(client-cpp)
+cmake_minimum_required(VERSION 3.16)
+add_subdirectory(Session)
+add_subdirectory(gen-cpp)
+
+aux_source_directory(./Session dir_Session_srcs)
+add_library(Session ${dir_Session_srcs})
+
+aux_source_directory(./gen-cpp dir_GenCPP_srcs)
+add_library(GenCPP ${dir_GenCPP_srcs})
+
+# if you already have thrift, just delete this code
+include_directories(./thrift_0.13.0_src)
+
+aux_source_directory(. EXE_SRCS)
+add_executable(client-cpp ${EXE_SRCS})
+target_link_libraries(client-cpp Session)
+target_link_libraries(client-cpp GenCPP)
+
+target_link_libraries(client-cpp libthrift.a)
+target_link_libraries(client-cpp libthriftnb.a)
Review comment:
Is libthriftnb used in our cpp client? I could compile without linking this lib.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [incubator-iotdb] qiaojialin commented on a change in pull request #1218: [IoTDB-682]Add client-cpp and update docs/UserGuide/3-Server/1-Download.md
Posted by GitBox <gi...@apache.org>.
qiaojialin commented on a change in pull request #1218:
URL: https://github.com/apache/incubator-iotdb/pull/1218#discussion_r426252147
##########
File path: client-cpp/README.md
##########
@@ -0,0 +1,40 @@
+# client-cpp
+Client in language C++ for Apache IoTDB using CMake on Linux
+
+# 0. Apache IoTDB:
+* [Apache IoTDB website](http://iotdb.apache.org/)
+
+* [Apache IoTDB github](https://github.com/apache/incubator-iotdb)
+
+# 1. Description of client-cpp structure
+* `SessionExample.cpp` : the main function of the project, containing examples of the client methods to use IoTDB
+* `compile.sh` : The script to compile the client automatically.
+* `Session` (folder) : Class Session which wrap the rpc interfaces generated by thrift
+* `CMakeLists.txt` (the one under project root directory) : the CMakeLists for the whole project
+* `build` (folder) : The files generated by cmake while compiling and after compiled. Before compiling, this folder is empty.
+* `libthrift.a, libthriftnb.a` : thrift cpp static library
+
+# 2. How to run
+Under the project root directory, run commands:
+```
+./chmod u+x compile.sh
+
+./compile.sh
+
+./client-cpp
+```
+
+# 3. Prerequisites
+* thrift version: 0.13.0 : you need to build and install thrift out of the source repository, just refer to this website:[Building Thrift from source](https://thrift.apache.org/docs/BuildingFromSource). You may note that after this by default the thrift C++ library(both static and dynamic) is built already, you can find them in the lib/cpp/.lib folder.
+* cmake version: 3.16 : [CMake Download](https://cmake.org/download/)
Review comment:
put this in front of "How to run"
##########
File path: client-cpp/README.md
##########
@@ -0,0 +1,40 @@
+# client-cpp
+Client in language C++ for Apache IoTDB using CMake on Linux
+
+# 0. Apache IoTDB:
+* [Apache IoTDB website](http://iotdb.apache.org/)
+
+* [Apache IoTDB github](https://github.com/apache/incubator-iotdb)
Review comment:
no need to add this, we are already in iotdb repo
##########
File path: client-cpp/rpc.thrift
##########
@@ -0,0 +1,310 @@
+/*
+ * 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.
+ */
+namespace java org.apache.iotdb.service.rpc.thrift
Review comment:
Do not copy this file, use the service-rpc/src/main/thrift/rpc.thrift
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org