Skip to content

Commit

Permalink
fix qep mapping, reduce logs for diff
Browse files Browse the repository at this point in the history
  • Loading branch information
ate47 committed Apr 25, 2024
1 parent 2aceeab commit 4b0f442
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -259,15 +259,16 @@ private KCatImpl(List<?> hdtFileNames, List<? extends Bitmap> 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;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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++;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down Expand Up @@ -721,19 +723,22 @@ 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);
Path map2DestinationPath = getMap2DestinationPath(role);
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)) {
Expand All @@ -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);
Expand Down

0 comments on commit 4b0f442

Please sign in to comment.