Skip to content

Commit

Permalink
add log to debug unit test failure, should revert it when solveing pr…
Browse files Browse the repository at this point in the history
…oblem
  • Loading branch information
zjuwangg committed Dec 24, 2024
1 parent 18f1c01 commit 3845bf4
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -76,15 +76,13 @@ case class UnsafeBytesBufferArray(
assert(bytesBuffer.length == bytesBufferLengths(index))
// first to allocate underlying long array
if (null == longArray && index == 0) {
log.debug(s"allocate array $totalBytes, actual longArray size ${(totalBytes + 7) / 8}")
log.warn(s"allocate array $totalBytes, actual longArray size ${(totalBytes + 7) / 8}")
longArray = allocateArray((totalBytes + 7) / 8)
}
if (log.isDebugEnabled) {
log.debug(s"put bytesBuffer at index $index bytesBuffer's length is ${bytesBuffer.length}")
log.debug(
s"bytesBuffer at index $index " +
s"digest ${calculateMD5(bytesBuffer).mkString("Array(", ", ", ")")}")
}
log.warn(s"put bytesBuffer at index $index bytesBuffer's length is ${bytesBuffer.length}")
log.warn(
s"bytesBuffer at index $index " +
s"digest ${calculateMD5(bytesBuffer).mkString("Array(", ", ", ")")}")
Platform.copyMemory(
bytesBuffer,
Platform.BYTE_ARRAY_OFFSET,
Expand All @@ -104,18 +102,16 @@ case class UnsafeBytesBufferArray(
return new Array[Byte](0)
}
val bytes = new Array[Byte](bytesBufferLengths(index))
log.debug(s"get bytesBuffer at index $index bytesBuffer length ${bytes.length}")
log.warn(s"get bytesBuffer at index $index bytesBuffer length ${bytes.length}")
Platform.copyMemory(
longArray.getBaseObject,
longArray.getBaseOffset + bytesBufferOffset(index),
bytes,
Platform.BYTE_ARRAY_OFFSET,
bytesBufferLengths(index))
if (log.isDebugEnabled) {
log.debug(
s"get bytesBuffer at index $index " +
s"digest ${calculateMD5(bytes).mkString("Array(", ", ", ")")}")
}
log.warn(
s"get bytesBuffer at index $index " +
s"digest ${calculateMD5(bytes).mkString("Array(", ", ", ")")}")
bytes
}

Expand All @@ -141,7 +137,7 @@ case class UnsafeBytesBufferArray(
override def finalize(): Unit = {
try {
if (longArray != null) {
log.debug(s"BytesArrayInOffheap finalize $arraySize")
log.warn(s"BytesArrayInOffheap finalize $arraySize")
freeArray(longArray)
longArray = null
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ case class UnsafeColumnarBuildSideRelation(
)
val batchesSize = bytesBufferArray.length
for (i <- 0 until batchesSize) {
log.warn(s"this $i--- ${bytesBufferArray(i).length}")
batches.putBytesBuffer(i, bytesBufferArray(i))
}
}
Expand All @@ -94,6 +95,7 @@ case class UnsafeColumnarBuildSideRelation(
out.writeLong(batches.totalBytes)
for (i <- 0 until batches.arraySize) {
val bytes = batches.getBytesBuffer(i)
log.warn(s"writeExternal index $i with length ${bytes.length}")
out.write(bytes)
}
}
Expand All @@ -107,6 +109,7 @@ case class UnsafeColumnarBuildSideRelation(
out.writeLong(batches.totalBytes)
for (i <- 0 until batches.arraySize) {
val bytes = batches.getBytesBuffer(i)
log.warn(s"writeExternal index $i with length ${bytes.length}")
out.write(bytes)
}
}
Expand Down Expand Up @@ -141,6 +144,7 @@ case class UnsafeColumnarBuildSideRelation(
val length = bytesBufferLengths(i)
val tmpBuffer = new Array[Byte](length)
in.read(tmpBuffer)
log.warn(s"readExternal $i--- $length")
batches.putBytesBuffer(i, tmpBuffer)
}
}
Expand All @@ -167,6 +171,7 @@ case class UnsafeColumnarBuildSideRelation(
val length = bytesBufferLengths(i)
val tmpBuffer = new Array[Byte](length)
in.read(tmpBuffer)
log.warn(s"readExternal $i--- $length")
batches.putBytesBuffer(i, tmpBuffer)
}
}
Expand Down

0 comments on commit 3845bf4

Please sign in to comment.