added other check on es return code
This commit is contained in:
parent
173b0c289e
commit
5eaa655f01
|
@ -125,6 +125,7 @@ public class BulkUpload {
|
|||
request.add(new IndexRequest(elasticSearchIndexName).id(idES)
|
||||
.source(ace.toJson(),XContentType.JSON));
|
||||
|
||||
log.info("Indexing: "+idES+" :: "+ace.toJson());
|
||||
BulkResponse bulkResponse = client.bulk(request, RequestOptions.DEFAULT);
|
||||
if (bulkResponse!=null) {
|
||||
esResponseCode = bulkResponse.status().getStatus();
|
||||
|
@ -133,6 +134,9 @@ public class BulkUpload {
|
|||
log.error("FailureMessage: " + bulkResponse.buildFailureMessage());
|
||||
}
|
||||
}
|
||||
else {
|
||||
esResponseCode = -3;
|
||||
}
|
||||
} catch (Exception e) {
|
||||
log.error("Indexing "+e.getMessage());
|
||||
return -1;
|
||||
|
|
|
@ -63,6 +63,7 @@ public class RunSPARQLQueryService {
|
|||
if (queryTemplate==null)
|
||||
return null;
|
||||
final String selectQueryTemplate = queryTemplate.replaceAll("%datasource", datasource).replaceAll("%collectionId", collectionId);
|
||||
log.info("Start indexing "+ recordIds.size()+ " records ...");
|
||||
recordIds.forEach(recordId -> {
|
||||
int operationResult = executeQueryGraph(selectQueryTemplate, recordId, isCollection);
|
||||
log.info("Indexing final code: "+Integer.toString(operationResult));
|
||||
|
@ -71,9 +72,9 @@ public class RunSPARQLQueryService {
|
|||
}
|
||||
|
||||
private int executeQueryGraph(String selectQueryTemplate, String recordId, boolean isCollection){
|
||||
// to avoid heap overload on graphdb
|
||||
// decrease queries execution rate to avoid heap overload on graphdb
|
||||
try {
|
||||
Thread.sleep(100);
|
||||
Thread.sleep(50);
|
||||
} catch (InterruptedException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue