Skip to content

Commit

Permalink
decrease the page size for old KG
Browse files Browse the repository at this point in the history
  • Loading branch information
olinux committed Mar 7, 2022
1 parent 04e5d2f commit 85f4f5c
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ public <v1Input, v2Input, v3Input, Target extends TargetInstance> List<ErrorRepo
}
boolean indexDataFromOldKG = dataStage == DataStage.RELEASED || !translatorModel.isOnlyV3ForInProgress();
if (indexDataFromOldKG && translatorModel.getV2translator() != null) {
final UpdateResult updateResultV2 = update(kgV2, translatorModel.getTargetClass(), translatorModel.getV2translator(), translatorModel.getBulkSize(), dataStage, handledIdentifiers, instance -> {
final UpdateResult updateResultV2 = update(kgV2, translatorModel.getTargetClass(), translatorModel.getV2translator(), translatorModel.getBulkSizeV2(), dataStage, handledIdentifiers, instance -> {
if(translatorModel.getMerger()!=null){
final Translator<v1Input, Target, ? extends ResultsOfKGv2<v1Input>> v1translator = translatorModel.getV1translator();
final List<Target> fromV1 = v1translator != null ? getRelatedInstance(kgV2, v1translator, instance, dataStage) : null;
Expand All @@ -149,7 +149,7 @@ public <v1Input, v2Input, v3Input, Target extends TargetInstance> List<ErrorRepo
nonSearchableIds.addAll(updateResultV2.nonSearchableIds);
}
if (indexDataFromOldKG && translatorModel.getV1translator() != null) {
final UpdateResult updateResultV1 = update(kgV2, translatorModel.getTargetClass(), translatorModel.getV1translator(), translatorModel.getBulkSize(), dataStage, handledIdentifiers, null, translatorModel.isAutoRelease(), temporary);
final UpdateResult updateResultV1 = update(kgV2, translatorModel.getTargetClass(), translatorModel.getV1translator(), translatorModel.getBulkSizeV2(), dataStage, handledIdentifiers, null, translatorModel.isAutoRelease(), temporary);
handledIdentifiers.addAll(updateResultV1.handledIdentifiers);
searchableIds.addAll(updateResultV1.searchableIds);
nonSearchableIds.addAll(updateResultV1.nonSearchableIds);
Expand Down Expand Up @@ -184,7 +184,7 @@ private <Target extends TargetInstance> void clearNonResolvableReferences(List<T
final Set<String> existingRefs = elasticSearchController.existingDocuments(refs, dataStage);
references.forEach(r -> {
if(r.getReference()!=null && !existingRefs.contains(r.getReference())){
logger.warn(String.format("Was not able to find instance %s in database for stage %s - remove reference", r.getReference(), dataStage));
// logger.warn(String.format("Was not able to find instance %s in database for stage %s - remove reference", r.getReference(), dataStage));
r.setReference(null);
}
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,4 +93,9 @@ public int getBulkSize() {
//TODO handle the "big" source models by restraining the bulk size
return 1000;
}

public int getBulkSizeV2() {
//TODO handle the "big" source models by restraining the bulk size
return 200;
}
}

0 comments on commit 85f4f5c

Please sign in to comment.