Return-Path: X-Original-To: apmail-accumulo-commits-archive@www.apache.org Delivered-To: apmail-accumulo-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 91A839138 for ; Thu, 11 Oct 2012 13:29:13 +0000 (UTC) Received: (qmail 11126 invoked by uid 500); 11 Oct 2012 13:29:13 -0000 Delivered-To: apmail-accumulo-commits-archive@accumulo.apache.org Received: (qmail 11075 invoked by uid 500); 11 Oct 2012 13:29:13 -0000 Mailing-List: contact commits-help@accumulo.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@accumulo.apache.org Delivered-To: mailing list commits@accumulo.apache.org Received: (qmail 11064 invoked by uid 99); 11 Oct 2012 13:29:13 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 11 Oct 2012 13:29:13 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 11 Oct 2012 13:29:11 +0000 Received: from eris.apache.org (localhost [127.0.0.1]) by eris.apache.org (Postfix) with ESMTP id 430EA23889F7 for ; Thu, 11 Oct 2012 13:28:28 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: 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... Date: Thu, 11 Oct 2012 13:28:28 -0000 To: commits@accumulo.apache.org From: ecn@apache.org X-Mailer: svnmailer-1.0.8-patched Message-Id: <20121011132828.430EA23889F7@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org 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