upgrade version to 1.6.0 (#94)

diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
new file mode 100644
index 0000000..0b88e42
--- /dev/null
+++ b/.github/workflows/ci.yml
@@ -0,0 +1,47 @@
+name: hugegraph-tools ci
+on:
+  push:
+    branches:
+      - master
+      - /^release-.*$/
+      - /^test-.*$/
+  pull_request:
+    branches:
+      - master
+      - /^release-.*$/
+      - /^test-.*$/
+jobs:
+  build:
+    runs-on: ubuntu-20.04
+    env:
+      TRAVIS_DIR: assembly/travis
+      COMMIT_ID: 1d031c5905cbef008dd5fb468576b0e6a9445181
+    steps:
+      - name: Install JDK 8
+        uses: actions/setup-java@v2
+        with:
+          java-version: '8'
+          distribution: 'zulu'
+      - name: Cache Maven packages
+        uses: actions/cache@v2
+        with:
+          path: ~/.m2
+          key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
+          restore-keys: ${{ runner.os }}-m2
+      - name: Checkout
+        uses: actions/checkout@v2
+        with:
+          fetch-depth: 2
+      - name: Compile
+        run: |
+          mvn compile -Dmaven.javadoc.skip=true
+      - name: Prepare env and service
+        run: |
+          $TRAVIS_DIR/install-hugegraph-from-source.sh $COMMIT_ID
+      - name: Run test
+        run: |
+          mvn test -Dtest=FuncTestSuite
+      - name: Upload coverage to Codecov
+        uses: codecov/codecov-action@v1
+        with:
+          file: target/jacoco.xml
diff --git a/assembly/travis/conf/hugegraph.properties b/assembly/travis/conf/graphs/hugegraph.properties
similarity index 86%
rename from assembly/travis/conf/hugegraph.properties
rename to assembly/travis/conf/graphs/hugegraph.properties
index c66d0a7..0bc1f5c 100644
--- a/assembly/travis/conf/hugegraph.properties
+++ b/assembly/travis/conf/graphs/hugegraph.properties
@@ -59,10 +59,3 @@
 #palo.poll_interval=10
 #palo.temp_dir=./palo-data
 #palo.file_limit_size=32
-
-# postgresql & cockroachdb backend config
-#jdbc.driver=org.postgresql.Driver
-#jdbc.url=jdbc:postgresql://localhost:5432/
-#jdbc.username=postgres
-#jdbc.password=
-#jdbc.postgresql.connect_database=template1
diff --git a/assembly/travis/conf/gremlin-server.yaml b/assembly/travis/conf/gremlin-server.yaml
index 484ee12..69e8990 100644
--- a/assembly/travis/conf/gremlin-server.yaml
+++ b/assembly/travis/conf/gremlin-server.yaml
@@ -6,8 +6,8 @@
 scriptEvaluationTimeout: 30000
 
 channelizer: org.apache.tinkerpop.gremlin.server.channel.WsAndHttpChannelizer
+# don't set graph at here, this happens after support for dynamically adding graph
 graphs: {
-  hugegraph: conf/hugegraph.properties
 }
 scriptEngines: {
   gremlin-groovy: {
@@ -54,12 +54,6 @@
   }
 }
 serializers:
-  - { className: org.apache.tinkerpop.gremlin.driver.ser.GryoLiteMessageSerializerV1d0,
-      config: {
-        serializeResultToString: false,
-        ioRegistries: [com.baidu.hugegraph.io.HugeGraphIoRegistry]
-      }
-  }
   - { className: org.apache.tinkerpop.gremlin.driver.ser.GraphBinaryMessageSerializerV1,
       config: {
         serializeResultToString: false,
@@ -86,7 +80,7 @@
   }
 metrics: {
   consoleReporter: {enabled: false, interval: 180000},
-  csvReporter: {enabled: true, interval: 180000, fileName: /tmp/gremlin-server-metrics.csv},
+  csvReporter: {enabled: false, interval: 180000, fileName: ./metrics/gremlin-server-metrics.csv},
   jmxReporter: {enabled: false},
   slf4jReporter: {enabled: false, interval: 180000},
   gangliaReporter: {enabled: false, interval: 180000, addressingMode: MULTICAST},
diff --git a/assembly/travis/conf/rest-server.properties b/assembly/travis/conf/rest-server.properties
index a9ea865..d44ff6b 100644
--- a/assembly/travis/conf/rest-server.properties
+++ b/assembly/travis/conf/rest-server.properties
@@ -3,10 +3,39 @@
 # gremlin server url, need to be consistent with host and port in gremlin-server.yaml
 #gremlinserver.url=http://127.0.0.1:8182
 
-# graphs list with pair NAME:CONF_PATH
-graphs=[hugegraph:conf/hugegraph.properties]
+graphs=./conf/graphs
 
-# authentication
+# The maximum thread ratio for batch writing, only take effect if the batch.max_write_threads is 0
+batch.max_write_ratio=80
+batch.max_write_threads=0
+
+# authentication configs
+# choose 'com.baidu.hugegraph.auth.StandardAuthenticator' or 'com.baidu.hugegraph.auth.ConfigAuthenticator'
 auth.authenticator=com.baidu.hugegraph.auth.StandardAuthenticator
+
+# for StandardAuthenticator mode
+#auth.graph_store=hugegraph
+# auth client config
+#auth.remote_url=127.0.0.1:8899,127.0.0.1:8898,127.0.0.1:8897
+
+# for ConfigAuthenticator mode
 #auth.admin_token=
 #auth.user_tokens=[]
+
+# rpc group configs of multi graph servers
+# rpc server configs
+rpc.server_host=127.0.0.1
+rpc.server_port=8090
+#rpc.server_timeout=30
+
+# rpc client configs (like enable to keep cache consistency)
+rpc.remote_url=127.0.0.1:8090
+#rpc.client_connect_timeout=20
+#rpc.client_reconnect_period=10
+#rpc.client_read_timeout=40
+#rpc.client_retries=3
+#rpc.client_load_balancer=consistentHash
+
+# lightweight load balancing (beta)
+server.id=server-1
+server.role=master
diff --git a/assembly/travis/install-hugegraph-from-source.sh b/assembly/travis/install-hugegraph-from-source.sh
new file mode 100755
index 0000000..3d12053
--- /dev/null
+++ b/assembly/travis/install-hugegraph-from-source.sh
@@ -0,0 +1,46 @@
+#!/bin/bash
+set -ev
+if [[ $# -ne 1 ]]; then
+    echo "Must pass commit id of hugegraph repo"
+    exit 1
+fi
+
+COMMIT_ID=$1
+HUGEGRAPH_GIT_URL="https://github.com/hugegraph/hugegraph.git"
+GIT_DIR=hugegraph
+
+# download code and compile
+git clone --depth 100 ${HUGEGRAPH_GIT_URL}
+cd "${GIT_DIR}"
+git checkout ${COMMIT_ID}
+mvn package -DskipTests
+
+TAR=$(echo hugegraph-*.tar.gz)
+tar -zxvf "${TAR}" -C ../
+cd ../
+rm -rf "${GIT_DIR}"
+
+HTTP_SERVER_DIR=$(echo hugegraph-*)
+HTTPS_SERVER_DIR="hugegraph_https"
+
+cp -r "${HTTP_SERVER_DIR}" "${HTTPS_SERVER_DIR}"
+
+# config auth options just for http server (must keep '/.')
+cp -rf "${TRAVIS_DIR}"/conf/. "${HTTP_SERVER_DIR}"/conf/
+
+# start HugeGraphServer with http protocol
+cd "${HTTP_SERVER_DIR}"
+echo -e "pa" | bin/init-store.sh || exit 1
+bin/start-hugegraph.sh || exit 1
+
+# config options for https server
+cd ../"${HTTPS_SERVER_DIR}"
+REST_SERVER_CONFIG="conf/rest-server.properties"
+GREMLIN_SERVER_CONFIG="conf/gremlin-server.yaml"
+sed -i "s?http://127.0.0.1:8080?https://127.0.0.1:8443?g" "$REST_SERVER_CONFIG"
+sed -i "s/#port: 8182/port: 8282/g" "$GREMLIN_SERVER_CONFIG"
+echo "gremlinserver.url=http://127.0.0.1:8282" >> ${REST_SERVER_CONFIG}
+# start HugeGraphServer with https protocol
+bin/init-store.sh
+bin/start-hugegraph.sh
+cd ../
diff --git a/assembly/travis/install-hugegraph.sh b/assembly/travis/install-hugegraph.sh
deleted file mode 100755
index 3c4eedf..0000000
--- a/assembly/travis/install-hugegraph.sh
+++ /dev/null
@@ -1,45 +0,0 @@
-#!/bin/bash
-
-set -ev
-
-TRAVIS_DIR=`dirname $0`
-
-if [ $# -ne 1 ]; then
-    echo "Must pass base branch name of pull request"
-    exit 1
-fi
-
-CLIENT_BRANCH=$1
-HUGEGRAPH_BRANCH=$CLIENT_BRANCH
-
-HUGEGRAPH_GIT_URL="https://github.com/hugegraph/hugegraph.git"
-
-git clone $HUGEGRAPH_GIT_URL
-
-cd hugegraph
-
-git checkout $HUGEGRAPH_BRANCH
-
-mvn package -DskipTests
-
-mv hugegraph-*.tar.gz ../
-
-cd ../
-
-rm -rf hugegraph
-
-tar -zxvf hugegraph-*.tar.gz
-
-HTTPS_SERVER_DIR="hugegraph_https"
-
-mkdir $HTTPS_SERVER_DIR
-
-cp -r hugegraph-*/. $HTTPS_SERVER_DIR
-
-cd hugegraph-*
-
-cp ../$TRAVIS_DIR/conf/* conf
-
-echo -e "123456" | bin/init-store.sh
-
-bin/start-hugegraph.sh
diff --git a/pom.xml b/pom.xml
index 31579ba..3c6e06d 100644
--- a/pom.xml
+++ b/pom.xml
@@ -5,7 +5,7 @@
 
     <groupId>com.baidu.xbu-data</groupId>
     <artifactId>hugegraph-tools</artifactId>
-    <version>1.5.0</version>
+    <version>1.6.0</version>
     <packaging>jar</packaging>
     <url>http://maven.apache.org</url>
     <name>${project.artifactId}</name>
@@ -20,7 +20,7 @@
         <java.version>1.8</java.version>
         <source.encoding>UTF-8</source.encoding>
         <maven.build.timestamp.format>yyyy-MM-dd HH:mm:ssZ</maven.build.timestamp.format>
-        <hugegraph-client-version>1.9.3</hugegraph-client-version>
+        <hugegraph-client-version>2.0.1</hugegraph-client-version>
         <jcommand-version>1.72</jcommand-version>
         <hadoop-version>3.1.1</hadoop-version>
         <guava.version>25.1-jre</guava.version>
diff --git a/src/main/java/com/baidu/hugegraph/manager/GraphsManager.java b/src/main/java/com/baidu/hugegraph/manager/GraphsManager.java
index 1b27c05..6561975 100644
--- a/src/main/java/com/baidu/hugegraph/manager/GraphsManager.java
+++ b/src/main/java/com/baidu/hugegraph/manager/GraphsManager.java
@@ -41,7 +41,7 @@
     }
 
     public void clear(String graph, String confirmMessage) {
-        this.client.graphs().clear(graph, confirmMessage);
+        this.client.graphs().clearGraph(graph, confirmMessage);
     }
 
     public void mode(String graph, GraphMode mode) {
diff --git a/src/test/java/com/baidu/hugegraph/test/functional/AuthTest.java b/src/test/java/com/baidu/hugegraph/test/functional/AuthTest.java
index 5d3ad3a..f720dda 100644
--- a/src/test/java/com/baidu/hugegraph/test/functional/AuthTest.java
+++ b/src/test/java/com/baidu/hugegraph/test/functional/AuthTest.java
@@ -24,7 +24,7 @@
     public static final String DEFAULT_URL = "./auth-backup-restore/";
     public static final String DEFAULT_TEST_URL = "/auth/";
     public static final String USER_NAME = "admin";
-    public static final String USER_PASSWORD = "123456";
+    public static final String USER_PASSWORD = "pa";
     public static final String URL = "http://127.0.0.1:8080";
     public static final String GRAPH = "hugegraph";
     public static final Integer TIME_OUT = 30;