phoenix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sama...@apache.org
Subject [13/50] [abbrv] phoenix git commit: PHOENIX-2527 InsufficientMemoryException error message is misleading
Date Wed, 06 Jan 2016 23:17:26 GMT
PHOENIX-2527 InsufficientMemoryException error message is misleading


Project: http://git-wip-us.apache.org/repos/asf/phoenix/repo
Commit: http://git-wip-us.apache.org/repos/asf/phoenix/commit/feec7c4f
Tree: http://git-wip-us.apache.org/repos/asf/phoenix/tree/feec7c4f
Diff: http://git-wip-us.apache.org/repos/asf/phoenix/diff/feec7c4f

Branch: refs/heads/4.x-HBase-1.0
Commit: feec7c4ffbdef515b6f553530e9d0c591156de6a
Parents: a2b40de
Author: Enis Soztutar <enis@apache.org>
Authored: Wed Dec 16 14:15:03 2015 -0800
Committer: Enis Soztutar <enis@apache.org>
Committed: Wed Dec 16 14:15:06 2015 -0800

----------------------------------------------------------------------
 .../phoenix/memory/GlobalMemoryManager.java     | 20 ++++++++++----------
 1 file changed, 10 insertions(+), 10 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/phoenix/blob/feec7c4f/phoenix-core/src/main/java/org/apache/phoenix/memory/GlobalMemoryManager.java
----------------------------------------------------------------------
diff --git a/phoenix-core/src/main/java/org/apache/phoenix/memory/GlobalMemoryManager.java
b/phoenix-core/src/main/java/org/apache/phoenix/memory/GlobalMemoryManager.java
index 79b49c5..6460260 100644
--- a/phoenix-core/src/main/java/org/apache/phoenix/memory/GlobalMemoryManager.java
+++ b/phoenix-core/src/main/java/org/apache/phoenix/memory/GlobalMemoryManager.java
@@ -21,15 +21,15 @@ import org.apache.http.annotation.GuardedBy;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 /**
- * 
+ *
  * Global memory manager to track course grained memory usage across all requests.
  *
- * 
+ *
  * @since 0.1
  */
 public class GlobalMemoryManager implements MemoryManager {
     private static final Logger logger = LoggerFactory.getLogger(GlobalMemoryManager.class);
-    
+
     private final Object sync = new Object();
     private final long maxMemoryBytes;
     private final int maxWaitMs;
@@ -46,7 +46,7 @@ public class GlobalMemoryManager implements MemoryManager {
         this.maxWaitMs = maxWaitMs;
         this.usedMemoryBytes = 0;
     }
-    
+
     @Override
     public long getAvailableMemory() {
         synchronized(sync) {
@@ -75,7 +75,7 @@ public class GlobalMemoryManager implements MemoryManager {
                 try {
                     long remainingWaitTimeMs = maxWaitMs - (System.currentTimeMillis() -
startTimeMs);
                     if (remainingWaitTimeMs <= 0) { // Ran out of time waiting for some
memory to get freed up
-                        throw new InsufficientMemoryException("Requested memory of " + minBytes
+ " bytes could not be allocated from remaining memory of " + usedMemoryBytes + " bytes from
global pool of " + maxMemoryBytes + " bytes after waiting for " + maxWaitMs + "ms.");
+                        throw new InsufficientMemoryException("Requested memory of " + minBytes
+ " bytes could not be allocated. Using memory of " + usedMemoryBytes + " bytes from global
pool of " + maxMemoryBytes + " bytes after waiting for " + maxWaitMs + "ms.");
                     }
                     sync.wait(remainingWaitTimeMs);
                 } catch (InterruptedException ie) {
@@ -106,7 +106,7 @@ public class GlobalMemoryManager implements MemoryManager {
     protected MemoryChunk newMemoryChunk(long sizeBytes) {
         return new GlobalMemoryChunk(sizeBytes);
     }
-    
+
     private class GlobalMemoryChunk implements MemoryChunk {
         private volatile long size;
 
@@ -123,7 +123,7 @@ public class GlobalMemoryManager implements MemoryManager {
                 return size; // TODO: does this need to be synchronized?
             }
         }
-        
+
         @Override
         public void resize(long nBytes) {
             if (nBytes < 0) {
@@ -141,7 +141,7 @@ public class GlobalMemoryManager implements MemoryManager {
                 }
             }
         }
-        
+
         /**
          * Check that MemoryChunk has previously been closed.
          */
@@ -159,7 +159,7 @@ public class GlobalMemoryManager implements MemoryManager {
                 super.finalize();
             }
         }
-        
+
         @Override
         public void close() {
             synchronized(sync) {
@@ -170,4 +170,4 @@ public class GlobalMemoryManager implements MemoryManager {
         }
     }
 }
- 
+


Mime
View raw message