Logging to track allocator initial reservation

Project: http://git-wip-us.apache.org/repos/asf/incubator-drill/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-drill/commit/3c47c07e
Tree: http://git-wip-us.apache.org/repos/asf/incubator-drill/tree/3c47c07e
Diff: http://git-wip-us.apache.org/repos/asf/incubator-drill/diff/3c47c07e

Branch: refs/heads/master
Commit: 3c47c07e318e610cd99b557b16ef6f96810617f1
Parents: 0ad7124
Author: Steven Phillips <[email protected]>
Authored: Sat Jun 7 13:57:50 2014 -0700
Committer: Steven Phillips <[email protected]>
Committed: Sat Jun 7 14:04:46 2014 -0700

----------------------------------------------------------------------
 .../main/java/org/apache/drill/exec/memory/TopLevelAllocator.java  | 2 ++
 .../main/java/org/apache/drill/exec/planner/fragment/Wrapper.java  | 1 +
 2 files changed, 3 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-drill/blob/3c47c07e/exec/java-exec/src/main/java/org/apache/drill/exec/memory/TopLevelAllocator.java
----------------------------------------------------------------------
diff --git 
a/exec/java-exec/src/main/java/org/apache/drill/exec/memory/TopLevelAllocator.java
 
b/exec/java-exec/src/main/java/org/apache/drill/exec/memory/TopLevelAllocator.java
index 6c4d44f..ecbf0b4 100644
--- 
a/exec/java-exec/src/main/java/org/apache/drill/exec/memory/TopLevelAllocator.java
+++ 
b/exec/java-exec/src/main/java/org/apache/drill/exec/memory/TopLevelAllocator.java
@@ -91,6 +91,7 @@ public class TopLevelAllocator implements BufferAllocator {
     if(!acct.reserve(initialReservation)){
       throw new OutOfMemoryException(String.format("You attempted to create a 
new child allocator with initial reservation %d but only %d bytes of memory 
were available.", initialReservation, acct.getCapacity() - 
acct.getAllocation()));
     };
+    logger.debug("New child allocator with initial reservation {}", 
initialReservation);
     ChildAllocator allocator = new ChildAllocator(handle, acct, 
maximumReservation, initialReservation);
     if(ENABLE_ACCOUNTING) children.add(allocator);
     return allocator;
@@ -150,6 +151,7 @@ public class TopLevelAllocator implements BufferAllocator {
       if(!childAcct.reserve(initialReservation)){
         throw new OutOfMemoryException(String.format("You attempted to create 
a new child allocator with initial reservation %d but only %d bytes of memory 
were available.", initialReservation, childAcct.getAvailable()));
       };
+      logger.debug("New child allocator with initial reservation {}", 
initialReservation);
       ChildAllocator newChildAllocator = new ChildAllocator(handle, childAcct, 
maximumReservation, initialReservation);
       this.children.put(newChildAllocator, 
Thread.currentThread().getStackTrace());
       return newChildAllocator;

http://git-wip-us.apache.org/repos/asf/incubator-drill/blob/3c47c07e/exec/java-exec/src/main/java/org/apache/drill/exec/planner/fragment/Wrapper.java
----------------------------------------------------------------------
diff --git 
a/exec/java-exec/src/main/java/org/apache/drill/exec/planner/fragment/Wrapper.java
 
b/exec/java-exec/src/main/java/org/apache/drill/exec/planner/fragment/Wrapper.java
index 38cba09..5e46aaf 100644
--- 
a/exec/java-exec/src/main/java/org/apache/drill/exec/planner/fragment/Wrapper.java
+++ 
b/exec/java-exec/src/main/java/org/apache/drill/exec/planner/fragment/Wrapper.java
@@ -115,6 +115,7 @@ public class Wrapper {
 
   public void addAllocation(PhysicalOperator pop) {
     initialAllocation += pop.getInitialAllocation();
+    logger.debug("Incrementing initialAllocation by {} to {}. Pop: {}", 
pop.getInitialAllocation(), initialAllocation, pop);
     maxAllocation += pop.getMaxAllocation();
   }
 

Reply via email to