tephra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From la...@apache.org
Subject [incubator-tephra] branch master updated: TEPHRA-300 Tephra coprocessors do not close passed scanner.
Date Sun, 09 Jun 2019 23:25:41 GMT
This is an automated email from the ASF dual-hosted git repository.

larsh pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-tephra.git


The following commit(s) were added to refs/heads/master by this push:
     new daa1826  TEPHRA-300 Tephra coprocessors do not close passed scanner.
daa1826 is described below

commit daa1826306dea53180006e8549a6d6e54b4944fd
Author: Lars Hofhansl <larsh@apache.org>
AuthorDate: Sun Jun 9 16:25:05 2019 -0700

    TEPHRA-300 Tephra coprocessors do not close passed scanner.
---
 .../org/apache/tephra/hbase/coprocessor/TransactionProcessor.java     | 4 ++++
 .../org/apache/tephra/hbase/coprocessor/TransactionProcessor.java     | 4 ++++
 .../org/apache/tephra/hbase/coprocessor/TransactionProcessor.java     | 4 ++++
 .../org/apache/tephra/hbase/coprocessor/TransactionProcessor.java     | 4 ++++
 .../org/apache/tephra/hbase/coprocessor/TransactionProcessor.java     | 4 ++++
 .../org/apache/tephra/hbase/coprocessor/TransactionProcessor.java     | 4 ++++
 .../org/apache/tephra/hbase/coprocessor/TransactionProcessor.java     | 4 ++++
 7 files changed, 28 insertions(+)

