Skip to content

Commit

Permalink
feat(sparkJobs): If tracing downsampler, log chunks read from cassand…
Browse files Browse the repository at this point in the history
…ra (#756)
  • Loading branch information
vishramachandran committed May 21, 2020
1 parent aaea895 commit 1765ed9
Showing 1 changed file with 10 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -270,6 +270,16 @@ class BatchDownsampler(settings: DownsamplerSettings) extends Instance with Seri
val tsAcc = chunkset.vectorAccessor(timestampCol)
val tsReader = rawPartToDownsample.chunkReader(timestampCol, tsAcc, tsPtr).asLongReader

if (shouldTrace) {
downsamplers.zipWithIndex.foreach { case (d, i) =>
val ptr = chunkset.vectorAddress(i)
val acc = chunkset.vectorAccessor(i)
val reader = rawPartToDownsample.chunkReader(i, acc, ptr)
DownsamplerContext.dsLogger.info(s"Hex Vectors: Col $i for ${rawPartToDownsample.stringPartition} uses " +
s"downsampler ${d.encoded} vector=${reader.toHexString(acc, ptr)}RemoveEOL")
}
}

val startRow = tsReader.binarySearch(tsAcc, tsPtr, userTimeStart) & 0x7fffffff
// userTimeEndExclusive-1 since ceilingIndex does an inclusive check
val endRow = Math.min(tsReader.ceilingIndex(tsAcc, tsPtr, userTimeEndExclusive - 1), chunkset.numRows - 1)
Expand Down

0 comments on commit 1765ed9

Please sign in to comment.