You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@accumulo.apache.org by ct...@apache.org on 2014/08/23 02:37:53 UTC

[2/9] git commit: ACCUMULO-2037 Close scanner

ACCUMULO-2037 Close scanner


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

Branch: refs/heads/master
Commit: ac2e60164626e51e5932d0c30c6b4b68ea1414c1
Parents: 705a60d
Author: Christopher Tubbs <ct...@apache.org>
Authored: Fri Aug 22 19:54:50 2014 -0400
Committer: Christopher Tubbs <ct...@apache.org>
Committed: Fri Aug 22 19:54:50 2014 -0400

----------------------------------------------------------------------
 .../accumulo/test/functional/MasterAssignmentIT.java  | 14 ++++++++------
 1 file changed, 8 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/accumulo/blob/ac2e6016/test/src/test/java/org/apache/accumulo/test/functional/MasterAssignmentIT.java
----------------------------------------------------------------------
diff --git a/test/src/test/java/org/apache/accumulo/test/functional/MasterAssignmentIT.java b/test/src/test/java/org/apache/accumulo/test/functional/MasterAssignmentIT.java
index 298466d..46f6b23 100644
--- a/test/src/test/java/org/apache/accumulo/test/functional/MasterAssignmentIT.java
+++ b/test/src/test/java/org/apache/accumulo/test/functional/MasterAssignmentIT.java
@@ -35,7 +35,7 @@ import org.apache.hadoop.io.Text;
 import org.junit.Test;
 
 public class MasterAssignmentIT extends SimpleMacIT {
-  
+
   @Override
   protected int defaultTimeoutSeconds() {
     return 2 * 60;
@@ -55,7 +55,7 @@ public class MasterAssignmentIT extends SimpleMacIT {
     } while (newTablet.current == null);
     assertNull(newTablet.last);
     assertNull(newTablet.future);
-    
+
     // put something in it
     BatchWriter bw = c.createBatchWriter(tableName, new BatchWriterConfig());
     Mutation m = new Mutation("a");
@@ -64,19 +64,19 @@ public class MasterAssignmentIT extends SimpleMacIT {
     bw.close();
     // give it a last location
     c.tableOperations().flush(tableName, null, null, true);
-    
+
     TabletLocationState flushed = getTabletLocationState(c, tableId);
     assertEquals(newTablet.current, flushed.current);
     assertEquals(flushed.current, flushed.last);
     assertNull(newTablet.future);
-    
+
     // take the tablet offline
     c.tableOperations().offline(tableName, true);
     TabletLocationState offline = getTabletLocationState(c, tableId);
     assertNull(offline.future);
     assertNull(offline.current);
     assertEquals(flushed.current, offline.last);
-    
+
     // put it back online
     c.tableOperations().online(tableName, true);
     TabletLocationState online = getTabletLocationState(c, tableId);
@@ -88,6 +88,8 @@ public class MasterAssignmentIT extends SimpleMacIT {
   private TabletLocationState getTabletLocationState(Connector c, String tableId) {
     Credentials creds = new Credentials("root", new PasswordToken(ROOT_PASSWORD));
     MetaDataTableScanner s = new MetaDataTableScanner(c.getInstance(), creds, new Range(KeyExtent.getMetadataEntry(new Text(tableId), null)));
-    return s.next();
+    TabletLocationState tlState = s.next();
+    s.close();
+    return tlState;
   }
 }