diff --git a/tephra-hbase-compat-0.96/src/main/java/org/apache/tephra/hbase/coprocessor/TransactionProcessor.java
b/tephra-hbase-compat-0.96/src/main/java/org/apache/tephra/hbase/coprocessor/TransactionProcessor.java
index 10ecfa4..19b2d4e 100644
--- a/tephra-hbase-compat-0.96/src/main/java/org/apache/tephra/hbase/coprocessor/TransactionProcessor.java
+++ b/tephra-hbase-compat-0.96/src/main/java/org/apache/tephra/hbase/coprocessor/TransactionProcessor.java
@@ -322,6 +322,8 @@ public class TransactionProcessor extends BaseRegionObserver {
   public InternalScanner preFlushScannerOpen(ObserverContext<RegionCoprocessorEnvironment>
c, Store store,
                                              KeyValueScanner memstoreScanner, InternalScanner
scanner)
       throws IOException {
+    // silently close the passed scanner as we're returning a brand-new one
+    try (InternalScanner temp = scanner) { }
     return createStoreScanner(c.getEnvironment(), "flush", cache.getLatestState(), store,
                               Collections.singletonList(memstoreScanner), ScanType.COMPACT_RETAIN_DELETES,
                               HConstants.OLDEST_TIMESTAMP);
@@ -357,6 +359,8 @@ public class TransactionProcessor extends BaseRegionObserver {
       compactionState.record(request, snapshot);
     }
 
+    // silently close the passed scanner as we're returning a brand-new one
+    try (InternalScanner temp = s) { }
     // Also make sure to use the same snapshot for the compaction
     return createStoreScanner(c.getEnvironment(), "compaction", snapshot, store, scanners,
scanType, earliestPutTs);
   }
diff --git a/tephra-hbase-compat-0.98/src/main/java/org/apache/tephra/hbase/coprocessor/TransactionProcessor.java
b/tephra-hbase-compat-0.98/src/main/java/org/apache/tephra/hbase/coprocessor/TransactionProcessor.java
index 17d55a4..aa24f57 100644
--- a/tephra-hbase-compat-0.98/src/main/java/org/apache/tephra/hbase/coprocessor/TransactionProcessor.java
+++ b/tephra-hbase-compat-0.98/src/main/java/org/apache/tephra/hbase/coprocessor/TransactionProcessor.java
@@ -322,6 +322,8 @@ public class TransactionProcessor extends BaseRegionObserver {
   public InternalScanner preFlushScannerOpen(ObserverContext<RegionCoprocessorEnvironment>
c, Store store,
                                              KeyValueScanner memstoreScanner, InternalScanner
scanner)
       throws IOException {
+    // silently close the passed scanner as we're returning a brand-new one
+    try (InternalScanner temp = scanner) { }
     return createStoreScanner(c.getEnvironment(), "flush", cache.getLatestState(), store,
                               Collections.singletonList(memstoreScanner), ScanType.COMPACT_RETAIN_DELETES,
                               HConstants.OLDEST_TIMESTAMP);
@@ -357,6 +359,8 @@ public class TransactionProcessor extends BaseRegionObserver {
       compactionState.record(request, snapshot);
     }
 
+    // silently close the passed scanner as we're returning a brand-new one
+    try (InternalScanner temp = s) { }
     // Also make sure to use the same snapshot for the compaction
     return createStoreScanner(c.getEnvironment(), "compaction", snapshot, store, scanners,
scanType, earliestPutTs);
   }
diff --git a/tephra-hbase-compat-1.0-cdh/src/main/java/org/apache/tephra/hbase/coprocessor/TransactionProcessor.java
b/tephra-hbase-compat-1.0-cdh/src/main/java/org/apache/tephra/hbase/coprocessor/TransactionProcessor.java
index ca96052..769436d 100644
--- a/tephra-hbase-compat-1.0-cdh/src/main/java/org/apache/tephra/hbase/coprocessor/TransactionProcessor.java
+++ b/tephra-hbase-compat-1.0-cdh/src/main/java/org/apache/tephra/hbase/coprocessor/TransactionProcessor.java
@@ -322,6 +322,8 @@ public class TransactionProcessor extends BaseRegionObserver {
   public InternalScanner preFlushScannerOpen(ObserverContext<RegionCoprocessorEnvironment>
c, Store store,
                                              KeyValueScanner memstoreScanner, InternalScanner
scanner)
       throws IOException {
+    // silently close the passed scanner as we're returning a brand-new one
+    try (InternalScanner temp = scanner) { }
     return createStoreScanner(c.getEnvironment(), "flush", cache.getLatestState(), store,
                               Collections.singletonList(memstoreScanner), ScanType.COMPACT_RETAIN_DELETES,
                               HConstants.OLDEST_TIMESTAMP);
@@ -357,6 +359,8 @@ public class TransactionProcessor extends BaseRegionObserver {
       compactionState.record(request, snapshot);
     }
 
+    // silently close the passed scanner as we're returning a brand-new one
+    try (InternalScanner temp = s) { }
     // Also make sure to use the same snapshot for the compaction
     return createStoreScanner(c.getEnvironment(), "compaction", snapshot, store, scanners,
scanType, earliestPutTs);
   }
diff --git a/tephra-hbase-compat-1.0/src/main/java/org/apache/tephra/hbase/coprocessor/TransactionProcessor.java
b/tephra-hbase-compat-1.0/src/main/java/org/apache/tephra/hbase/coprocessor/TransactionProcessor.java
index 263ee98..3139ac5 100644
--- a/tephra-hbase-compat-1.0/src/main/java/org/apache/tephra/hbase/coprocessor/TransactionProcessor.java
+++ b/tephra-hbase-compat-1.0/src/main/java/org/apache/tephra/hbase/coprocessor/TransactionProcessor.java
@@ -322,6 +322,8 @@ public class TransactionProcessor extends BaseRegionObserver {
   public InternalScanner preFlushScannerOpen(ObserverContext<RegionCoprocessorEnvironment>
c, Store store,
                                              KeyValueScanner memstoreScanner, InternalScanner
scanner)
       throws IOException {
+    // silently close the passed scanner as we're returning a brand-new one
+    try (InternalScanner temp = scanner) { }
     return createStoreScanner(c.getEnvironment(), "flush", cache.getLatestState(), store,
                               Collections.singletonList(memstoreScanner), ScanType.COMPACT_RETAIN_DELETES,
                               HConstants.OLDEST_TIMESTAMP);
@@ -357,6 +359,8 @@ public class TransactionProcessor extends BaseRegionObserver {
       compactionState.record(request, snapshot);
     }
 
+    // silently close the passed scanner as we're returning a brand-new one
+    try (InternalScanner temp = s) { }
     // Also make sure to use the same snapshot for the compaction
     return createStoreScanner(c.getEnvironment(), "compaction", snapshot, store, scanners,
scanType, earliestPutTs);
   }
diff --git a/tephra-hbase-compat-1.1-base/src/main/java/org/apache/tephra/hbase/coprocessor/TransactionProcessor.java
b/tephra-hbase-compat-1.1-base/src/main/java/org/apache/tephra/hbase/coprocessor/TransactionProcessor.java
index 553f598..fbdc74f 100644
--- a/tephra-hbase-compat-1.1-base/src/main/java/org/apache/tephra/hbase/coprocessor/TransactionProcessor.java
+++ b/tephra-hbase-compat-1.1-base/src/main/java/org/apache/tephra/hbase/coprocessor/TransactionProcessor.java
@@ -322,6 +322,8 @@ public class TransactionProcessor extends BaseRegionObserver {
   public InternalScanner preFlushScannerOpen(ObserverContext<RegionCoprocessorEnvironment>
c, Store store,
                                              KeyValueScanner memstoreScanner, InternalScanner
scanner)
       throws IOException {
+    // silently close the passed scanner as we're returning a brand-new one
+    try (InternalScanner temp = scanner) { }
     return createStoreScanner(c.getEnvironment(), "flush", cache.getLatestState(), store,
                               Collections.singletonList(memstoreScanner), ScanType.COMPACT_RETAIN_DELETES,
                               HConstants.OLDEST_TIMESTAMP);
@@ -357,6 +359,8 @@ public class TransactionProcessor extends BaseRegionObserver {
       compactionState.record(request, snapshot);
     }
 
+    // silently close the passed scanner as we're returning a brand-new one
+    try (InternalScanner temp = s) { }
     // Also make sure to use the same snapshot for the compaction
     return createStoreScanner(c.getEnvironment(), "compaction", snapshot, store, scanners,
scanType, earliestPutTs);
   }
diff --git a/tephra-hbase-compat-1.3/src/main/java/org/apache/tephra/hbase/coprocessor/TransactionProcessor.java
b/tephra-hbase-compat-1.3/src/main/java/org/apache/tephra/hbase/coprocessor/TransactionProcessor.java
index 553f598..fbdc74f 100644
--- a/tephra-hbase-compat-1.3/src/main/java/org/apache/tephra/hbase/coprocessor/TransactionProcessor.java
+++ b/tephra-hbase-compat-1.3/src/main/java/org/apache/tephra/hbase/coprocessor/TransactionProcessor.java
@@ -322,6 +322,8 @@ public class TransactionProcessor extends BaseRegionObserver {
   public InternalScanner preFlushScannerOpen(ObserverContext<RegionCoprocessorEnvironment>
c, Store store,
                                              KeyValueScanner memstoreScanner, InternalScanner
scanner)
       throws IOException {
+    // silently close the passed scanner as we're returning a brand-new one
+    try (InternalScanner temp = scanner) { }
     return createStoreScanner(c.getEnvironment(), "flush", cache.getLatestState(), store,
                               Collections.singletonList(memstoreScanner), ScanType.COMPACT_RETAIN_DELETES,
                               HConstants.OLDEST_TIMESTAMP);
@@ -357,6 +359,8 @@ public class TransactionProcessor extends BaseRegionObserver {
       compactionState.record(request, snapshot);
     }
 
+    // silently close the passed scanner as we're returning a brand-new one
+    try (InternalScanner temp = s) { }
     // Also make sure to use the same snapshot for the compaction
     return createStoreScanner(c.getEnvironment(), "compaction", snapshot, store, scanners,
scanType, earliestPutTs);
   }
diff --git a/tephra-hbase-compat-1.4/src/main/java/org/apache/tephra/hbase/coprocessor/TransactionProcessor.java
b/tephra-hbase-compat-1.4/src/main/java/org/apache/tephra/hbase/coprocessor/TransactionProcessor.java
index 553f598..fbdc74f 100644
--- a/tephra-hbase-compat-1.4/src/main/java/org/apache/tephra/hbase/coprocessor/TransactionProcessor.java
+++ b/tephra-hbase-compat-1.4/src/main/java/org/apache/tephra/hbase/coprocessor/TransactionProcessor.java
@@ -322,6 +322,8 @@ public class TransactionProcessor extends BaseRegionObserver {
   public InternalScanner preFlushScannerOpen(ObserverContext<RegionCoprocessorEnvironment>
c, Store store,
                                              KeyValueScanner memstoreScanner, InternalScanner
scanner)
       throws IOException {
+    // silently close the passed scanner as we're returning a brand-new one
+    try (InternalScanner temp = scanner) { }
     return createStoreScanner(c.getEnvironment(), "flush", cache.getLatestState(), store,
                               Collections.singletonList(memstoreScanner), ScanType.COMPACT_RETAIN_DELETES,
                               HConstants.OLDEST_TIMESTAMP);
@@ -357,6 +359,8 @@ public class TransactionProcessor extends BaseRegionObserver {
       compactionState.record(request, snapshot);
     }
 
+    // silently close the passed scanner as we're returning a brand-new one
+    try (InternalScanner temp = s) { }
     // Also make sure to use the same snapshot for the compaction
     return createStoreScanner(c.getEnvironment(), "compaction", snapshot, store, scanners,
scanType, earliestPutTs);
   }


Mime
View raw message