Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 1A2E0200BD3 for ; Tue, 6 Dec 2016 19:40:15 +0100 (CET) Received: by cust-asf.ponee.io (Postfix) id 16EE5160B34; Tue, 6 Dec 2016 18:40:15 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 46243160B17 for ; Tue, 6 Dec 2016 19:40:14 +0100 (CET) Received: (qmail 41769 invoked by uid 500); 6 Dec 2016 18:40: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 41755 invoked by uid 99); 6 Dec 2016 18:40:13 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 06 Dec 2016 18:40:13 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 62AE1E0159; Tue, 6 Dec 2016 18:40:13 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: mmiller@apache.org To: commits@accumulo.apache.org Date: Tue, 06 Dec 2016 18:40:13 -0000 Message-Id: <387a1a29c2a54bfd869558e6668a8cf6@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: [01/11] accumulo git commit: ACCUMULO-4522: cleanup of unsed param in FileUtil archived-at: Tue, 06 Dec 2016 18:40:15 -0000 Repository: accumulo Updated Branches: refs/heads/master d4d7d0920 -> bebfbd0ed ACCUMULO-4522: cleanup of unsed param in FileUtil Project: http://git-wip-us.apache.org/repos/asf/accumulo/repo Commit: http://git-wip-us.apache.org/repos/asf/accumulo/commit/8a35b6dd Tree: http://git-wip-us.apache.org/repos/asf/accumulo/tree/8a35b6dd Diff: http://git-wip-us.apache.org/repos/asf/accumulo/diff/8a35b6dd Branch: refs/heads/master Commit: 8a35b6dd48668449919a172afb96a9851ce211a0 Parents: a361f63 Author: Mike Miller Authored: Thu Nov 17 13:55:03 2016 -0500 Committer: Mike Miller Committed: Thu Nov 17 13:55:03 2016 -0500 ---------------------------------------------------------------------- .../apache/accumulo/server/util/FileUtil.java | 6 +-- .../accumulo/server/util/FileUtilTest.java | 51 ++++---------------- 2 files changed, 12 insertions(+), 45 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/accumulo/blob/8a35b6dd/server/base/src/main/java/org/apache/accumulo/server/util/FileUtil.java ---------------------------------------------------------------------- diff --git a/server/base/src/main/java/org/apache/accumulo/server/util/FileUtil.java b/server/base/src/main/java/org/apache/accumulo/server/util/FileUtil.java index 51a0783..ea34dd8 100644 --- a/server/base/src/main/java/org/apache/accumulo/server/util/FileUtil.java +++ b/server/base/src/main/java/org/apache/accumulo/server/util/FileUtil.java @@ -254,7 +254,7 @@ public class FileUtil { return (numLte + 1) / (double) (numKeys + 2); } finally { - cleanupIndexOp(acuconf, tmpDir, fs, readers); + cleanupIndexOp(tmpDir, fs, readers); } } @@ -362,11 +362,11 @@ public class FileUtil { return ret; } finally { - cleanupIndexOp(acuConf, tmpDir, fs, readers); + cleanupIndexOp(tmpDir, fs, readers); } } - protected static void cleanupIndexOp(AccumuloConfiguration acuConf, Path tmpDir, VolumeManager fs, ArrayList readers) throws IOException { + protected static void cleanupIndexOp(Path tmpDir, VolumeManager fs, ArrayList readers) throws IOException { // close all of the index sequence files for (FileSKVIterator r : readers) { try { http://git-wip-us.apache.org/repos/asf/accumulo/blob/8a35b6dd/server/base/src/test/java/org/apache/accumulo/server/util/FileUtilTest.java ---------------------------------------------------------------------- diff --git a/server/base/src/test/java/org/apache/accumulo/server/util/FileUtilTest.java b/server/base/src/test/java/org/apache/accumulo/server/util/FileUtilTest.java index a826acf..9cb882c 100644 --- a/server/base/src/test/java/org/apache/accumulo/server/util/FileUtilTest.java +++ b/server/base/src/test/java/org/apache/accumulo/server/util/FileUtilTest.java @@ -27,10 +27,7 @@ import java.util.ArrayList; import java.util.Collection; import java.util.HashMap; import java.util.Iterator; -import java.util.Map; -import org.apache.accumulo.core.conf.AccumuloConfiguration; -import org.apache.accumulo.core.conf.DefaultConfiguration; import org.apache.accumulo.core.conf.Property; import org.apache.accumulo.core.file.FileSKVIterator; import org.apache.accumulo.server.fs.FileRef; @@ -44,8 +41,6 @@ import org.junit.Test; import org.junit.rules.TemporaryFolder; import org.junit.rules.TestName; -import com.google.common.base.Predicate; - /** * */ @@ -94,10 +89,9 @@ public class FileUtilTest { HashMap testProps = new HashMap<>(); testProps.put(Property.INSTANCE_DFS_DIR, accumuloDir.getAbsolutePath()); - AccumuloConfiguration testConf = new FileUtilTestConfiguration(testProps); VolumeManager fs = VolumeManagerImpl.getLocal(accumuloDir.getAbsolutePath()); - FileUtil.cleanupIndexOp(testConf, tmpPath1, fs, new ArrayList()); + FileUtil.cleanupIndexOp(tmpPath1, fs, new ArrayList()); Assert.assertFalse("Expected " + tmp1 + " to be cleaned up but it wasn't", tmp1.exists()); } @@ -121,14 +115,13 @@ public class FileUtilTest { HashMap testProps = new HashMap<>(); testProps.put(Property.INSTANCE_VOLUMES, v1.toURI().toString() + "," + v2.toURI().toString()); - AccumuloConfiguration testConf = new FileUtilTestConfiguration(testProps); VolumeManager fs = VolumeManagerImpl.getLocal(accumuloDir.getAbsolutePath()); - FileUtil.cleanupIndexOp(testConf, tmpPath1, fs, new ArrayList()); + FileUtil.cleanupIndexOp(tmpPath1, fs, new ArrayList()); Assert.assertFalse("Expected " + tmp1 + " to be cleaned up but it wasn't", tmp1.exists()); - FileUtil.cleanupIndexOp(testConf, tmpPath2, fs, new ArrayList()); + FileUtil.cleanupIndexOp(tmpPath2, fs, new ArrayList()); Assert.assertFalse("Expected " + tmp2 + " to be cleaned up but it wasn't", tmp2.exists()); } @@ -153,14 +146,13 @@ public class FileUtilTest { HashMap testProps = new HashMap<>(); testProps.put(Property.INSTANCE_VOLUMES, v1.toURI().toString() + "," + v2.toURI().toString()); - AccumuloConfiguration testConf = new FileUtilTestConfiguration(testProps); VolumeManager fs = VolumeManagerImpl.getLocal(accumuloDir.getAbsolutePath()); - FileUtil.cleanupIndexOp(testConf, tmpPath1, fs, new ArrayList()); + FileUtil.cleanupIndexOp(tmpPath1, fs, new ArrayList()); Assert.assertFalse("Expected " + tmp1 + " to be cleaned up but it wasn't", tmp1.exists()); - FileUtil.cleanupIndexOp(testConf, tmpPath2, fs, new ArrayList()); + FileUtil.cleanupIndexOp(tmpPath2, fs, new ArrayList()); Assert.assertFalse("Expected " + tmp2 + " to be cleaned up but it wasn't", tmp2.exists()); } @@ -181,14 +173,13 @@ public class FileUtilTest { HashMap testProps = new HashMap<>(); testProps.put(Property.INSTANCE_VOLUMES, v1.toURI().toString() + "," + v2.toURI().toString()); - AccumuloConfiguration testConf = new FileUtilTestConfiguration(testProps); VolumeManager fs = VolumeManagerImpl.getLocal(accumuloDir.getAbsolutePath()); - FileUtil.cleanupIndexOp(testConf, tmpPath1, fs, new ArrayList()); + FileUtil.cleanupIndexOp(tmpPath1, fs, new ArrayList()); Assert.assertFalse("Expected " + tmp1 + " to be cleaned up but it wasn't", tmp1.exists()); - FileUtil.cleanupIndexOp(testConf, tmpPath2, fs, new ArrayList()); + FileUtil.cleanupIndexOp(tmpPath2, fs, new ArrayList()); Assert.assertFalse("Expected " + tmp2 + " to be cleaned up but it wasn't", tmp2.exists()); } @@ -210,38 +201,14 @@ public class FileUtilTest { HashMap testProps = new HashMap<>(); testProps.put(Property.INSTANCE_VOLUMES, v1.toURI().toString() + "," + v2.toURI().toString()); - AccumuloConfiguration testConf = new FileUtilTestConfiguration(testProps); VolumeManager fs = VolumeManagerImpl.getLocal(accumuloDir.getAbsolutePath()); - FileUtil.cleanupIndexOp(testConf, tmpPath1, fs, new ArrayList()); + FileUtil.cleanupIndexOp(tmpPath1, fs, new ArrayList()); Assert.assertFalse("Expected " + tmp1 + " to be cleaned up but it wasn't", tmp1.exists()); - FileUtil.cleanupIndexOp(testConf, tmpPath2, fs, new ArrayList()); + FileUtil.cleanupIndexOp(tmpPath2, fs, new ArrayList()); Assert.assertFalse("Expected " + tmp2 + " to be cleaned up but it wasn't", tmp2.exists()); } - - private static class FileUtilTestConfiguration extends AccumuloConfiguration { - private DefaultConfiguration defaultConf = new DefaultConfiguration(); - private Map properties; - - public FileUtilTestConfiguration(Map properties) { - this.properties = properties; - } - - @Override - public String get(Property property) { - String value = properties.get(property); - if (null != value) { - return value; - } - return defaultConf.get(property); - } - - @Override - public void getProperties(Map props, Predicate filter) { - throw new UnsupportedOperationException(); - } - } }