phoenix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From maryann...@apache.org
Subject phoenix git commit: Fix memory issue caused by PHOENIX-3394
Date Thu, 10 Nov 2016 22:48:26 GMT
Repository: phoenix
Updated Branches:
  refs/heads/calcite d65122b88 -> 26bd75582


Fix memory issue caused by PHOENIX-3394


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

Branch: refs/heads/calcite
Commit: 26bd755823eac60944f438522d51cf688f8b5f80
Parents: d65122b
Author: maryannxue <maryann.xue@gmail.com>
Authored: Thu Nov 10 14:38:23 2016 -0800
Committer: maryannxue <maryann.xue@gmail.com>
Committed: Thu Nov 10 14:48:14 2016 -0800

----------------------------------------------------------------------
 .../main/java/org/apache/phoenix/calcite/PhoenixSchema.java  | 2 ++
 .../java/org/apache/phoenix/compile/SequenceManager.java     | 8 ++++++++
 2 files changed, 10 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/phoenix/blob/26bd7558/phoenix-core/src/main/java/org/apache/phoenix/calcite/PhoenixSchema.java
----------------------------------------------------------------------
diff --git a/phoenix-core/src/main/java/org/apache/phoenix/calcite/PhoenixSchema.java b/phoenix-core/src/main/java/org/apache/phoenix/calcite/PhoenixSchema.java
index 47b63fc..8f27567 100644
--- a/phoenix-core/src/main/java/org/apache/phoenix/calcite/PhoenixSchema.java
+++ b/phoenix-core/src/main/java/org/apache/phoenix/calcite/PhoenixSchema.java
@@ -344,6 +344,8 @@ public class PhoenixSchema implements Schema {
             sequenceManager.validateSequences(Sequence.ValueOp.VALIDATE_SEQUENCE);
         } catch (SQLException e){
             return null;
+        } finally {
+            sequenceManager.reset();
         }
 
         return new PhoenixSequence(schemaName, name, pc);

http://git-wip-us.apache.org/repos/asf/phoenix/blob/26bd7558/phoenix-core/src/main/java/org/apache/phoenix/compile/SequenceManager.java
----------------------------------------------------------------------
diff --git a/phoenix-core/src/main/java/org/apache/phoenix/compile/SequenceManager.java b/phoenix-core/src/main/java/org/apache/phoenix/compile/SequenceManager.java
index bdc4da9..a349fa4 100644
--- a/phoenix-core/src/main/java/org/apache/phoenix/compile/SequenceManager.java
+++ b/phoenix-core/src/main/java/org/apache/phoenix/compile/SequenceManager.java
@@ -61,6 +61,14 @@ public class SequenceManager {
         return sequenceMap == null ? 0 : sequenceMap.size();
     }
     
+    public void reset() {
+        sequenceMap.clear();
+        isNextSequence.clear();
+        sequencePosition = null;
+        nextSequences = null;
+        currentSequences = null;
+    }
+    
     private void setSequenceValues(long[] srcSequenceValues, long[] dstSequenceValues, SQLException[]
sqlExceptions) throws SQLException {
         SQLException eTop = null;
         for (int i = 0; i < sqlExceptions.length; i++) {


Mime
View raw message