From 046a7f2f275958a136a5d92bee39e28f50066d26 Mon Sep 17 00:00:00 2001 From: liningrui Date: Thu, 10 Jan 2019 20:46:31 +0800 Subject: [PATCH] Some small modification Change-Id: I80ff7c0778e52b4ca939f42c7a4e111da5b09406 --- .../src/main/java/com/baidu/hugegraph/util/DateUtil.java | 2 +- hugegraph-dist/src/assembly/static/bin/start-hugegraph.sh | 6 +++--- .../main/java/com/baidu/hugegraph/example/Example2.java | 7 ------- .../src/main/java/com/baidu/hugegraph/api/BaseApiTest.java | 2 ++ 4 files changed, 6 insertions(+), 11 deletions(-) diff --git a/hugegraph-core/src/main/java/com/baidu/hugegraph/util/DateUtil.java b/hugegraph-core/src/main/java/com/baidu/hugegraph/util/DateUtil.java index f6ff4088c9..c582243f80 100644 --- a/hugegraph-core/src/main/java/com/baidu/hugegraph/util/DateUtil.java +++ b/hugegraph-core/src/main/java/com/baidu/hugegraph/util/DateUtil.java @@ -34,7 +34,7 @@ public final class DateUtil { "yyyy-MM-dd", "^\\d{4}-\\d{1,2}-\\d{1,2}\\s\\d{2}:\\d{2}:\\d{2}", "yyyy-MM-dd HH:mm:ss", - "^\\d{4}-\\d{1,2}-\\d{1,2}\\s\\d{2}:\\d{2}:\\d{2}\\.\\d{3}", + "^\\d{4}-\\d{1,2}-\\d{1,2}\\s\\d{2}:\\d{2}:\\d{2}\\.\\d{1,3}", "yyyy-MM-dd HH:mm:ss.SSS" ); diff --git a/hugegraph-dist/src/assembly/static/bin/start-hugegraph.sh b/hugegraph-dist/src/assembly/static/bin/start-hugegraph.sh index 0b4733fc62..aa1c5b9a44 100755 --- a/hugegraph-dist/src/assembly/static/bin/start-hugegraph.sh +++ b/hugegraph-dist/src/assembly/static/bin/start-hugegraph.sh @@ -53,6 +53,9 @@ else fi PID="$!" +# Write pid to file +echo "$PID" > $PID_FILE + trap 'kill $PID; exit' SIGHUP SIGINT SIGQUIT SIGTERM wait_for_startup 'HugeGraphServer' "$REST_SERVER_URL/graphs" $SERVER_STARTUP_TIMEOUT_S || { @@ -61,9 +64,6 @@ wait_for_startup 'HugeGraphServer' "$REST_SERVER_URL/graphs" $SERVER_STARTUP_TIM } disown -# Write pid to file -echo "$PID" > $PID_FILE - if [ "$OPEN_MONITOR" == "true" ]; then $BIN/start-monitor.sh if [ $? -ne 0 ]; then diff --git a/hugegraph-example/src/main/java/com/baidu/hugegraph/example/Example2.java b/hugegraph-example/src/main/java/com/baidu/hugegraph/example/Example2.java index 64b9b34106..aa2a958091 100644 --- a/hugegraph-example/src/main/java/com/baidu/hugegraph/example/Example2.java +++ b/hugegraph-example/src/main/java/com/baidu/hugegraph/example/Example2.java @@ -164,13 +164,6 @@ public static void load(final HugeGraph graph) { .ifNotExist() .create(); - schema.indexLabel("personByName") - .onV("person") - .by("name") - .secondary() - .ifNotExist() - .create(); - schema.indexLabel("personByCity") .onV("person") .by("city") diff --git a/hugegraph-test/src/main/java/com/baidu/hugegraph/api/BaseApiTest.java b/hugegraph-test/src/main/java/com/baidu/hugegraph/api/BaseApiTest.java index 90285063b7..543eddbb52 100644 --- a/hugegraph-test/src/main/java/com/baidu/hugegraph/api/BaseApiTest.java +++ b/hugegraph-test/src/main/java/com/baidu/hugegraph/api/BaseApiTest.java @@ -338,6 +338,7 @@ protected static void clearGraph() { throw new HugeException("Failed to list " + type); } String content = r.readEntity(String.class); + @SuppressWarnings("rawtypes") List list = readList(content, type, Map.class); List ids = list.stream().map(e -> e.get("id")) .collect(Collectors.toList()); @@ -359,6 +360,7 @@ protected static void clearSchema() { throw new HugeException("Failed to list " + type); } String content = r.readEntity(String.class); + @SuppressWarnings("rawtypes") List list = readList(content, type, Map.class); List names = list.stream().map(e -> e.get("name")) .collect(Collectors.toList());