added check on identifier, before indexing

This commit is contained in:
Enrico Ottonello 2020-10-23 12:18:58 +02:00
parent 899f3eb4d9
commit 665a717ca0
2 changed files with 8 additions and 1 deletions

View File

@ -398,6 +398,9 @@ public class GraphDBClient {
public String indexOnESByIdentifier(String datasource, String collectionId, String resourceType, String identifier) throws AriadnePlusPublisherException { public String indexOnESByIdentifier(String datasource, String collectionId, String resourceType, String identifier) throws AriadnePlusPublisherException {
String report = ""; String report = "";
try { try {
if (StringUtils.isBlank(identifier)) {
return "empty identifier";
}
List <String> identifiers = Arrays.asList(identifier); List <String> identifiers = Arrays.asList(identifier);
log.info("Start indexing from "+ datasource + " " + collectionId); log.info("Start indexing from "+ datasource + " " + collectionId);
runSPQRLQuery.setupConnection( getWriterUser(), getWriterPwd(), this.graphDBServerUrl, getRepository()); runSPQRLQuery.setupConnection( getWriterUser(), getWriterPwd(), this.graphDBServerUrl, getRepository());

View File

@ -163,7 +163,11 @@ public class RunSPARQLQueryService {
return bulkUpload.index(resourceManager, isCollection); return bulkUpload.index(resourceManager, isCollection);
} catch (HTTPQueryEvaluationException qe) { } catch (HTTPQueryEvaluationException qe) {
log.error(qe); log.error(qe);
return -5; if (qe.getMessage()!=null &&
qe.getMessage().contains("Insufficient free Heap Memory")) {
return -5;
}
return -6;
} catch(Exception e){ } catch(Exception e){
log.error(e); log.error(e);
return -1; return -1;