Skip to content

Commit

Permalink
add more trace for locators rollup
Browse files Browse the repository at this point in the history
  • Loading branch information
Vinny Ly committed Sep 15, 2016
1 parent 16fd409 commit f19a643
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -72,13 +72,15 @@ public Collection<Locator> getLocators(long shard) throws IOException {
RowQuery<Long, Locator> query = AstyanaxIO.getKeyspace()
.prepareQuery(CassandraModel.CF_METRICS_LOCATOR)
.getKey(shard);
if (LOG.isTraceEnabled())
LOG.trace("ALocatorIO.getLocators() executing: select * from \"" + CassandraModel.KEYSPACE + "\"." + CassandraModel.CF_METRICS_LOCATOR + " where key=" + Long.toString(shard));
return query.execute().getResult().getColumnNames();
} catch (NotFoundException e) {
Instrumentation.markNotFound(CassandraModel.CF_METRICS_LOCATOR_NAME);
return Collections.emptySet();
} catch (ConnectionException ex) {
Instrumentation.markReadError(ex);
LOG.error("Connection exception during getLocators(" + Long.toString(shard) + " )", ex);
LOG.error("Connection exception during getLocators(" + Long.toString(shard) + ")", ex);
throw new IOException("Error reading locators", ex);
} finally {
ctx.stop();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,8 @@ public void run() {
final RollupBatchWriter rollupBatchWriter = createRollupBatchWriter(executionContext);

Set<Locator> locators = getLocators(executionContext);

if (log.isTraceEnabled())
log.trace("locators retrieved: {}", locators.size());
for (Locator locator : locators) {
rollCount = processLocator(rollCount, executionContext, rollupBatchWriter, locator);
}
Expand Down Expand Up @@ -192,9 +193,9 @@ public Set<Locator> getLocators(RollupExecutionContext executionContext) {
// get a list of all locators to rollup for a shard
locators.addAll(IOContainer.fromConfig().getLocatorIO().getLocators(getShard()));
locatorsPerShard.update(locators.size());
} catch (Exception e) {
executionContext.markUnsuccessful(e);
} catch (Throwable e) {
log.error("Failed reading locators for slot: " + getParentSlot(), e);
executionContext.markUnsuccessful(e);
}
return locators;
}
Expand Down

0 comments on commit f19a643

Please sign in to comment.