Search in sources :

Example 1 with LoadProgress

use of com.baidu.hugegraph.loader.progress.LoadProgress in project incubator-hugegraph-toolchain by apache.

the class LoadProgressTest method testTotalLoaded.

@Test
public void testTotalLoaded() {
    String json = "{" + "\"vertex_propgress\": 16," + "\"edge_propgress\": 12," + "\"input_propgress\": {" + "    \"1\":{" + "        \"type\":\"FILE\"," + "        \"loaded_items\":[" + "            {" + "                \"name\":\"vertex_person.csv\"," + "                \"last_modified\":1574346235000," + "                \"checksum\":\"4250397517\"," + "                \"offset\":6" + "            }" + "        ]," + "        \"loading_item\":null" + "    }," + "    \"2\":{" + "        \"type\":\"FILE\"," + "        \"loaded_items\":[" + "            {" + "                \"name\":\"vertex_software.txt\"," + "                \"last_modified\":1575427304000," + "                \"checksum\":\"2992253526\"," + "                \"offset\":2" + "            }" + "        ]," + "        \"loading_item\":null" + "    }," + "    \"3\":{" + "        \"type\":\"FILE\"," + "        \"loaded_items\":[" + "            {" + "                \"name\":\"edge_knows.json\"," + "                \"last_modified\":1576658150000," + "                \"checksum\":\"3108779382\"," + "                \"offset\":2" + "            }" + "        ]," + "        \"loading_item\":null" + "    }," + "    \"4\":{" + "        \"type\":\"FILE\"," + "        \"loaded_items\":[" + "            {" + "                \"name\":\"edge_created.json\"," + "                \"last_modified\":1576659393000," + "                \"checksum\":\"1026646359\"," + "                \"offset\":4" + "            }" + "        ]," + "        \"loading_item\":null" + "    }" + "}}";
    LoadProgress progress = JsonUtil.fromJson(json, LoadProgress.class);
    Assert.assertEquals(16, progress.vertexLoaded());
    Assert.assertEquals(12, progress.edgeLoaded());
}
Also used : LoadProgress(com.baidu.hugegraph.loader.progress.LoadProgress) LoadTest(com.baidu.hugegraph.loader.test.functional.LoadTest) Test(org.junit.Test)

Example 2 with LoadProgress

use of com.baidu.hugegraph.loader.progress.LoadProgress in project incubator-hugegraph-toolchain by apache.

the class Printer method printRealtimeProgress.

public static void printRealtimeProgress(LoadContext context) {
    LoadOptions options = context.options();
    if (!options.printProgress) {
        return;
    }
    System.out.printf(">> HugeGraphLoader worked in %s%n", options.workModeString());
    if (options.incrementalMode) {
        LoadProgress progress = context.oldProgress();
        System.out.printf("vertices/edges loaded last time: %s/%s%n", progress.vertexLoaded(), progress.edgeLoaded());
    }
    System.out.print("vertices/edges loaded this time : ");
}
Also used : LoadOptions(com.baidu.hugegraph.loader.executor.LoadOptions) LoadProgress(com.baidu.hugegraph.loader.progress.LoadProgress)

Aggregations

LoadProgress (com.baidu.hugegraph.loader.progress.LoadProgress)2 LoadOptions (com.baidu.hugegraph.loader.executor.LoadOptions)1 LoadTest (com.baidu.hugegraph.loader.test.functional.LoadTest)1 Test (org.junit.Test)1