davisusanibar commented on code in PR #37723:
URL: https://github.com/apache/arrow/pull/37723#discussion_r1445225775
##########
java/memory/memory-core/src/main/java/org/apache/arrow/memory/BufferLedger.java:
##########
@@ -271,13 +259,19 @@ ArrowBuf newArrowBuf(final long length, final
BufferManager manager) {
final ArrowBuf buf = new ArrowBuf(this, manager, length, startAddress);
// logging
- if (BaseAllocator.DEBUG) {
+ return loggingArrowBufHistoricalLog(buf);
+ }
+
+ private ArrowBuf loggingArrowBufHistoricalLog(ArrowBuf buf) {
+ if (historicalLog != null) {
historicalLog.recordEvent(
"ArrowBuf(BufferLedger, BufferAllocator[%s], " +
"UnsafeDirectLittleEndian[identityHashCode == " + "%d](%s)) =>
ledger hc == %d",
allocator.getName(), System.identityHashCode(buf), buf.toString(),
System.identityHashCode(this));
-
+ if (buffers == null) {
+ throw new IllegalArgumentException(String.valueOf("IdentityHashMap of
buffers must not be null"));
+ }
Review Comment:
Added
##########
java/memory/memory-core/src/main/java/org/apache/arrow/memory/BaseAllocator.java:
##########
@@ -201,7 +209,7 @@ void dissociateLedger(BufferLedger ledger) {
assertOpen();
if (DEBUG) {
synchronized (DEBUG_LOCK) {
- if (!childLedgers.containsKey(ledger)) {
+ if (!(childLedgers != null && childLedgers.containsKey(ledger))) {
Review Comment:
Changed
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]