Skip to content
Merged
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,7 @@ class RollupShardIndexer {
}

public RollupIndexerAction.ShardRollupResponse execute() throws IOException {
long startTime = System.currentTimeMillis();
BulkProcessor bulkProcessor = createBulkProcessor();
try (searcher; bulkProcessor) {
// TODO: add cancellations
Expand All @@ -138,11 +139,12 @@ public RollupIndexerAction.ShardRollupResponse execute() throws IOException {
}

logger.info(
"Shard {} successfully sent [{}], indexed [{}], failed [{}]",
"Shard [{}] successfully sent [{}], indexed [{}], failed [{}], took [{}]",
indexShard.shardId(),
numSent.get(),
numIndexed.get(),
numFailed.get()
numFailed.get(),
TimeValue.timeValueMillis(System.currentTimeMillis() - startTime)
);

if (numIndexed.get() != numSent.get()) {
Expand Down Expand Up @@ -234,13 +236,15 @@ public void collect(int docId, long owningBucketOrd) throws IOException {
final long timestamp = aggCtx.getTimestamp();
final long histoTimestamp = rounding.round(timestamp);

logger.trace(
"Doc: [{}] - _tsid: [{}], @timestamp: [{}}] -> rollup bucket ts: [{}]",
docId,
DocValueFormat.TIME_SERIES_ID.format(tsid),
timestampFormat.format(timestamp),
timestampFormat.format(histoTimestamp)
);
if (logger.isTraceEnabled()) {
logger.trace(
"Doc: [{}] - _tsid: [{}], @timestamp: [{}}] -> rollup bucket ts: [{}]",
docId,
DocValueFormat.TIME_SERIES_ID.format(tsid),
timestampFormat.format(timestamp),
timestampFormat.format(histoTimestamp)
);
}

/*
* Sanity checks to ensure that we receive documents in the correct order
Expand Down Expand Up @@ -344,11 +348,14 @@ public RollupBucketBuilder init(BytesRef tsid, long timestamp) {
this.timestamp = timestamp;
this.docCount = 0;
this.metricFieldProducers.values().stream().forEach(p -> p.reset());
logger.trace(
"New bucket for _tsid: [{}], @timestamp: [{}]",
DocValueFormat.TIME_SERIES_ID.format(tsid),
timestampFormat.format(timestamp)
);
if (logger.isTraceEnabled()) {
logger.trace(
"New bucket for _tsid: [{}], @timestamp: [{}]",
DocValueFormat.TIME_SERIES_ID.format(tsid),
timestampFormat.format(timestamp)
);
}

return this;
}

Expand Down