for(int i = 0; i < pathCachePtr; i++) {
final long old;
try {
old = pathIndexer.add(keys[i], values[i]);
} catch (DbException e) {
throw new XQRTException("failed flushing PathIndexer. key: " + keys[i]
+ ", value: " + values[i], e);
}
if(old != -1L) {
++pathIdxDuplicates;
}
}
pathIdxEntries += pathCachePtr;
pathCachePtr = 0;
}
if(labelCachePtr > 0) {
final long[] rowids = labelKeys;
final byte[][] labels = labelValues;
for(int i = 0; i < labelCachePtr; i++) {
try {
labelIndexer.putValue(rowids[i], labels[i]);
} catch (DbException e) {
throw new XQRTException("failed flushing PathIndexer. DTM_ROWID: " + rowids[i]
+ ", LABEL: " + labels[i], e);
}
}
labelIdxEntries += labelCachePtr;
labelCachePtr = 0;
}
try {
pathIndexer.flush(true);
//valueIndexer.flush(true);
labelIndexer.flush(true, true);
} catch (DbException dbe) {
throw new XQRTException("failed flushing indexer", dbe);
}
final long pathPages = pathIndexer.getPageCount();
docProps.setProperty(PATHS_IDX_PAGES + docName, String.valueOf(pathPages));
docProps.setProperty(PATHS_IDX_ENTRIES + docName, String.valueOf(pathIdxEntries));