Skip to content

Commit

Permalink
Add requested logging
Browse files Browse the repository at this point in the history
  • Loading branch information
Michael Burman authored and jsanda committed Apr 5, 2018
1 parent 26eb378 commit 6e726cd
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@ public Completable call(JobDetails jobDetails) {

// TODO Optimization - new worker per token - use parallelism in Cassandra (with configured parallelism)
return metricsService.compressBlock(startOfSlice, pageSize, maxReadConcurrency)
.doOnError(t -> logger.errorf("Compression job failed: %s", t.getMessage()))
.doOnCompleted(() -> {
stopwatch.stop();
logger.info("Finished processing data in " + stopwatch.elapsed(TimeUnit.MILLISECONDS) +
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -809,7 +809,15 @@ public <T> Observable<Row> findMetricsInMetricsIndex(String tenantId, MetricType
@Override
public Set<Long> findExpiredTables(long startTime) {
Long currentTableKey = prepMap.floorKey(startTime);
return prepMap.subMap(0L, false, currentTableKey, true).keySet();
NavigableMap<Long, Map<Integer, PreparedStatement>> expiredTempMap =
prepMap.subMap(0L, false, currentTableKey, true);
if(log.isDebugEnabled()) {
log.debug(String.format("Returning expired keys from %d to %d, in total %d items",
expiredTempMap.firstEntry().getKey(),
expiredTempMap.lastEntry().getKey(),
expiredTempMap.size())); // No idea why debugf throws compiler issues
}
return expiredTempMap.keySet();
}

/**
Expand All @@ -836,7 +844,7 @@ public Observable<Observable<Row>> findAllDataFromBucket(long timestamp, int pag

return Observable.from(getTokenRanges())
.map(tr -> rxSession.executeAndFetch(
getTempStatement(MetricType.UNDEFINED, TempStatement.SCAN_WITH_TOKEN_RANGES, timestamp)
ts
.bind()
.setToken(0, tr.getStart())
.setToken(1, tr.getEnd())
Expand Down

0 comments on commit 6e726cd

Please sign in to comment.