You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@accumulo.apache.org by ec...@apache.org on 2012/10/11 15:28:28 UTC

svn commit: r1397038 - in /accumulo/branches/1.4/src: core/src/main/java/org/apache/accumulo/core/client/mapreduce/ core/src/main/java/org/apache/accumulo/core/client/mock/ core/src/main/java/org/apache/accumulo/core/iterators/user/ server/src/main/jav...

Author: ecn
Date: Thu Oct 11 13:28:27 2012
New Revision: 1397038

URL: http://svn.apache.org/viewvc?rev=1397038&view=rev
Log:
ACCUMULO-752 use filesystem provided to MockInstance

Modified:
    accumulo/branches/1.4/src/core/src/main/java/org/apache/accumulo/core/client/mapreduce/InputFormatBase.java
    accumulo/branches/1.4/src/core/src/main/java/org/apache/accumulo/core/client/mock/MockTableOperations.java
    accumulo/branches/1.4/src/core/src/main/java/org/apache/accumulo/core/iterators/user/IndexedDocIterator.java
    accumulo/branches/1.4/src/server/src/main/java/org/apache/accumulo/server/tabletserver/TabletServer.java

Modified: accumulo/branches/1.4/src/core/src/main/java/org/apache/accumulo/core/client/mapreduce/InputFormatBase.java
URL: http://svn.apache.org/viewvc/accumulo/branches/1.4/src/core/src/main/java/org/apache/accumulo/core/client/mapreduce/InputFormatBase.java?rev=1397038&r1=1397037&r2=1397038&view=diff
==============================================================================
--- accumulo/branches/1.4/src/core/src/main/java/org/apache/accumulo/core/client/mapreduce/InputFormatBase.java (original)
+++ accumulo/branches/1.4/src/core/src/main/java/org/apache/accumulo/core/client/mapreduce/InputFormatBase.java Thu Oct 11 13:28:27 2012
@@ -16,12 +16,8 @@
  */
 package org.apache.accumulo.core.client.mapreduce;
 
-import java.io.ByteArrayInputStream;
-import java.io.ByteArrayOutputStream;
 import java.io.DataInput;
-import java.io.DataInputStream;
 import java.io.DataOutput;
-import java.io.DataOutputStream;
 import java.io.IOException;
 import java.io.UnsupportedEncodingException;
 import java.lang.reflect.InvocationTargetException;

Modified: accumulo/branches/1.4/src/core/src/main/java/org/apache/accumulo/core/client/mock/MockTableOperations.java
URL: http://svn.apache.org/viewvc/accumulo/branches/1.4/src/core/src/main/java/org/apache/accumulo/core/client/mock/MockTableOperations.java?rev=1397038&r1=1397037&r2=1397038&view=diff
==============================================================================
--- accumulo/branches/1.4/src/core/src/main/java/org/apache/accumulo/core/client/mock/MockTableOperations.java (original)
+++ accumulo/branches/1.4/src/core/src/main/java/org/apache/accumulo/core/client/mock/MockTableOperations.java Thu Oct 11 13:28:27 2012
@@ -49,7 +49,6 @@ import org.apache.accumulo.core.security
 import org.apache.accumulo.core.security.ColumnVisibility;
 import org.apache.accumulo.core.util.BulkImportHelper.AssignmentStats;
 import org.apache.commons.lang.NotImplementedException;
-import org.apache.hadoop.conf.Configuration;
 import org.apache.hadoop.fs.FSDataOutputStream;
 import org.apache.hadoop.fs.FileStatus;
 import org.apache.hadoop.fs.FileSystem;
@@ -200,24 +199,22 @@ public class MockTableOperations extends
     Path importPath = new Path(dir);
     Path failurePath = new Path(failureDir);
 
-    Configuration conf = new Configuration();
-    FileSystem importFs = importPath.getFileSystem(conf);
-    FileSystem failureFs = importPath.getFileSystem(conf);
+    FileSystem fs = acu.getFileSystem();
     /*
      * check preconditions
      */
     // directories are directories
