use of com.baidu.hugegraph.loader.executor.LoadOptions 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 : ");
}
use of com.baidu.hugegraph.loader.executor.LoadOptions in project incubator-hugegraph-toolchain by apache.
the class Printer method printFinalProgress.
public static void printFinalProgress(LoadContext context) {
LoadOptions options = context.options();
if (!options.printProgress) {
return;
}
LoadSummary summary = context.summary();
long vertexLoaded = summary.vertexLoaded();
long edgeLoaded = summary.edgeLoaded();
System.out.println(vertexLoaded + SLASH + edgeLoaded);
}
use of com.baidu.hugegraph.loader.executor.LoadOptions in project incubator-hugegraph-toolchain by apache.
the class BatchInsertTask method waitThenRetry.
private int waitThenRetry(int retryCount, RuntimeException e) {
LoadOptions options = this.options();
if (options.retryTimes <= 0) {
return retryCount;
}
if (++retryCount > options.retryTimes) {
LOG.error("Batch insert has been retried more than {} times", options.retryTimes);
throw e;
}
long interval = (1L << retryCount) * options.retryInterval;
LOG.debug("Batch insert will sleep {} seconds then do the {}th retry", interval, retryCount);
try {
Thread.sleep(interval * 1000L);
} catch (InterruptedException ignored) {
// That's fine, just continue.
}
return retryCount;
}
Aggregations