diff --git a/qendpoint-core/src/main/java/com/the_qa_company/qendpoint/core/dictionary/impl/kcat/KCatImpl.java b/qendpoint-core/src/main/java/com/the_qa_company/qendpoint/core/dictionary/impl/kcat/KCatImpl.java index 338bb8c7..e4c0f11a 100644 --- a/qendpoint-core/src/main/java/com/the_qa_company/qendpoint/core/dictionary/impl/kcat/KCatImpl.java +++ b/qendpoint-core/src/main/java/com/the_qa_company/qendpoint/core/dictionary/impl/kcat/KCatImpl.java @@ -259,15 +259,16 @@ private KCatImpl(List hdtFileNames, List deleteBitmaps, HDT // fill the maps based on the deleted triples long c = 0; - @SuppressWarnings("resource") MultiLayerBitmap bm = MultiLayerBitmap.ofBitmap(deleteBitmap); while (searchAll.hasNext()) { TripleID tripleID = searchAll.next(); - iListener.notifyProgress((float) (c++ * 10000 / numberOfElements) / 100f, - "building diff bitmaps " + c + "/" + numberOfElements + " (hdt " + index + "/" - + hdts.length + ")"); + if (c % 10000 == 0) { + iListener.notifyProgress((float) (c++ * 10000 / numberOfElements) / 100f, + "building diff bitmaps " + c + "/" + numberOfElements + " (hdt " + index + "/" + + hdts.length + ")"); + } long g = quad ? (tripleID.getGraph() - 1) : 0; diff --git a/qendpoint-core/src/main/java/com/the_qa_company/qendpoint/core/hdt/impl/diskimport/CatTreeImpl.java b/qendpoint-core/src/main/java/com/the_qa_company/qendpoint/core/hdt/impl/diskimport/CatTreeImpl.java index 52ad8b45..9a81d97f 100644 --- a/qendpoint-core/src/main/java/com/the_qa_company/qendpoint/core/hdt/impl/diskimport/CatTreeImpl.java +++ b/qendpoint-core/src/main/java/com/the_qa_company/qendpoint/core/hdt/impl/diskimport/CatTreeImpl.java @@ -378,7 +378,8 @@ public HDTResult doGenerationSync(RDFFluxStop fluxStop, HDTSupplier supplier, It int idx = 0; for (HDTFile file : files) { - Path target = futureHDTLocation.resolveSibling(futureHDTLocation.getFileName() + "." + idx + ".hdt"); + Path target = futureHDTLocation + .resolveSibling(futureHDTLocation.getFileName() + "." + idx + ".hdt"); Files.move(file.hdtFile, target, StandardCopyOption.REPLACE_EXISTING); results.add(new MapOnCallHDT(target)); idx++; diff --git a/qendpoint-core/src/main/java/com/the_qa_company/qendpoint/core/storage/QEPMap.java b/qendpoint-core/src/main/java/com/the_qa_company/qendpoint/core/storage/QEPMap.java index c42bbf21..0cb9dd6a 100644 --- a/qendpoint-core/src/main/java/com/the_qa_company/qendpoint/core/storage/QEPMap.java +++ b/qendpoint-core/src/main/java/com/the_qa_company/qendpoint/core/storage/QEPMap.java @@ -282,10 +282,12 @@ public void sync() throws IOException { for (int i = 0; i < index1Size.length; i++) { index1Size[i] = header.getLong(shift); + index1Location[i] = shift; shift += Long.BYTES; } for (int i = 0; i < index2Size.length; i++) { index2Size[i] = header.getLong(shift); + index2Location[i] = shift; shift += Long.BYTES; } @@ -721,6 +723,7 @@ public void syncOld(byte version) throws IOException { * @throws IOException file state error */ private boolean checkRegen(TripleComponentRole role, boolean created) throws IOException { + // predicate doesn't have 2 maps Path map1OriginPath = getMap1OriginPath(role); Path map1DestinationPath = getMap1DestinationPath(role); Path map2OriginPath = getMap2OriginPath(role); @@ -728,12 +731,14 @@ private boolean checkRegen(TripleComponentRole role, boolean created) throws IOE if (created) { checkNotExists(map1OriginPath); checkNotExists(map1DestinationPath); - checkNotExists(map2OriginPath); - checkNotExists(map2DestinationPath); + if (role != PREDICATE) { + checkNotExists(map2OriginPath); + checkNotExists(map2DestinationPath); + } return true; } else { boolean regen = !(Files.exists(map1OriginPath) && Files.exists(map1DestinationPath) - && Files.exists(map2OriginPath) && Files.exists(map2DestinationPath)); + && (role == PREDICATE || (Files.exists(map2OriginPath) && Files.exists(map2DestinationPath)))); if (regen) { boolean warn = false; if (Files.exists(map1OriginPath)) { @@ -746,15 +751,17 @@ private boolean checkRegen(TripleComponentRole role, boolean created) throws IOE map1DestinationPath); warn = true; } - if (Files.exists(map2OriginPath)) { - logger.warn("{}: map2OriginPath[{}] is present, it will be removed! {}", this, role, - map2OriginPath); - warn = true; - } - if (Files.exists(map2DestinationPath)) { - logger.warn("{}: map2DestinationPath[{}] is present, it will be removed! {}", this, role, - map2DestinationPath); - warn = true; + if (role != PREDICATE) { + if (Files.exists(map2OriginPath)) { + logger.warn("{}: map2OriginPath[{}] is present, it will be removed! {}", this, role, + map2OriginPath); + warn = true; + } + if (Files.exists(map2DestinationPath)) { + logger.warn("{}: map2DestinationPath[{}] is present, it will be removed! {}", this, role, + map2DestinationPath); + warn = true; + } } if (warn) { logger.warn("{}: has a missing file from the grid", this);