-    if (importFs.isFile(importPath)) {
+    if (fs.isFile(importPath)) {
       throw new IOException("Import path must be a directory.");
     }
-    if (failureFs.isFile(failurePath)) {
+    if (fs.isFile(failurePath)) {
       throw new IOException("Failure path must be a directory.");
     }
     // failures are writable
     Path createPath = failurePath.suffix("/.createFile");
     FSDataOutputStream createStream = null;
     try {
-      createStream = failureFs.create(createPath);
+      createStream = fs.create(createPath);
     } catch (IOException e) {
       throw new IOException("Error path is not writable.");
     } finally {
@@ -225,20 +222,20 @@ public class MockTableOperations extends
         createStream.close();
       }
     }
-    failureFs.delete(createPath, false);
+    fs.delete(createPath, false);
     // failures are empty
-    FileStatus[] failureChildStats = failureFs.listStatus(failurePath);
+    FileStatus[] failureChildStats = fs.listStatus(failurePath);
     if (failureChildStats.length > 0) {
       throw new IOException("Error path must be empty.");
     }
     /*
      * Begin the import - iterate the files in the path
      */
-    for (FileStatus importStatus : importFs.listStatus(importPath)) {
+    for (FileStatus importStatus : fs.listStatus(importPath)) {
       try {
         FileSKVIterator importIterator = FileOperations.getInstance()
-            .openReader(importStatus.getPath().toString(), true, importFs,
-                conf, AccumuloConfiguration.getDefaultConfiguration());
+            .openReader(importStatus.getPath().toString(), true, fs,
+                fs.getConf(), AccumuloConfiguration.getDefaultConfiguration());
         while (importIterator.hasTop()) {
           Key key = importIterator.getTopKey();
           Value value = importIterator.getTopValue();
@@ -262,9 +259,9 @@ public class MockTableOperations extends
         FSDataOutputStream failureWriter = null;
         DataInputStream failureReader = null;
         try {
-          failureWriter = failureFs.create(failurePath.suffix("/"
+          failureWriter = fs.create(failurePath.suffix("/"
               + importStatus.getPath().getName()));
-          failureReader = importFs.open(importStatus.getPath());
+          failureReader = fs.open(importStatus.getPath());
           int read = 0;
           byte[] buffer = new byte[1024];
           while (-1 != (read = failureReader.read(buffer))) {
@@ -277,7 +274,7 @@ public class MockTableOperations extends
             failureWriter.close();
         }
       }
-      importFs.delete(importStatus.getPath(), true);
+      fs.delete(importStatus.getPath(), true);
     }
   }
   

Modified: accumulo/branches/1.4/src/core/src/main/java/org/apache/accumulo/core/iterators/user/IndexedDocIterator.java
URL: http://svn.apache.org/viewvc/accumulo/branches/1.4/src/core/src/main/java/org/apache/accumulo/core/iterators/user/IndexedDocIterator.java?rev=1397038&r1=1397037&r2=1397038&view=diff
==============================================================================
--- accumulo/branches/1.4/src/core/src/main/java/org/apache/accumulo/core/iterators/user/IndexedDocIterator.java (original)
+++ accumulo/branches/1.4/src/core/src/main/java/org/apache/accumulo/core/iterators/user/IndexedDocIterator.java Thu Oct 11 13:28:27 2012
@@ -31,7 +31,6 @@ import org.apache.accumulo.core.data.Ran
 import org.apache.accumulo.core.data.Value;
 import org.apache.accumulo.core.iterators.IteratorEnvironment;
 import org.apache.accumulo.core.iterators.SortedKeyValueIterator;
-import org.apache.accumulo.core.iterators.user.IntersectingIterator.TermSource;
 import org.apache.hadoop.io.Text;
 
 /**

Modified: accumulo/branches/1.4/src/server/src/main/java/org/apache/accumulo/server/tabletserver/TabletServer.java
URL: http://svn.apache.org/viewvc/accumulo/branches/1.4/src/server/src/main/java/org/apache/accumulo/server/tabletserver/TabletServer.java?rev=1397038&r1=1397037&r2=1397038&view=diff
==============================================================================
--- accumulo/branches/1.4/src/server/src/main/java/org/apache/accumulo/server/tabletserver/TabletServer.java (original)
+++ accumulo/branches/1.4/src/server/src/main/java/org/apache/accumulo/server/tabletserver/TabletServer.java Thu Oct 11 13:28:27 2012
@@ -205,7 +205,6 @@ import org.apache.thrift.TServiceClient;
 import org.apache.thrift.server.TServer;
 import org.apache.zookeeper.KeeperException;
 import org.apache.zookeeper.KeeperException.NoNodeException;
-import org.mortbay.log.Log;
 
 enum ScanRunState {
   QUEUED, RUNNING, FINISHED