diff --git a/pom.xml b/pom.xml
index 13b0cd76d..7f97011a3 100644
--- a/pom.xml
+++ b/pom.xml
@@ -6,7 +6,7 @@
com.baidu.hugegraph
hugegraph-common
- 1.6.5
+ 1.6.6
hugegraph-common
https://github.com/hugegraph/hugegraph-common
@@ -212,7 +212,7 @@
- 1.6.5.0
+ 1.6.6.0
diff --git a/src/main/java/com/baidu/hugegraph/rest/RestClient.java b/src/main/java/com/baidu/hugegraph/rest/RestClient.java
index 63871e021..cb66395f1 100644
--- a/src/main/java/com/baidu/hugegraph/rest/RestClient.java
+++ b/src/main/java/com/baidu/hugegraph/rest/RestClient.java
@@ -24,7 +24,6 @@
import java.util.Collection;
import java.util.Map;
import java.util.concurrent.Callable;
-import java.util.concurrent.Executors;
import java.util.concurrent.ScheduledExecutorService;
import java.util.concurrent.TimeUnit;
@@ -50,6 +49,7 @@
import org.glassfish.jersey.message.GZipEncoder;
import org.glassfish.jersey.uri.UriComponent;
+import com.baidu.hugegraph.util.ExecutorUtil;
import com.google.common.collect.ImmutableMap;
public abstract class RestClient {
@@ -98,7 +98,8 @@ public RestClient(String url, ClientConfig config) {
this.pool = (PoolingHttpClientConnectionManager)
config.getProperty(CONNECTION_MANAGER);
if (this.pool != null) {
- this.cleanExecutor = Executors.newScheduledThreadPool(1);
+ this.cleanExecutor = ExecutorUtil.newScheduledThreadPool(
+ "conn-clean-worker-%d");
this.cleanExecutor.scheduleWithFixedDelay(() -> {
PoolStats stats = this.pool.getTotalStats();
int using = stats.getLeased() + stats.getPending();
diff --git a/src/main/java/com/baidu/hugegraph/rest/RestResult.java b/src/main/java/com/baidu/hugegraph/rest/RestResult.java
index 92962eacd..e4908f8b3 100644
--- a/src/main/java/com/baidu/hugegraph/rest/RestResult.java
+++ b/src/main/java/com/baidu/hugegraph/rest/RestResult.java
@@ -77,7 +77,7 @@ public List readList(String key, Class clazz) {
JavaType type = mapper.getTypeFactory()
.constructParametrizedType(ArrayList.class,
List.class, clazz);
- return mapper.readValue(element.toString(), type);
+ return mapper.convertValue(element, type);
} catch (IOException e) {
throw new SerializeException(
"Failed to deserialize %s", e, this.content);
diff --git a/src/main/java/com/baidu/hugegraph/util/ExecutorUtil.java b/src/main/java/com/baidu/hugegraph/util/ExecutorUtil.java
index 773ec0d8d..e30893021 100644
--- a/src/main/java/com/baidu/hugegraph/util/ExecutorUtil.java
+++ b/src/main/java/com/baidu/hugegraph/util/ExecutorUtil.java
@@ -21,16 +21,33 @@
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
+import java.util.concurrent.ScheduledExecutorService;
import java.util.concurrent.ThreadFactory;
import org.apache.commons.lang3.concurrent.BasicThreadFactory;
public final class ExecutorUtil {
+ public static ExecutorService newFixedThreadPool(String name) {
+ return newFixedThreadPool(1, name);
+ }
+
public static ExecutorService newFixedThreadPool(int size, String name) {
ThreadFactory factory = new BasicThreadFactory.Builder()
.namingPattern(name)
.build();
return Executors.newFixedThreadPool(size, factory);
}
+
+ public static ScheduledExecutorService newScheduledThreadPool(String name) {
+ return newScheduledThreadPool(1, name);
+ }
+
+ public static ScheduledExecutorService newScheduledThreadPool(int size,
+ String name) {
+ ThreadFactory factory = new BasicThreadFactory.Builder()
+ .namingPattern(name)
+ .build();
+ return Executors.newScheduledThreadPool(size, factory);
+ }
}
diff --git a/src/main/java/com/baidu/hugegraph/version/CommonVersion.java b/src/main/java/com/baidu/hugegraph/version/CommonVersion.java
index 55585ad67..da9b44c59 100644
--- a/src/main/java/com/baidu/hugegraph/version/CommonVersion.java
+++ b/src/main/java/com/baidu/hugegraph/version/CommonVersion.java
@@ -27,5 +27,5 @@ public class CommonVersion {
// The second parameter of Version.of() is for all-in-one JAR
public static final Version VERSION = Version.of(CommonVersion.class,
- "1.6.5");
+ "1.6.6");
}