use of com.baidu.hugegraph.entity.load.LoadParameter in project incubator-hugegraph-toolchain by apache.
the class LoadTaskService method buildLoadOptions.
private LoadOptions buildLoadOptions(GraphConnection connection, FileMapping fileMapping) {
LoadOptions options = new LoadOptions();
// Fill with input and server params
options.file = fileMapping.getPath();
// No need to specify a schema file
options.host = connection.getHost();
options.port = connection.getPort();
options.graph = connection.getGraph();
options.username = connection.getUsername();
options.token = connection.getPassword();
options.protocol = connection.getProtocol();
options.trustStoreFile = connection.getTrustStoreFile();
options.trustStoreToken = connection.getTrustStorePassword();
// Fill with load parameters
LoadParameter parameter = fileMapping.getLoadParameter();
options.checkVertex = parameter.isCheckVertex();
options.timeout = parameter.getInsertTimeout();
options.maxReadErrors = parameter.getMaxParseErrors();
options.maxParseErrors = parameter.getMaxParseErrors();
options.maxInsertErrors = parameter.getMaxInsertErrors();
options.retryTimes = parameter.getRetryTimes();
options.retryInterval = parameter.getRetryInterval();
// Optimized for hubble
options.batchInsertThreads = 4;
options.singleInsertThreads = 4;
options.batchSize = 100;
return options;
}
use of com.baidu.hugegraph.entity.load.LoadParameter in project incubator-hugegraph-toolchain by apache.
the class FileMappingController method loadParameter.
/**
* TODO: All file mapping share one load paramter now, should be separated
* in actually
*/
@PostMapping("load-parameter")
public void loadParameter(@RequestBody LoadParameter newEntity) {
this.checkLoadParameter(newEntity);
List<FileMapping> mappings = this.service.listAll();
for (FileMapping mapping : mappings) {
LoadParameter oldEntity = mapping.getLoadParameter();
LoadParameter entity = this.mergeEntity(oldEntity, newEntity);
mapping.setLoadParameter(entity);
this.service.update(mapping);
}
}
Aggregations