You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@iotdb.apache.org by qi...@apache.org on 2020/04/09 02:11:53 UTC
[incubator-iotdb] 02/03: start API service at last
This is an automated email from the ASF dual-hosted git repository.
qiaojialin pushed a commit to branch fix_upgrade_master
in repository https://gitbox.apache.org/repos/asf/incubator-iotdb.git
commit 65131c59008e939b57668d853a79387e05c01417
Author: qiaojialin <64...@qq.com>
AuthorDate: Thu Apr 9 10:11:27 2020 +0800
start API service at last
---
.../{JDBCServiceException.java => RPCServiceException.java} | 6 +++---
server/src/main/java/org/apache/iotdb/db/service/RPCService.java | 8 ++++----
.../{JDBCServiceEventHandler.java => RPCServiceEventHandler.java} | 4 ++--
.../java/org/apache/iotdb/db/sync/receiver/SyncServerManager.java | 1 -
4 files changed, 9 insertions(+), 10 deletions(-)
diff --git a/server/src/main/java/org/apache/iotdb/db/exception/runtime/JDBCServiceException.java b/server/src/main/java/org/apache/iotdb/db/exception/runtime/RPCServiceException.java
similarity index 85%
rename from server/src/main/java/org/apache/iotdb/db/exception/runtime/JDBCServiceException.java
rename to server/src/main/java/org/apache/iotdb/db/exception/runtime/RPCServiceException.java
index 1664964..c3acee3 100644
--- a/server/src/main/java/org/apache/iotdb/db/exception/runtime/JDBCServiceException.java
+++ b/server/src/main/java/org/apache/iotdb/db/exception/runtime/RPCServiceException.java
@@ -18,15 +18,15 @@
*/
package org.apache.iotdb.db.exception.runtime;
-public class JDBCServiceException extends RuntimeException{
+public class RPCServiceException extends RuntimeException{
private static final long serialVersionUID = 520836932066897810L;
- public JDBCServiceException(String message) {
+ public RPCServiceException(String message) {
super(message);
}
- public JDBCServiceException(String message, Throwable e) {
+ public RPCServiceException(String message, Throwable e) {
super(message + e.getMessage());
}
diff --git a/server/src/main/java/org/apache/iotdb/db/service/RPCService.java b/server/src/main/java/org/apache/iotdb/db/service/RPCService.java
index 36a6737..5b3eb5c 100644
--- a/server/src/main/java/org/apache/iotdb/db/service/RPCService.java
+++ b/server/src/main/java/org/apache/iotdb/db/service/RPCService.java
@@ -26,7 +26,7 @@ import org.apache.iotdb.db.conf.IoTDBConfig;
import org.apache.iotdb.db.conf.IoTDBConstant;
import org.apache.iotdb.db.conf.IoTDBDescriptor;
import org.apache.iotdb.db.exception.StartupException;
-import org.apache.iotdb.db.exception.runtime.JDBCServiceException;
+import org.apache.iotdb.db.exception.runtime.RPCServiceException;
import org.apache.iotdb.service.rpc.thrift.TSIService;
import org.apache.iotdb.service.rpc.thrift.TSIService.Processor;
import org.apache.thrift.protocol.TBinaryProtocol;
@@ -218,13 +218,13 @@ public class RPCService implements RPCServiceMBean, IService {
poolArgs.processor(processor);
poolArgs.protocolFactory(protocolFactory);
poolServer = new TThreadPoolServer(poolArgs);
- poolServer.setServerEventHandler(new JDBCServiceEventHandler(impl, threadStartLatch));
+ poolServer.setServerEventHandler(new RPCServiceEventHandler(impl, threadStartLatch));
poolServer.serve();
} catch (TTransportException e) {
- throw new JDBCServiceException(String.format("%s: failed to start %s, because ", IoTDBConstant.GLOBAL_DB_NAME,
+ throw new RPCServiceException(String.format("%s: failed to start %s, because ", IoTDBConstant.GLOBAL_DB_NAME,
getID().getName()), e);
} catch (Exception e) {
- throw new JDBCServiceException(String.format("%s: %s exit, because ", IoTDBConstant.GLOBAL_DB_NAME, getID().getName()), e);
+ throw new RPCServiceException(String.format("%s: %s exit, because ", IoTDBConstant.GLOBAL_DB_NAME, getID().getName()), e);
} finally {
close();
// TODO debug log, will be deleted in production env
diff --git a/server/src/main/java/org/apache/iotdb/db/service/JDBCServiceEventHandler.java b/server/src/main/java/org/apache/iotdb/db/service/RPCServiceEventHandler.java
similarity index 91%
rename from server/src/main/java/org/apache/iotdb/db/service/JDBCServiceEventHandler.java
rename to server/src/main/java/org/apache/iotdb/db/service/RPCServiceEventHandler.java
index 2e9ea5f..6d2e7e6 100644
--- a/server/src/main/java/org/apache/iotdb/db/service/JDBCServiceEventHandler.java
+++ b/server/src/main/java/org/apache/iotdb/db/service/RPCServiceEventHandler.java
@@ -24,12 +24,12 @@ import org.apache.thrift.server.ServerContext;
import org.apache.thrift.server.TServerEventHandler;
import org.apache.thrift.transport.TTransport;
-public class JDBCServiceEventHandler implements TServerEventHandler {
+public class RPCServiceEventHandler implements TServerEventHandler {
private TSServiceImpl serviceImpl;
private CountDownLatch startLatch;
- JDBCServiceEventHandler(TSServiceImpl serviceImpl, CountDownLatch startLatch) {
+ RPCServiceEventHandler(TSServiceImpl serviceImpl, CountDownLatch startLatch) {
this.serviceImpl = serviceImpl;
this.startLatch = startLatch;
}
diff --git a/server/src/main/java/org/apache/iotdb/db/sync/receiver/SyncServerManager.java b/server/src/main/java/org/apache/iotdb/db/sync/receiver/SyncServerManager.java
index 056a9a0..19c4d51 100644
--- a/server/src/main/java/org/apache/iotdb/db/sync/receiver/SyncServerManager.java
+++ b/server/src/main/java/org/apache/iotdb/db/sync/receiver/SyncServerManager.java
@@ -28,7 +28,6 @@ import org.apache.iotdb.db.conf.IoTDBConstant;
import org.apache.iotdb.db.conf.IoTDBDescriptor;
import org.apache.iotdb.db.exception.StartupException;
import org.apache.iotdb.db.service.IService;
-import org.apache.iotdb.db.service.JDBCServiceEventHandler;
import org.apache.iotdb.db.service.ServiceType;
import org.apache.iotdb.db.sync.receiver.load.FileLoaderManager;
import org.apache.iotdb.db.sync.receiver.recover.SyncReceiverLogAnalyzer;