Skip to content

Commit

Permalink
Added timing details around fillSet (#2540)
Browse files Browse the repository at this point in the history
  • Loading branch information
ivakegg authored Sep 17, 2024
1 parent c414470 commit 71435d5
Showing 1 changed file with 19 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -769,8 +769,8 @@ protected void findTop() throws IOException {
// no need to check containership if not returning sorted uids
if (!sortedUIDs || this.lastRangeSeeked.contains(key)) {
this.topKey = key;
if (log.isDebugEnabled()) {
log.debug("setting as topKey " + topKey);
if (log.isTraceEnabled()) {
log.trace("setting as topKey " + topKey);
}
break;
}
Expand Down Expand Up @@ -879,6 +879,7 @@ private void fillSortedSets() throws IOException {
if (log.isDebugEnabled()) {
log.debug("Processing " + boundingFiRanges + " for " + this);
}
long startFillSets = System.currentTimeMillis();

TotalResults totalResults = new TotalResults(maxResults);

Expand Down Expand Up @@ -916,8 +917,11 @@ private void fillSortedSets() throws IOException {
}
}

long fillSetTiming = System.currentTimeMillis() - startFillSets;
log.info("Filled ivarator sets for " + boundingFiRanges.size() + " ranges took " + fillSetTiming + "ms for " + this);

if (failed) {
log.error("Failed to complete ivarator cache: " + result, exception);
log.error("Failed to complete ivarator cache: " + result + " for " + this, exception);
throw new IvaratorException("Failed to complete ivarator cache: " + result, exception);
}

Expand Down Expand Up @@ -1102,6 +1106,7 @@ protected Future<?> fillSet(final Range boundingFiRange, final TotalResults tota

// create runnable
Runnable runnable = () -> {
long startFillSet = System.currentTimeMillis();
if (log.isDebugEnabled()) {
log.debug("Starting fillSet(" + boundingFiRange + ')');
}
Expand Down Expand Up @@ -1210,6 +1215,8 @@ protected Future<?> fillSet(final Range boundingFiRange, final TotalResults tota
log.error("Failed to complete fillSet(" + boundingFiRange + ")", e);
throw new RuntimeException(e);
} finally {
long timing = System.currentTimeMillis() - startFillSet;
log.info("Completed " + boundingFiRange + " ivarator in " + timing + "ms");
// return the ivarator source back to the pool.
returnPoolSource(source);
if (log.isDebugEnabled()) {
Expand Down Expand Up @@ -1644,4 +1651,13 @@ public void setCollectTimingDetails(boolean collectTimingDetails) {
public void setQuerySpanCollector(QuerySpanCollector querySpanCollector) {
this.querySpanCollector = querySpanCollector;
}

@Override
public String toString() {
StringBuilder builder = new StringBuilder();
builder.append("DatawaveFieldIndexCachingIteratorJexl (").append(queryId).append(") fName=").append(getFieldName()).append(", fValue=")
.append(getFieldValue()).append(", negated=").append(isNegated()).append("}");
return builder.toString();
}

}

0 comments on commit 71435d5

Please sign in to comment.