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 46B9617847 for ; Fri, 17 Apr 2015 22:02:54 +0000 (UTC) Received: (qmail 45135 invoked by uid 500); 17 Apr 2015 22:02:54 -0000 Delivered-To: apmail-accumulo-commits-archive@accumulo.apache.org Received: (qmail 45052 invoked by uid 500); 17 Apr 2015 22:02:54 -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 45013 invoked by uid 99); 17 Apr 2015 22:02:54 -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; Fri, 17 Apr 2015 22:02:54 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id EC9B3E0013; Fri, 17 Apr 2015 22:02:53 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: ctubbsii@apache.org To: commits@accumulo.apache.org Date: Fri, 17 Apr 2015 22:02:54 -0000 Message-Id: <360c49c036a34117adf73f9d8c08a2f9@git.apache.org> In-Reply-To: <8296dc81514c4d2287fe171f738c57cd@git.apache.org> References: <8296dc81514c4d2287fe171f738c57cd@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: [2/2] accumulo git commit: ACCUMULO-3204 Remove unused code ACCUMULO-3204 Remove unused code Project: http://git-wip-us.apache.org/repos/asf/accumulo/repo Commit: http://git-wip-us.apache.org/repos/asf/accumulo/commit/a194c0b0 Tree: http://git-wip-us.apache.org/repos/asf/accumulo/tree/a194c0b0 Diff: http://git-wip-us.apache.org/repos/asf/accumulo/diff/a194c0b0 Branch: refs/heads/master Commit: a194c0b00b7a927e938da72350916f30b0a0707d Parents: 956a50e Author: Christopher Tubbs Authored: Fri Apr 17 18:02:03 2015 -0400 Committer: Christopher Tubbs Committed: Fri Apr 17 18:02:03 2015 -0400 ---------------------------------------------------------------------- .../accumulo/core/bloomfilter/Filter.java | 48 ---------- .../core/client/impl/ReplicationClient.java | 41 -------- .../core/client/impl/ScannerIterator.java | 5 - .../core/client/impl/ScannerOptions.java | 5 - .../accumulo/core/client/impl/Tables.java | 5 - .../accumulo/core/client/mock/MockAccumulo.java | 4 - .../accumulo/core/client/mock/MockTable.java | 6 +- .../org/apache/accumulo/core/conf/Property.java | 11 --- .../accumulo/core/conf/SiteConfiguration.java | 17 ---- .../apache/accumulo/core/data/PartialKey.java | 2 + .../core/file/blockfile/ABlockReader.java | 2 - .../core/file/blockfile/ABlockWriter.java | 3 - .../core/file/blockfile/BlockFileWriter.java | 2 - .../core/file/blockfile/cache/BlockCache.java | 5 - .../core/file/blockfile/cache/CachedBlock.java | 4 - .../core/file/blockfile/cache/ClassSize.java | 98 -------------------- .../file/blockfile/cache/LruBlockCache.java | 1 - .../file/blockfile/impl/CachableBlockFile.java | 28 ------ .../file/keyfunctor/ColumnFamilyFunctor.java | 2 +- .../accumulo/core/file/rfile/bcfile/BCFile.java | 19 ---- .../core/file/rfile/bcfile/CompareUtils.java | 36 ------- .../accumulo/core/file/rfile/bcfile/Utils.java | 82 ---------------- .../core/metadata/schema/MetadataSchema.java | 14 --- .../apache/accumulo/core/rpc/ThriftUtil.java | 70 -------------- .../apache/accumulo/core/util/AddressUtil.java | 4 - .../apache/accumulo/core/util/ByteArraySet.java | 4 - .../org/apache/accumulo/core/util/Daemon.java | 20 ---- .../apache/accumulo/core/util/MapCounter.java | 4 - .../apache/accumulo/core/util/StopWatch.java | 15 --- .../core/volume/VolumeConfiguration.java | 5 - .../simple/mapreduce/TeraSortIngest.java | 2 - .../accumulo/fate/zookeeper/ZooCache.java | 9 -- .../apache/accumulo/fate/zookeeper/ZooLock.java | 18 ---- .../accumulo/fate/zookeeper/ZooQueueLock.java | 7 -- .../accumulo/fate/zookeeper/ZooSession.java | 4 - .../impl/MiniAccumuloClusterImpl.java | 15 +-- .../impl/ZooKeeperBindException.java | 8 -- .../apache/accumulo/server/ServerConstants.java | 4 - .../accumulo/server/client/BulkImporter.java | 9 -- .../server/conf/NamespaceConfWatcher.java | 4 - .../accumulo/server/conf/TableConfWatcher.java | 4 - .../server/conf/TableParentConfiguration.java | 10 -- .../server/conf/ZooConfigurationFactory.java | 11 --- .../accumulo/server/log/SortedLogState.java | 8 -- .../accumulo/server/master/LiveTServerSet.java | 9 -- .../master/state/DistributedStoreException.java | 3 - .../server/master/state/TServerInstance.java | 4 - .../server/master/state/TabletServerState.java | 5 - .../server/metrics/AbstractMetricsImpl.java | 4 - .../server/metrics/MetricsConfiguration.java | 18 ---- .../server/replication/StatusFormatter.java | 5 - .../server/rpc/TBufferedServerSocket.java | 71 -------------- .../server/rpc/TNonblockingServerSocket.java | 7 -- .../server/security/SecurityOperation.java | 4 - .../security/handler/KerberosAuthorizor.java | 8 -- .../handler/KerberosPermissionHandler.java | 8 -- .../accumulo/server/tables/TableManager.java | 4 - .../accumulo/server/util/AccumuloStatus.java | 14 --- .../accumulo/server/util/CleanZookeeper.java | 3 - .../accumulo/server/util/FileSystemMonitor.java | 12 --- .../accumulo/server/util/MetadataTableUtil.java | 5 - .../accumulo/server/util/RestoreZookeeper.java | 2 - .../accumulo/server/util/time/RelativeTime.java | 4 - .../accumulo/server/util/time/SimpleTimer.java | 10 -- .../accumulo/server/zookeeper/ZooCache.java | 5 - .../accumulo/gc/SimpleGarbageCollector.java | 2 - .../org/apache/accumulo/monitor/Monitor.java | 27 ------ .../accumulo/monitor/ZooKeeperStatus.java | 4 - .../apache/accumulo/tracer/ZooTraceClient.java | 3 +- .../tserver/ActiveAssignmentRunnable.java | 4 +- .../accumulo/tserver/CompactionQueue.java | 70 ++++++-------- .../apache/accumulo/tserver/FileManager.java | 2 +- .../apache/accumulo/tserver/InMemoryMap.java | 8 +- .../org/apache/accumulo/tserver/MemValue.java | 11 --- .../org/apache/accumulo/tserver/NativeMap.java | 8 +- .../accumulo/tserver/RunnableStartedAt.java | 5 - .../org/apache/accumulo/tserver/TLevel.java | 6 -- .../apache/accumulo/tserver/TabletServer.java | 5 - .../tserver/TabletServerResourceManager.java | 52 +---------- .../accumulo/tserver/TabletStatsKeeper.java | 12 +-- .../compaction/MajorCompactionRequest.java | 7 -- .../apache/accumulo/tserver/log/DfsLogger.java | 16 +--- .../tserver/log/TabletServerLogger.java | 9 -- .../accumulo/tserver/logger/LogFileKey.java | 4 - .../accumulo/tserver/logger/LogFileValue.java | 4 - .../mastermessage/SplitReportMessage.java | 11 +-- .../accumulo/tserver/session/Session.java | 6 +- .../apache/accumulo/tserver/tablet/Rate.java | 4 - .../apache/accumulo/tserver/tablet/Tablet.java | 8 -- .../java/org/apache/accumulo/shell/Shell.java | 16 ---- .../accumulo/shell/ShellCommandException.java | 4 - .../apache/accumulo/shell/ShellCompletor.java | 4 - .../org/apache/accumulo/shell/ShellOptions.java | 3 - .../java/org/apache/accumulo/shell/Token.java | 6 -- .../accumulo/shell/commands/CompactCommand.java | 2 - .../accumulo/shell/commands/ScanCommand.java | 9 -- 96 files changed, 67 insertions(+), 1145 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/accumulo/blob/a194c0b0/core/src/main/java/org/apache/accumulo/core/bloomfilter/Filter.java ---------------------------------------------------------------------- diff --git a/core/src/main/java/org/apache/accumulo/core/bloomfilter/Filter.java b/core/src/main/java/org/apache/accumulo/core/bloomfilter/Filter.java index 27eab69..f6fb632 100644 --- a/core/src/main/java/org/apache/accumulo/core/bloomfilter/Filter.java +++ b/core/src/main/java/org/apache/accumulo/core/bloomfilter/Filter.java @@ -53,8 +53,6 @@ package org.apache.accumulo.core.bloomfilter; import java.io.DataInput; import java.io.DataOutput; import java.io.IOException; -import java.util.Collection; -import java.util.List; import org.apache.hadoop.io.Writable; import org.apache.hadoop.util.bloom.HashFunction; @@ -163,52 +161,6 @@ public abstract class Filter implements Writable { */ public abstract void not(); - /** - * Adds a list of keys to this filter. - * - * @param keys - * The list of keys. - */ - public void add(final List keys) { - if (keys == null) { - throw new IllegalArgumentException("ArrayList may not be null"); - } - - for (Key key : keys) { - add(key); - } - }// end add() - - /** - * Adds a collection of keys to this filter. - * - * @param keys - * The collection of keys. - */ - public void add(final Collection keys) { - if (keys == null) { - throw new IllegalArgumentException("Collection may not be null"); - } - for (Key key : keys) { - add(key); - } - }// end add() - - /** - * Adds an array of keys to this filter. - * - * @param keys - * The array of keys. - */ - public void add(Key[] keys) { - if (keys == null) { - throw new IllegalArgumentException("Key[] may not be null"); - } - for (int i = 0; i < keys.length; i++) { - add(keys[i]); - } - }// end add() - // Writable interface @Override http://git-wip-us.apache.org/repos/asf/accumulo/blob/a194c0b0/core/src/main/java/org/apache/accumulo/core/client/impl/ReplicationClient.java ---------------------------------------------------------------------- diff --git a/core/src/main/java/org/apache/accumulo/core/client/impl/ReplicationClient.java b/core/src/main/java/org/apache/accumulo/core/client/impl/ReplicationClient.java index a449389..673775a 100644 --- a/core/src/main/java/org/apache/accumulo/core/client/impl/ReplicationClient.java +++ b/core/src/main/java/org/apache/accumulo/core/client/impl/ReplicationClient.java @@ -29,7 +29,6 @@ import org.apache.accumulo.core.client.impl.thrift.ThriftSecurityException; import org.apache.accumulo.core.replication.thrift.ReplicationCoordinator; import org.apache.accumulo.core.replication.thrift.ReplicationServicer; import org.apache.accumulo.core.rpc.ThriftUtil; -import org.apache.accumulo.core.util.UtilWaitThread; import org.apache.accumulo.core.zookeeper.ZooUtil; import org.apache.accumulo.fate.zookeeper.ZooReader; import org.apache.thrift.TServiceClient; @@ -181,27 +180,6 @@ public class ReplicationClient { throw new AccumuloException("Could not connect to ReplicationCoordinator at " + context.getInstance().getInstanceName()); } - public static void executeCoordinator(ClientContext context, ClientExec exec) throws AccumuloException, - AccumuloSecurityException { - ReplicationCoordinator.Client client = null; - try { - client = getCoordinatorConnectionWithRetry(context); - exec.execute(client); - } catch (TTransportException tte) { - log.debug("ReplicationClient coordinator request failed, retrying ... ", tte); - UtilWaitThread.sleep(100); - } catch (ThriftSecurityException e) { - throw new AccumuloSecurityException(e.user, e.code, e); - } catch (AccumuloException e) { - throw e; - } catch (Exception e) { - throw new AccumuloException(e); - } finally { - if (client != null) - close(client); - } - } - public static T executeServicerWithReturn(ClientContext context, HostAndPort tserver, ClientExecReturn exec) throws AccumuloException, AccumuloSecurityException, TTransportException { ReplicationServicer.Client client = null; @@ -222,23 +200,4 @@ public class ReplicationClient { } } - public static void executeServicer(ClientContext context, HostAndPort tserver, ClientExec exec) throws AccumuloException, - AccumuloSecurityException, TTransportException { - ReplicationServicer.Client client = null; - try { - client = getServicerConnection(context, tserver); - exec.execute(client); - return; - } catch (ThriftSecurityException e) { - throw new AccumuloSecurityException(e.user, e.code, e); - } catch (AccumuloException e) { - throw e; - } catch (Exception e) { - throw new AccumuloException(e); - } finally { - if (client != null) - close(client); - } - } - } http://git-wip-us.apache.org/repos/asf/accumulo/blob/a194c0b0/core/src/main/java/org/apache/accumulo/core/client/impl/ScannerIterator.java ---------------------------------------------------------------------- diff --git a/core/src/main/java/org/apache/accumulo/core/client/impl/ScannerIterator.java b/core/src/main/java/org/apache/accumulo/core/client/impl/ScannerIterator.java index 123f532..fd91b5a 100644 --- a/core/src/main/java/org/apache/accumulo/core/client/impl/ScannerIterator.java +++ b/core/src/main/java/org/apache/accumulo/core/client/impl/ScannerIterator.java @@ -26,7 +26,6 @@ import java.util.concurrent.SynchronousQueue; import java.util.concurrent.ThreadPoolExecutor; import java.util.concurrent.TimeUnit; -import org.apache.accumulo.core.Constants; import org.apache.accumulo.core.client.AccumuloException; import org.apache.accumulo.core.client.AccumuloSecurityException; import org.apache.accumulo.core.client.TableDeletedException; @@ -105,10 +104,6 @@ public class ScannerIterator implements Iterator> { } - ScannerIterator(ClientContext context, Text table, Authorizations authorizations, Range range, int size, int timeOut, ScannerOptions options, boolean isolated) { - this(context, table, authorizations, range, size, timeOut, options, isolated, Constants.SCANNER_DEFAULT_READAHEAD_THRESHOLD); - } - ScannerIterator(ClientContext context, Text table, Authorizations authorizations, Range range, int size, int timeOut, ScannerOptions options, boolean isolated, long readaheadThreshold) { this.tableId = new Text(table); http://git-wip-us.apache.org/repos/asf/accumulo/blob/a194c0b0/core/src/main/java/org/apache/accumulo/core/client/impl/ScannerOptions.java ---------------------------------------------------------------------- diff --git a/core/src/main/java/org/apache/accumulo/core/client/impl/ScannerOptions.java b/core/src/main/java/org/apache/accumulo/core/client/impl/ScannerOptions.java index 3d486d2..e455d5a 100644 --- a/core/src/main/java/org/apache/accumulo/core/client/impl/ScannerOptions.java +++ b/core/src/main/java/org/apache/accumulo/core/client/impl/ScannerOptions.java @@ -133,11 +133,6 @@ public class ScannerOptions implements ScannerBase { fetchedColumns.add(c); } - public synchronized void fetchColumn(Column column) { - checkArgument(column != null, "column is null"); - fetchedColumns.add(column); - } - @Override public void fetchColumn(IteratorSetting.Column column) { checkArgument(column != null, "Column is null"); http://git-wip-us.apache.org/repos/asf/accumulo/blob/a194c0b0/core/src/main/java/org/apache/accumulo/core/client/impl/Tables.java ---------------------------------------------------------------------- diff --git a/core/src/main/java/org/apache/accumulo/core/client/impl/Tables.java b/core/src/main/java/org/apache/accumulo/core/client/impl/Tables.java index 44f48c3..beacea9 100644 --- a/core/src/main/java/org/apache/accumulo/core/client/impl/Tables.java +++ b/core/src/main/java/org/apache/accumulo/core/client/impl/Tables.java @@ -154,11 +154,6 @@ public class Tables { return tableName == null ? "(ID:" + tableId + ")" : tableName; } - public static String getPrintableTableIdFromName(Map nameToIdMap, String tableName) { - String tableId = nameToIdMap.get(tableName); - return tableId == null ? "(NAME:" + tableName + ")" : tableId; - } - public static String getPrintableTableInfoFromId(Instance instance, String tableId) { String tableName = null; try { http://git-wip-us.apache.org/repos/asf/accumulo/blob/a194c0b0/core/src/main/java/org/apache/accumulo/core/client/mock/MockAccumulo.java ---------------------------------------------------------------------- diff --git a/core/src/main/java/org/apache/accumulo/core/client/mock/MockAccumulo.java b/core/src/main/java/org/apache/accumulo/core/client/mock/MockAccumulo.java index f171889..e1ca768 100644 --- a/core/src/main/java/org/apache/accumulo/core/client/mock/MockAccumulo.java +++ b/core/src/main/java/org/apache/accumulo/core/client/mock/MockAccumulo.java @@ -75,10 +75,6 @@ public class MockAccumulo { return systemProperties.remove(key); } - void createTable(String user, String table) { - createTable(user, table, true, TimeType.MILLIS); - } - public void addMutation(String table, Mutation m) { MockTable t = tables.get(table); t.addMutation(m); http://git-wip-us.apache.org/repos/asf/accumulo/blob/a194c0b0/core/src/main/java/org/apache/accumulo/core/client/mock/MockTable.java ---------------------------------------------------------------------- diff --git a/core/src/main/java/org/apache/accumulo/core/client/mock/MockTable.java b/core/src/main/java/org/apache/accumulo/core/client/mock/MockTable.java index 2244d20..6f66c60 100644 --- a/core/src/main/java/org/apache/accumulo/core/client/mock/MockTable.java +++ b/core/src/main/java/org/apache/accumulo/core/client/mock/MockTable.java @@ -57,7 +57,7 @@ public class MockTable { @Override public boolean equals(Object other) { - return (other instanceof MockMemKey) && super.equals((MockMemKey) other) && count == ((MockMemKey) other).count; + return (other instanceof MockMemKey) && super.equals(other) && count == ((MockMemKey) other).count; } @Override @@ -105,10 +105,6 @@ public class MockTable { } } - MockTable(MockNamespace namespace, boolean limitVersion, TimeType timeType, String tableId) { - this(namespace, limitVersion, timeType, tableId, new HashMap()); - } - MockTable(MockNamespace namespace, boolean limitVersion, TimeType timeType, String tableId, Map properties) { this(limitVersion, timeType, tableId); Set> set = namespace.settings.entrySet(); http://git-wip-us.apache.org/repos/asf/accumulo/blob/a194c0b0/core/src/main/java/org/apache/accumulo/core/conf/Property.java ---------------------------------------------------------------------- diff --git a/core/src/main/java/org/apache/accumulo/core/conf/Property.java b/core/src/main/java/org/apache/accumulo/core/conf/Property.java index 08ba3a2..429abad 100644 --- a/core/src/main/java/org/apache/accumulo/core/conf/Property.java +++ b/core/src/main/java/org/apache/accumulo/core/conf/Property.java @@ -25,7 +25,6 @@ import java.util.HashSet; import java.util.Map; import java.util.Map.Entry; import java.util.Properties; -import java.util.Set; import org.apache.accumulo.core.Constants; import org.apache.accumulo.core.client.security.tokens.PasswordToken; @@ -792,16 +791,6 @@ public enum Property { } /** - * Gets the set of "fixed" valid Zookeeper properties. - * - * @return fixed Zookeeper properties - * @see #isFixedZooPropertyKey(Property) - */ - public static Set getFixedProperties() { - return fixedProperties; - } - - /** * Checks if the given property key is valid for a property that may be changed via Zookeeper. * * @param key http://git-wip-us.apache.org/repos/asf/accumulo/blob/a194c0b0/core/src/main/java/org/apache/accumulo/core/conf/SiteConfiguration.java ---------------------------------------------------------------------- diff --git a/core/src/main/java/org/apache/accumulo/core/conf/SiteConfiguration.java b/core/src/main/java/org/apache/accumulo/core/conf/SiteConfiguration.java index e8c49b4..b2f5a18 100644 --- a/core/src/main/java/org/apache/accumulo/core/conf/SiteConfiguration.java +++ b/core/src/main/java/org/apache/accumulo/core/conf/SiteConfiguration.java @@ -169,23 +169,6 @@ public class SiteConfiguration extends AccumuloConfiguration { } /** - * method here to support testing, do not call - */ - public void clear() { - getXmlConfig().clear(); - } - - /** - * Clears the configuration properties in this configuration (but not the parent) and nulls it. This method supports testing and should not be called. - */ - public synchronized void clearAndNull() { - if (xmlConfig != null) { - xmlConfig.clear(); - xmlConfig = null; - } - } - - /** * Sets a property. This method supports testing and should not be called. * * @param property http://git-wip-us.apache.org/repos/asf/accumulo/blob/a194c0b0/core/src/main/java/org/apache/accumulo/core/data/PartialKey.java ---------------------------------------------------------------------- diff --git a/core/src/main/java/org/apache/accumulo/core/data/PartialKey.java b/core/src/main/java/org/apache/accumulo/core/data/PartialKey.java index f4289d2..bf0df1e 100644 --- a/core/src/main/java/org/apache/accumulo/core/data/PartialKey.java +++ b/core/src/main/java/org/apache/accumulo/core/data/PartialKey.java @@ -38,7 +38,9 @@ public enum PartialKey { * @return partial key * @throws IllegalArgumentException * if no partial key has the given depth + * @deprecated since 1.7.0 */ + @Deprecated public static PartialKey getByDepth(int depth) { for (PartialKey d : PartialKey.values()) if (depth == d.depth) http://git-wip-us.apache.org/repos/asf/accumulo/blob/a194c0b0/core/src/main/java/org/apache/accumulo/core/file/blockfile/ABlockReader.java ---------------------------------------------------------------------- diff --git a/core/src/main/java/org/apache/accumulo/core/file/blockfile/ABlockReader.java b/core/src/main/java/org/apache/accumulo/core/file/blockfile/ABlockReader.java index 8df2469..9ae895e 100644 --- a/core/src/main/java/org/apache/accumulo/core/file/blockfile/ABlockReader.java +++ b/core/src/main/java/org/apache/accumulo/core/file/blockfile/ABlockReader.java @@ -28,8 +28,6 @@ import java.io.IOException; public interface ABlockReader extends DataInput { - long getRawSize(); - DataInputStream getStream() throws IOException; void close() throws IOException; http://git-wip-us.apache.org/repos/asf/accumulo/blob/a194c0b0/core/src/main/java/org/apache/accumulo/core/file/blockfile/ABlockWriter.java ---------------------------------------------------------------------- diff --git a/core/src/main/java/org/apache/accumulo/core/file/blockfile/ABlockWriter.java b/core/src/main/java/org/apache/accumulo/core/file/blockfile/ABlockWriter.java index ece0a5e..f7a734b 100644 --- a/core/src/main/java/org/apache/accumulo/core/file/blockfile/ABlockWriter.java +++ b/core/src/main/java/org/apache/accumulo/core/file/blockfile/ABlockWriter.java @@ -17,7 +17,6 @@ package org.apache.accumulo.core.file.blockfile; import java.io.DataOutput; -import java.io.DataOutputStream; import java.io.IOException; /* @@ -36,6 +35,4 @@ public interface ABlockWriter extends DataOutput { long getStartPos() throws IOException; - DataOutputStream getStream() throws IOException; - } http://git-wip-us.apache.org/repos/asf/accumulo/blob/a194c0b0/core/src/main/java/org/apache/accumulo/core/file/blockfile/BlockFileWriter.java ---------------------------------------------------------------------- diff --git a/core/src/main/java/org/apache/accumulo/core/file/blockfile/BlockFileWriter.java b/core/src/main/java/org/apache/accumulo/core/file/blockfile/BlockFileWriter.java index 3bdbea3..570a8a5 100644 --- a/core/src/main/java/org/apache/accumulo/core/file/blockfile/BlockFileWriter.java +++ b/core/src/main/java/org/apache/accumulo/core/file/blockfile/BlockFileWriter.java @@ -28,8 +28,6 @@ import java.io.IOException; public interface BlockFileWriter { - ABlockWriter prepareMetaBlock(String name, String compressionName) throws IOException; - ABlockWriter prepareMetaBlock(String name) throws IOException; ABlockWriter prepareDataBlock() throws IOException; http://git-wip-us.apache.org/repos/asf/accumulo/blob/a194c0b0/core/src/main/java/org/apache/accumulo/core/file/blockfile/cache/BlockCache.java ---------------------------------------------------------------------- diff --git a/core/src/main/java/org/apache/accumulo/core/file/blockfile/cache/BlockCache.java b/core/src/main/java/org/apache/accumulo/core/file/blockfile/cache/BlockCache.java index a6c08ff..73ef0a6 100644 --- a/core/src/main/java/org/apache/accumulo/core/file/blockfile/cache/BlockCache.java +++ b/core/src/main/java/org/apache/accumulo/core/file/blockfile/cache/BlockCache.java @@ -55,11 +55,6 @@ public interface BlockCache { CacheEntry getBlock(String blockName); /** - * Shutdown the cache. - */ - void shutdown(); - - /** * Get the maximum size of this cache. * * @return max size in bytes http://git-wip-us.apache.org/repos/asf/accumulo/blob/a194c0b0/core/src/main/java/org/apache/accumulo/core/file/blockfile/cache/CachedBlock.java ---------------------------------------------------------------------- diff --git a/core/src/main/java/org/apache/accumulo/core/file/blockfile/cache/CachedBlock.java b/core/src/main/java/org/apache/accumulo/core/file/blockfile/cache/CachedBlock.java index eef900c..b1d5c71 100644 --- a/core/src/main/java/org/apache/accumulo/core/file/blockfile/cache/CachedBlock.java +++ b/core/src/main/java/org/apache/accumulo/core/file/blockfile/cache/CachedBlock.java @@ -55,10 +55,6 @@ public class CachedBlock implements HeapSize, Comparable, CacheEntr private BlockPriority priority; private Object index; - public CachedBlock(String blockName, byte buf[], long accessTime) { - this(blockName, buf, accessTime, false); - } - public CachedBlock(String blockName, byte buf[], long accessTime, boolean inMemory) { this.blockName = blockName; this.buf = buf; http://git-wip-us.apache.org/repos/asf/accumulo/blob/a194c0b0/core/src/main/java/org/apache/accumulo/core/file/blockfile/cache/ClassSize.java ---------------------------------------------------------------------- diff --git a/core/src/main/java/org/apache/accumulo/core/file/blockfile/cache/ClassSize.java b/core/src/main/java/org/apache/accumulo/core/file/blockfile/cache/ClassSize.java index b46da23..bd1e2e8 100644 --- a/core/src/main/java/org/apache/accumulo/core/file/blockfile/cache/ClassSize.java +++ b/core/src/main/java/org/apache/accumulo/core/file/blockfile/cache/ClassSize.java @@ -20,8 +20,6 @@ package org.apache.accumulo.core.file.blockfile.cache; -import java.lang.reflect.Field; -import java.lang.reflect.Modifier; import java.util.Properties; import org.apache.commons.logging.Log; @@ -35,8 +33,6 @@ import org.apache.commons.logging.LogFactory; public class ClassSize { static final Log LOG = LogFactory.getLog(ClassSize.class); - private static final int nrOfRefsPerObj = 2; - /** Array overhead */ public static final int ARRAY; @@ -152,100 +148,6 @@ public class ClassSize { } /** - * The estimate of the size of a class instance depends on whether the JVM uses 32 or 64 bit addresses, that is it depends on the size of an object reference. - * It is a linear function of the size of a reference, e.g. 24 + 5*r where r is the size of a reference (usually 4 or 8 bytes). - * - * This method returns the coefficients of the linear function, e.g. {24, 5} in the above example. - * - * @param cl - * A class whose instance size is to be estimated - * @return an array of 3 integers. The first integer is the size of the primitives, the second the number of arrays and the third the number of references. - */ - private static int[] getSizeCoefficients(Class cl, boolean debug) { - int primitives = 0; - int arrays = 0; - // The number of references that a new object takes - int references = nrOfRefsPerObj; - - for (; null != cl; cl = cl.getSuperclass()) { - Field[] field = cl.getDeclaredFields(); - if (null != field) { - for (int i = 0; i < field.length; i++) { - if (!Modifier.isStatic(field[i].getModifiers())) { - Class fieldClass = field[i].getType(); - if (fieldClass.isArray()) { - arrays++; - references++; - } else if (!fieldClass.isPrimitive()) { - references++; - } else {// Is simple primitive - String name = fieldClass.getName(); - - if (name.equals("int") || name.equals("I")) - primitives += SizeConstants.SIZEOF_INT; - else if (name.equals("long") || name.equals("J")) - primitives += SizeConstants.SIZEOF_LONG; - else if (name.equals("boolean") || name.equals("Z")) - primitives += SizeConstants.SIZEOF_BOOLEAN; - else if (name.equals("short") || name.equals("S")) - primitives += SizeConstants.SIZEOF_SHORT; - else if (name.equals("byte") || name.equals("B")) - primitives += SizeConstants.SIZEOF_BYTE; - else if (name.equals("char") || name.equals("C")) - primitives += SizeConstants.SIZEOF_CHAR; - else if (name.equals("float") || name.equals("F")) - primitives += SizeConstants.SIZEOF_FLOAT; - else if (name.equals("double") || name.equals("D")) - primitives += SizeConstants.SIZEOF_DOUBLE; - } - if (debug) { - if (LOG.isDebugEnabled()) { - // Write out region name as string and its encoded name. - LOG.debug(field[i].getName() + "\n\t" + field[i].getType()); - } - } - } - } - } - } - return new int[] {primitives, arrays, references}; - } - - /** - * Estimate the static space taken up by a class instance given the coefficients returned by getSizeCoefficients. - * - * @param coeff - * the coefficients - * - * @return the size estimate, in bytes - */ - private static long estimateBaseFromCoefficients(int[] coeff, boolean debug) { - long size = coeff[0] + align(coeff[1] * ARRAY) + coeff[2] * REFERENCE; - - // Round up to a multiple of 8 - size = align(size); - if (debug) { - if (LOG.isDebugEnabled()) { - // Write out region name as string and its encoded name. - LOG.debug("Primitives " + coeff[0] + ", arrays " + coeff[1] + ", references(includes " + nrOfRefsPerObj + " for object overhead) " + coeff[2] - + ", refSize " + REFERENCE + ", size " + size); - } - } - return size; - } - - /** - * Estimate the static space taken up by the fields of a class. This includes the space taken up by by references (the pointer) but not by the referenced - * object. So the estimated size of an array field does not depend on the size of the array. Similarly the size of an object (reference) field does not depend - * on the object. - * - * @return the size estimate in bytes. - */ - public static long estimateBase(Class cl, boolean debug) { - return estimateBaseFromCoefficients(getSizeCoefficients(cl, debug), debug); - } - - /** * Aligns a number to 8. * * @param num http://git-wip-us.apache.org/repos/asf/accumulo/blob/a194c0b0/core/src/main/java/org/apache/accumulo/core/file/blockfile/cache/LruBlockCache.java ---------------------------------------------------------------------- diff --git a/core/src/main/java/org/apache/accumulo/core/file/blockfile/cache/LruBlockCache.java b/core/src/main/java/org/apache/accumulo/core/file/blockfile/cache/LruBlockCache.java index 2bd1a38..af2f6df 100644 --- a/core/src/main/java/org/apache/accumulo/core/file/blockfile/cache/LruBlockCache.java +++ b/core/src/main/java/org/apache/accumulo/core/file/blockfile/cache/LruBlockCache.java @@ -698,7 +698,6 @@ public class LruBlockCache implements BlockCache, HeapSize { return (long) Math.floor(this.maxSize * this.memoryFactor * this.minFactor); } - @Override public void shutdown() { this.scheduleThreadPool.shutdown(); } http://git-wip-us.apache.org/repos/asf/accumulo/blob/a194c0b0/core/src/main/java/org/apache/accumulo/core/file/blockfile/impl/CachableBlockFile.java ---------------------------------------------------------------------- diff --git a/core/src/main/java/org/apache/accumulo/core/file/blockfile/impl/CachableBlockFile.java b/core/src/main/java/org/apache/accumulo/core/file/blockfile/impl/CachableBlockFile.java index 54da7d9..d00a797 100644 --- a/core/src/main/java/org/apache/accumulo/core/file/blockfile/impl/CachableBlockFile.java +++ b/core/src/main/java/org/apache/accumulo/core/file/blockfile/impl/CachableBlockFile.java @@ -78,12 +78,6 @@ public class CachableBlockFile { } @Override - public ABlockWriter prepareMetaBlock(String name, String compressionName) throws IOException { - _bw = new BlockWrite(_bc.prepareMetaBlock(name, compressionName)); - return _bw; - } - - @Override public ABlockWriter prepareDataBlock() throws IOException { _bw = new BlockWrite(_bc.prepareDataBlock()); return _bw; @@ -128,12 +122,6 @@ public class CachableBlockFile { } @Override - public DataOutputStream getStream() throws IOException { - - return this; - } - - @Override public long getStartPos() throws IOException { return _ba.getStartPos(); } @@ -430,12 +418,6 @@ public class CachableBlockFile { super(buf); } - public SeekableByteArrayInputStream(byte buf[], int offset, int length) { - super(buf, offset, length); - throw new UnsupportedOperationException("Seek code assumes offset is zero"); // do not need this constructor, documenting that seek will not work - // unless offset it kept track of - } - public void seek(int position) { if (pos < 0 || pos >= buf.length) throw new IllegalArgumentException("pos = " + pos + " buf.lenght = " + buf.length); @@ -508,19 +490,9 @@ public class CachableBlockFile { * */ public static class BlockRead extends DataInputStream implements ABlockReader { - private long size; public BlockRead(InputStream in, long size) { super(in); - this.size = size; - } - - /** - * Size is the size of the bytearray that was read form the cache - */ - @Override - public long getRawSize() { - return size; } /** http://git-wip-us.apache.org/repos/asf/accumulo/blob/a194c0b0/core/src/main/java/org/apache/accumulo/core/file/keyfunctor/ColumnFamilyFunctor.java ---------------------------------------------------------------------- diff --git a/core/src/main/java/org/apache/accumulo/core/file/keyfunctor/ColumnFamilyFunctor.java b/core/src/main/java/org/apache/accumulo/core/file/keyfunctor/ColumnFamilyFunctor.java index 3660291..c38aaee 100644 --- a/core/src/main/java/org/apache/accumulo/core/file/keyfunctor/ColumnFamilyFunctor.java +++ b/core/src/main/java/org/apache/accumulo/core/file/keyfunctor/ColumnFamilyFunctor.java @@ -41,7 +41,7 @@ public class ColumnFamilyFunctor implements KeyFunctor { @Override public Key transform(Range range) { - if (RowFunctor.isRangeInBloomFilter(range, PartialKey.ROW_COLFAM)) { + if (RowFunctor.isRangeInBloomFilter(range, kDepth)) { return transform(range.getStartKey()); } return null; http://git-wip-us.apache.org/repos/asf/accumulo/blob/a194c0b0/core/src/main/java/org/apache/accumulo/core/file/rfile/bcfile/BCFile.java ---------------------------------------------------------------------- diff --git a/core/src/main/java/org/apache/accumulo/core/file/rfile/bcfile/BCFile.java b/core/src/main/java/org/apache/accumulo/core/file/rfile/bcfile/BCFile.java index ecc0b90..91d61e1 100644 --- a/core/src/main/java/org/apache/accumulo/core/file/rfile/bcfile/BCFile.java +++ b/core/src/main/java/org/apache/accumulo/core/file/rfile/bcfile/BCFile.java @@ -37,8 +37,6 @@ import org.apache.accumulo.core.conf.Property; import org.apache.accumulo.core.file.blockfile.impl.CachableBlockFile; import org.apache.accumulo.core.file.blockfile.impl.CachableBlockFile.BlockRead; import org.apache.accumulo.core.file.rfile.bcfile.CompareUtils.Scalar; -import org.apache.accumulo.core.file.rfile.bcfile.CompareUtils.ScalarComparator; -import org.apache.accumulo.core.file.rfile.bcfile.CompareUtils.ScalarLong; import org.apache.accumulo.core.file.rfile.bcfile.Compression.Algorithm; import org.apache.accumulo.core.file.rfile.bcfile.Utils.Version; import org.apache.accumulo.core.security.crypto.CryptoModule; @@ -1032,23 +1030,6 @@ public final class BCFile { return new BlockReader(rbs); } - /** - * Find the smallest Block index whose starting offset is greater than or equal to the specified offset. - * - * @param offset - * User-specific offset. - * @return the index to the data Block if such block exists; or -1 otherwise. - */ - public int getBlockIndexNear(long offset) { - ArrayList list = dataIndex.getBlockRegionList(); - int idx = Utils.lowerBound(list, new ScalarLong(offset), new ScalarComparator()); - - if (idx == list.size()) { - return -1; - } - - return idx; - } } /** http://git-wip-us.apache.org/repos/asf/accumulo/blob/a194c0b0/core/src/main/java/org/apache/accumulo/core/file/rfile/bcfile/CompareUtils.java ---------------------------------------------------------------------- diff --git a/core/src/main/java/org/apache/accumulo/core/file/rfile/bcfile/CompareUtils.java b/core/src/main/java/org/apache/accumulo/core/file/rfile/bcfile/CompareUtils.java index ac0bdb1..0d16cd9 100644 --- a/core/src/main/java/org/apache/accumulo/core/file/rfile/bcfile/CompareUtils.java +++ b/core/src/main/java/org/apache/accumulo/core/file/rfile/bcfile/CompareUtils.java @@ -19,9 +19,6 @@ package org.apache.accumulo.core.file.rfile.bcfile; import java.io.Serializable; import java.util.Comparator; -import org.apache.hadoop.io.RawComparator; -import org.apache.hadoop.io.WritableComparator; - class CompareUtils { /** * Prevent the instantiation of class. @@ -31,26 +28,6 @@ class CompareUtils { } /** - * A comparator to compare anything that implements {@link RawComparable} using a customized comparator. - */ - public static final class BytesComparator implements Comparator { - private RawComparator cmp; - - public BytesComparator(RawComparator cmp) { - this.cmp = cmp; - } - - @Override - public int compare(RawComparable o1, RawComparable o2) { - return compare(o1.buffer(), o1.offset(), o1.size(), o2.buffer(), o2.offset(), o2.size()); - } - - public int compare(byte[] a, int off1, int len1, byte[] b, int off2, int len2) { - return cmp.compare(a, off1, len1, b, off2, len2); - } - } - - /** * Interface for all objects that has a single integer magnitude. */ interface Scalar { @@ -84,17 +61,4 @@ class CompareUtils { } } - public static final class MemcmpRawComparator implements RawComparator, Serializable { - private static final long serialVersionUID = 1L; - - @Override - public int compare(byte[] b1, int s1, int l1, byte[] b2, int s2, int l2) { - return WritableComparator.compareBytes(b1, s1, l1, b2, s2, l2); - } - - @Override - public int compare(Object o1, Object o2) { - throw new RuntimeException("Object comparison not supported"); - } - } } http://git-wip-us.apache.org/repos/asf/accumulo/blob/a194c0b0/core/src/main/java/org/apache/accumulo/core/file/rfile/bcfile/Utils.java ---------------------------------------------------------------------- diff --git a/core/src/main/java/org/apache/accumulo/core/file/rfile/bcfile/Utils.java b/core/src/main/java/org/apache/accumulo/core/file/rfile/bcfile/Utils.java index fca120e..6cb04a1 100644 --- a/core/src/main/java/org/apache/accumulo/core/file/rfile/bcfile/Utils.java +++ b/core/src/main/java/org/apache/accumulo/core/file/rfile/bcfile/Utils.java @@ -384,86 +384,4 @@ public final class Utils { return low; } - /** - * Upper bound binary search. Find the index to the first element in the list that compares greater than the input key. - * - * @param - * Type of the input key. - * @param list - * The list - * @param key - * The input key. - * @param cmp - * Comparator for the key. - * @return The index to the desired element if it exists; or list.size() otherwise. - */ - public static int upperBound(List list, T key, Comparator cmp) { - int low = 0; - int high = list.size(); - - while (low < high) { - int mid = (low + high) >>> 1; - T midVal = list.get(mid); - int ret = cmp.compare(midVal, key); - if (ret <= 0) - low = mid + 1; - else - high = mid; - } - return low; - } - - /** - * Lower bound binary search. Find the index to the first element in the list that compares greater than or equal to key. - * - * @param - * Type of the input key. - * @param list - * The list - * @param key - * The input key. - * @return The index to the desired element if it exists; or list.size() otherwise. - */ - public static int lowerBound(List> list, T key) { - int low = 0; - int high = list.size(); - - while (low < high) { - int mid = (low + high) >>> 1; - Comparable midVal = list.get(mid); - int ret = midVal.compareTo(key); - if (ret < 0) - low = mid + 1; - else - high = mid; - } - return low; - } - - /** - * Upper bound binary search. Find the index to the first element in the list that compares greater than the input key. - * - * @param - * Type of the input key. - * @param list - * The list - * @param key - * The input key. - * @return The index to the desired element if it exists; or list.size() otherwise. - */ - public static int upperBound(List> list, T key) { - int low = 0; - int high = list.size(); - - while (low < high) { - int mid = (low + high) >>> 1; - Comparable midVal = list.get(mid); - int ret = midVal.compareTo(key); - if (ret <= 0) - low = mid + 1; - else - high = mid; - } - return low; - } } http://git-wip-us.apache.org/repos/asf/accumulo/blob/a194c0b0/core/src/main/java/org/apache/accumulo/core/metadata/schema/MetadataSchema.java ---------------------------------------------------------------------- diff --git a/core/src/main/java/org/apache/accumulo/core/metadata/schema/MetadataSchema.java b/core/src/main/java/org/apache/accumulo/core/metadata/schema/MetadataSchema.java index 534dd7f..6baae17 100644 --- a/core/src/main/java/org/apache/accumulo/core/metadata/schema/MetadataSchema.java +++ b/core/src/main/java/org/apache/accumulo/core/metadata/schema/MetadataSchema.java @@ -246,20 +246,6 @@ public class MetadataSchema { } /** - * Extract the table ID from the colfam (inefficiently if called repeatedly) - * - * @param k - * Key to extract from - * @return The table ID - * @see #getTableId(Key,Text) - */ - public static String getTableId(Key k) { - Text buff = new Text(); - getTableId(k, buff); - return buff.toString(); - } - - /** * Extract the table ID from the colfam into the given {@link Text} * * @param k http://git-wip-us.apache.org/repos/asf/accumulo/blob/a194c0b0/core/src/main/java/org/apache/accumulo/core/rpc/ThriftUtil.java ---------------------------------------------------------------------- diff --git a/core/src/main/java/org/apache/accumulo/core/rpc/ThriftUtil.java b/core/src/main/java/org/apache/accumulo/core/rpc/ThriftUtil.java index 0f952c2..1b5c256 100644 --- a/core/src/main/java/org/apache/accumulo/core/rpc/ThriftUtil.java +++ b/core/src/main/java/org/apache/accumulo/core/rpc/ThriftUtil.java @@ -29,16 +29,10 @@ import javax.net.ssl.SSLSocket; import javax.net.ssl.SSLSocketFactory; import javax.net.ssl.TrustManagerFactory; -import org.apache.accumulo.core.client.AccumuloException; -import org.apache.accumulo.core.client.AccumuloSecurityException; import org.apache.accumulo.core.client.impl.ClientContext; -import org.apache.accumulo.core.client.impl.ClientExec; -import org.apache.accumulo.core.client.impl.ClientExecReturn; import org.apache.accumulo.core.client.impl.ThriftTransportPool; -import org.apache.accumulo.core.client.impl.thrift.ThriftSecurityException; import org.apache.accumulo.core.rpc.SaslConnectionParams.SaslMechanism; import org.apache.accumulo.core.tabletserver.thrift.TabletClientService; -import org.apache.accumulo.core.util.UtilWaitThread; import org.apache.hadoop.security.UserGroupInformation; import org.apache.thrift.TException; import org.apache.thrift.TServiceClient; @@ -181,70 +175,6 @@ public class ThriftUtil { } /** - * Execute the provided closure against a TabletServer at the given address. If a Thrift transport exception occurs, the operation will be automatically - * retried. - * - * @param address - * TabletServer address - * @param context - * RPC options - * @param exec - * The closure to execute - */ - public static void execute(HostAndPort address, ClientContext context, ClientExec exec) throws AccumuloException, - AccumuloSecurityException { - while (true) { - TabletClientService.Client client = null; - try { - exec.execute(client = getTServerClient(address, context)); - break; - } catch (TTransportException tte) { - log.debug("getTServerClient request failed, retrying ... ", tte); - UtilWaitThread.sleep(100); - } catch (ThriftSecurityException e) { - throw new AccumuloSecurityException(e.user, e.code, e); - } catch (Exception e) { - throw new AccumuloException(e); - } finally { - if (client != null) - returnClient(client); - } - } - } - - /** - * Execute the provided closure against the TabletServer at the given address, and return the result of the closure to the client. If a Thrift transport - * exception occurs, the operation will be automatically retried. - * - * @param address - * TabletServer address - * @param context - * RPC options - * @param exec - * Closure with a return value to execute - * @return The result from the closure - */ - public static T execute(HostAndPort address, ClientContext context, ClientExecReturn exec) throws AccumuloException, - AccumuloSecurityException { - while (true) { - TabletClientService.Client client = null; - try { - return exec.execute(client = getTServerClient(address, context)); - } catch (TTransportException tte) { - log.debug("getTServerClient request failed, retrying ... ", tte); - UtilWaitThread.sleep(100); - } catch (ThriftSecurityException e) { - throw new AccumuloSecurityException(e.user, e.code, e); - } catch (Exception e) { - throw new AccumuloException(e); - } finally { - if (client != null) - returnClient(client); - } - } - } - - /** * Create a transport that is not pooled * * @param address http://git-wip-us.apache.org/repos/asf/accumulo/blob/a194c0b0/core/src/main/java/org/apache/accumulo/core/util/AddressUtil.java ---------------------------------------------------------------------- diff --git a/core/src/main/java/org/apache/accumulo/core/util/AddressUtil.java b/core/src/main/java/org/apache/accumulo/core/util/AddressUtil.java index 1426239..4a0d32b 100644 --- a/core/src/main/java/org/apache/accumulo/core/util/AddressUtil.java +++ b/core/src/main/java/org/apache/accumulo/core/util/AddressUtil.java @@ -20,10 +20,6 @@ import com.google.common.net.HostAndPort; public class AddressUtil extends org.apache.accumulo.fate.util.AddressUtil { - static public HostAndPort parseAddress(String address) throws NumberFormatException { - return parseAddress(address, false); - } - static public HostAndPort parseAddress(String address, boolean ignoreMissingPort) throws NumberFormatException { address = address.replace('+', ':'); HostAndPort hap = HostAndPort.fromString(address); http://git-wip-us.apache.org/repos/asf/accumulo/blob/a194c0b0/core/src/main/java/org/apache/accumulo/core/util/ByteArraySet.java ---------------------------------------------------------------------- diff --git a/core/src/main/java/org/apache/accumulo/core/util/ByteArraySet.java b/core/src/main/java/org/apache/accumulo/core/util/ByteArraySet.java index ca43469..bf177fd 100644 --- a/core/src/main/java/org/apache/accumulo/core/util/ByteArraySet.java +++ b/core/src/main/java/org/apache/accumulo/core/util/ByteArraySet.java @@ -48,8 +48,4 @@ public class ByteArraySet extends TreeSet { return ByteArraySet.fromStrings(Arrays.asList(c)); } - public List toList() { - return new ArrayList(this); - } - } http://git-wip-us.apache.org/repos/asf/accumulo/blob/a194c0b0/core/src/main/java/org/apache/accumulo/core/util/Daemon.java ---------------------------------------------------------------------- diff --git a/core/src/main/java/org/apache/accumulo/core/util/Daemon.java b/core/src/main/java/org/apache/accumulo/core/util/Daemon.java index a2c9e79..34d95ab 100644 --- a/core/src/main/java/org/apache/accumulo/core/util/Daemon.java +++ b/core/src/main/java/org/apache/accumulo/core/util/Daemon.java @@ -32,29 +32,9 @@ public class Daemon extends Thread { setDaemon(true); } - public Daemon(ThreadGroup group, Runnable target) { - super(group, target); - setDaemon(true); - } - - public Daemon(ThreadGroup group, String name) { - super(group, name); - setDaemon(true); - } - public Daemon(Runnable target, String name) { super(target, name); setDaemon(true); } - public Daemon(ThreadGroup group, Runnable target, String name) { - super(group, target, name); - setDaemon(true); - } - - public Daemon(ThreadGroup group, Runnable target, String name, long stackSize) { - super(group, target, name, stackSize); - setDaemon(true); - } - } http://git-wip-us.apache.org/repos/asf/accumulo/blob/a194c0b0/core/src/main/java/org/apache/accumulo/core/util/MapCounter.java ---------------------------------------------------------------------- diff --git a/core/src/main/java/org/apache/accumulo/core/util/MapCounter.java b/core/src/main/java/org/apache/accumulo/core/util/MapCounter.java index f6f3ff7..4372cfc 100644 --- a/core/src/main/java/org/apache/accumulo/core/util/MapCounter.java +++ b/core/src/main/java/org/apache/accumulo/core/util/MapCounter.java @@ -53,10 +53,6 @@ public class MapCounter { return increment(key, -1 * l); } - public boolean contains(KT key) { - return map.containsKey(key); - } - public long get(KT key) { MutableLong ml = map.get(key); if (ml == null) { http://git-wip-us.apache.org/repos/asf/accumulo/blob/a194c0b0/core/src/main/java/org/apache/accumulo/core/util/StopWatch.java ---------------------------------------------------------------------- diff --git a/core/src/main/java/org/apache/accumulo/core/util/StopWatch.java b/core/src/main/java/org/apache/accumulo/core/util/StopWatch.java index ddb612f..8abe19e 100644 --- a/core/src/main/java/org/apache/accumulo/core/util/StopWatch.java +++ b/core/src/main/java/org/apache/accumulo/core/util/StopWatch.java @@ -34,11 +34,6 @@ public class StopWatch> { startTime.put(timer, System.currentTimeMillis()); } - public synchronized void stopIfActive(K timer) { - if (startTime.containsKey(timer)) - stop(timer); - } - public synchronized void stop(K timer) { Long st = startTime.get(timer); @@ -55,10 +50,6 @@ public class StopWatch> { startTime.remove(timer); } - public synchronized void reset(K timer) { - totalTime.remove(timer); - } - public synchronized long get(K timer) { Long existingTime = totalTime.get(timer); if (existingTime == null) @@ -73,10 +64,4 @@ public class StopWatch> { return existingTime / 1000.0; } - public synchronized void print() { - for (K timer : totalTime.keySet()) { - System.out.printf("%20s : %,6.4f secs%n", timer.toString(), get(timer) / 1000.0); - } - } - } http://git-wip-us.apache.org/repos/asf/accumulo/blob/a194c0b0/core/src/main/java/org/apache/accumulo/core/volume/VolumeConfiguration.java ---------------------------------------------------------------------- diff --git a/core/src/main/java/org/apache/accumulo/core/volume/VolumeConfiguration.java b/core/src/main/java/org/apache/accumulo/core/volume/VolumeConfiguration.java index 99032ad..01fa0f9 100644 --- a/core/src/main/java/org/apache/accumulo/core/volume/VolumeConfiguration.java +++ b/core/src/main/java/org/apache/accumulo/core/volume/VolumeConfiguration.java @@ -150,11 +150,6 @@ public class VolumeConfiguration { return new VolumeImpl(fs, basePath); } - public static Volume create(String path, Configuration conf) throws IOException { - Preconditions.checkNotNull(path); - return create(new Path(path), conf); - } - public static Volume create(Path path, Configuration conf) throws IOException { return new VolumeImpl(path, conf); } http://git-wip-us.apache.org/repos/asf/accumulo/blob/a194c0b0/examples/simple/src/main/java/org/apache/accumulo/examples/simple/mapreduce/TeraSortIngest.java ---------------------------------------------------------------------- diff --git a/examples/simple/src/main/java/org/apache/accumulo/examples/simple/mapreduce/TeraSortIngest.java b/examples/simple/src/main/java/org/apache/accumulo/examples/simple/mapreduce/TeraSortIngest.java index 9aac75e..b535513 100644 --- a/examples/simple/src/main/java/org/apache/accumulo/examples/simple/mapreduce/TeraSortIngest.java +++ b/examples/simple/src/main/java/org/apache/accumulo/examples/simple/mapreduce/TeraSortIngest.java @@ -115,8 +115,6 @@ public class TeraSortIngest extends Configured implements Tool { long finishedRows; long totalRows; - LongWritable currentKey; - public RangeRecordReader(RangeInputSplit split) { startRow = split.firstRow; finishedRows = 0; http://git-wip-us.apache.org/repos/asf/accumulo/blob/a194c0b0/fate/src/main/java/org/apache/accumulo/fate/zookeeper/ZooCache.java ---------------------------------------------------------------------- diff --git a/fate/src/main/java/org/apache/accumulo/fate/zookeeper/ZooCache.java b/fate/src/main/java/org/apache/accumulo/fate/zookeeper/ZooCache.java index 1fade84..5a4fb11 100644 --- a/fate/src/main/java/org/apache/accumulo/fate/zookeeper/ZooCache.java +++ b/fate/src/main/java/org/apache/accumulo/fate/zookeeper/ZooCache.java @@ -387,13 +387,4 @@ public class ZooCache { } } - private static ZooCacheFactory zcf = new ZooCacheFactory(); - - /** - * @deprecated Use {@link ZooCacheFactory} instead. - */ - @Deprecated - public static synchronized ZooCache getInstance(String zooKeepers, int sessionTimeout) { - return zcf.getZooCache(zooKeepers, sessionTimeout); - } } http://git-wip-us.apache.org/repos/asf/accumulo/blob/a194c0b0/fate/src/main/java/org/apache/accumulo/fate/zookeeper/ZooLock.java ---------------------------------------------------------------------- diff --git a/fate/src/main/java/org/apache/accumulo/fate/zookeeper/ZooLock.java b/fate/src/main/java/org/apache/accumulo/fate/zookeeper/ZooLock.java index 11da1ec..992a444 100644 --- a/fate/src/main/java/org/apache/accumulo/fate/zookeeper/ZooLock.java +++ b/fate/src/main/java/org/apache/accumulo/fate/zookeeper/ZooLock.java @@ -396,24 +396,6 @@ public class ZooLock implements Watcher { } - public static boolean isLockHeld(ZooKeeper zk, LockID lid) throws KeeperException, InterruptedException { - - List children = zk.getChildren(lid.path, false); - - if (children == null || children.size() == 0) { - return false; - } - - Collections.sort(children); - - String lockNode = children.get(0); - if (!lid.node.equals(lockNode)) - return false; - - Stat stat = zk.exists(lid.path + "/" + lid.node, false); - return stat != null && stat.getEphemeralOwner() == lid.eid; - } - public static boolean isLockHeld(ZooCache zc, LockID lid) { List children = zc.getChildren(lid.path); http://git-wip-us.apache.org/repos/asf/accumulo/blob/a194c0b0/fate/src/main/java/org/apache/accumulo/fate/zookeeper/ZooQueueLock.java ---------------------------------------------------------------------- diff --git a/fate/src/main/java/org/apache/accumulo/fate/zookeeper/ZooQueueLock.java b/fate/src/main/java/org/apache/accumulo/fate/zookeeper/ZooQueueLock.java index f9195f3..1b22dc9 100644 --- a/fate/src/main/java/org/apache/accumulo/fate/zookeeper/ZooQueueLock.java +++ b/fate/src/main/java/org/apache/accumulo/fate/zookeeper/ZooQueueLock.java @@ -32,17 +32,10 @@ public class ZooQueueLock implements QueueLock { private static final String PREFIX = "lock-"; - // private static final Logger log = Logger.getLogger(ZooQueueLock.class); - private IZooReaderWriter zoo; private String path; private boolean ephemeral; - public ZooQueueLock(String zookeepers, int timeInMillis, String scheme, byte[] auth, String path, boolean ephemeral) throws KeeperException, - InterruptedException { - this(ZooReaderWriter.getInstance(zookeepers, timeInMillis, scheme, auth), path, ephemeral); - } - protected ZooQueueLock(IZooReaderWriter zrw, String path, boolean ephemeral) { this.zoo = zrw; this.path = path; http://git-wip-us.apache.org/repos/asf/accumulo/blob/a194c0b0/fate/src/main/java/org/apache/accumulo/fate/zookeeper/ZooSession.java ---------------------------------------------------------------------- diff --git a/fate/src/main/java/org/apache/accumulo/fate/zookeeper/ZooSession.java b/fate/src/main/java/org/apache/accumulo/fate/zookeeper/ZooSession.java index 811f035..837785f 100644 --- a/fate/src/main/java/org/apache/accumulo/fate/zookeeper/ZooSession.java +++ b/fate/src/main/java/org/apache/accumulo/fate/zookeeper/ZooSession.java @@ -140,10 +140,6 @@ public class ZooSession { return zooKeeper; } - public static synchronized ZooKeeper getSession(String zooKeepers, int timeout) { - return getSession(zooKeepers, timeout, null, null); - } - public static synchronized ZooKeeper getSession(String zooKeepers, int timeout, String scheme, byte[] auth) { if (sessions == null) http://git-wip-us.apache.org/repos/asf/accumulo/blob/a194c0b0/minicluster/src/main/java/org/apache/accumulo/minicluster/impl/MiniAccumuloClusterImpl.java ---------------------------------------------------------------------- diff --git a/minicluster/src/main/java/org/apache/accumulo/minicluster/impl/MiniAccumuloClusterImpl.java b/minicluster/src/main/java/org/apache/accumulo/minicluster/impl/MiniAccumuloClusterImpl.java index 2df1c5d..b1b59f2 100644 --- a/minicluster/src/main/java/org/apache/accumulo/minicluster/impl/MiniAccumuloClusterImpl.java +++ b/minicluster/src/main/java/org/apache/accumulo/minicluster/impl/MiniAccumuloClusterImpl.java @@ -106,6 +106,7 @@ import org.apache.zookeeper.data.Stat; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import com.google.common.annotations.VisibleForTesting; import com.google.common.base.Joiner; import com.google.common.base.Predicate; import com.google.common.collect.Maps; @@ -714,16 +715,6 @@ public class MiniAccumuloClusterImpl implements AccumuloCluster { return config; } - /** - * Utility method to get a connector to the MAC. - * - * @since 1.6.0 - */ - @Deprecated - public Connector getConnector(String user, String passwd) throws AccumuloException, AccumuloSecurityException { - return getConnector(user, new PasswordToken(passwd)); - } - @Override public Connector getConnector(String user, AuthenticationToken token) throws AccumuloException, AccumuloSecurityException { Instance instance = new ZooKeeperInstance(getClientConfig()); @@ -745,12 +736,12 @@ public class MiniAccumuloClusterImpl implements AccumuloCluster { } } - // Visible for testing + @VisibleForTesting protected void setShutdownExecutor(ExecutorService svc) { this.executor = svc; } - // Visible for testing + @VisibleForTesting protected ExecutorService getShutdownExecutor() { return executor; } http://git-wip-us.apache.org/repos/asf/accumulo/blob/a194c0b0/minicluster/src/main/java/org/apache/accumulo/minicluster/impl/ZooKeeperBindException.java ---------------------------------------------------------------------- diff --git a/minicluster/src/main/java/org/apache/accumulo/minicluster/impl/ZooKeeperBindException.java b/minicluster/src/main/java/org/apache/accumulo/minicluster/impl/ZooKeeperBindException.java index 50217ce..4e69861 100644 --- a/minicluster/src/main/java/org/apache/accumulo/minicluster/impl/ZooKeeperBindException.java +++ b/minicluster/src/main/java/org/apache/accumulo/minicluster/impl/ZooKeeperBindException.java @@ -29,12 +29,4 @@ public class ZooKeeperBindException extends RuntimeException { super(message); } - public ZooKeeperBindException(Throwable cause) { - super(cause); - } - - public ZooKeeperBindException(String message, Throwable cause) { - super(message, cause); - } - } http://git-wip-us.apache.org/repos/asf/accumulo/blob/a194c0b0/server/base/src/main/java/org/apache/accumulo/server/ServerConstants.java ---------------------------------------------------------------------- diff --git a/server/base/src/main/java/org/apache/accumulo/server/ServerConstants.java b/server/base/src/main/java/org/apache/accumulo/server/ServerConstants.java index 9d969d1..0ce2b47 100644 --- a/server/base/src/main/java/org/apache/accumulo/server/ServerConstants.java +++ b/server/base/src/main/java/org/apache/accumulo/server/ServerConstants.java @@ -156,10 +156,6 @@ public class ServerConstants { return VolumeConfiguration.prefix(getBaseUris(), WALOG_ARCHIVE_DIR); } - public static String[] getFileArchives() { - return VolumeConfiguration.prefix(getBaseUris(), FILE_ARCHIVE_DIR); - } - public static Path getInstanceIdLocation(Volume v) { // all base dirs should have the same instance id, so can choose any one return v.prefixChild(INSTANCE_ID_DIR); http://git-wip-us.apache.org/repos/asf/accumulo/blob/a194c0b0/server/base/src/main/java/org/apache/accumulo/server/client/BulkImporter.java ---------------------------------------------------------------------- diff --git a/server/base/src/main/java/org/apache/accumulo/server/client/BulkImporter.java b/server/base/src/main/java/org/apache/accumulo/server/client/BulkImporter.java index 33fbe82..747e224 100644 --- a/server/base/src/main/java/org/apache/accumulo/server/client/BulkImporter.java +++ b/server/base/src/main/java/org/apache/accumulo/server/client/BulkImporter.java @@ -700,15 +700,6 @@ public class BulkImporter { this.completeFailures = completeFailures; } - void tabletSplit(KeyExtent parent, Collection children) { - Integer count = getCount(parent); - - counts.remove(parent); - - for (KeyExtent keyExtent : children) - counts.put(keyExtent, count); - } - private Integer getCount(KeyExtent parent) { Integer count = counts.get(parent); http://git-wip-us.apache.org/repos/asf/accumulo/blob/a194c0b0/server/base/src/main/java/org/apache/accumulo/server/conf/NamespaceConfWatcher.java ---------------------------------------------------------------------- diff --git a/server/base/src/main/java/org/apache/accumulo/server/conf/NamespaceConfWatcher.java b/server/base/src/main/java/org/apache/accumulo/server/conf/NamespaceConfWatcher.java index 945e904..71cc0a2 100644 --- a/server/base/src/main/java/org/apache/accumulo/server/conf/NamespaceConfWatcher.java +++ b/server/base/src/main/java/org/apache/accumulo/server/conf/NamespaceConfWatcher.java @@ -43,10 +43,6 @@ class NamespaceConfWatcher implements Watcher { scf = new ServerConfigurationFactory(instance); } - void setServerConfigurationFactory(ServerConfigurationFactory scf) { - this.scf = scf; - } - static String toString(WatchedEvent event) { return new StringBuilder("{path=").append(event.getPath()).append(",state=").append(event.getState()).append(",type=").append(event.getType()).append("}") .toString(); http://git-wip-us.apache.org/repos/asf/accumulo/blob/a194c0b0/server/base/src/main/java/org/apache/accumulo/server/conf/TableConfWatcher.java ---------------------------------------------------------------------- diff --git a/server/base/src/main/java/org/apache/accumulo/server/conf/TableConfWatcher.java b/server/base/src/main/java/org/apache/accumulo/server/conf/TableConfWatcher.java index 3c8d45d..2c1c9a5 100644 --- a/server/base/src/main/java/org/apache/accumulo/server/conf/TableConfWatcher.java +++ b/server/base/src/main/java/org/apache/accumulo/server/conf/TableConfWatcher.java @@ -41,10 +41,6 @@ class TableConfWatcher implements Watcher { scf = new ServerConfigurationFactory(instance); } - void setServerConfigurationFactory(ServerConfigurationFactory scf) { - this.scf = scf; - } - static String toString(WatchedEvent event) { return new StringBuilder("{path=").append(event.getPath()).append(",state=").append(event.getState()).append(",type=").append(event.getType()).append("}") .toString(); http://git-wip-us.apache.org/repos/asf/accumulo/blob/a194c0b0/server/base/src/main/java/org/apache/accumulo/server/conf/TableParentConfiguration.java ---------------------------------------------------------------------- diff --git a/server/base/src/main/java/org/apache/accumulo/server/conf/TableParentConfiguration.java b/server/base/src/main/java/org/apache/accumulo/server/conf/TableParentConfiguration.java index bd2e5ab..26fee7c 100644 --- a/server/base/src/main/java/org/apache/accumulo/server/conf/TableParentConfiguration.java +++ b/server/base/src/main/java/org/apache/accumulo/server/conf/TableParentConfiguration.java @@ -27,22 +27,12 @@ public class TableParentConfiguration extends NamespaceConfiguration { private String tableId; - public TableParentConfiguration(String tableId, AccumuloConfiguration parent) { - super(null, parent); - this.tableId = tableId; - this.namespaceId = getNamespaceId(); - } - public TableParentConfiguration(String tableId, Instance inst, AccumuloConfiguration parent) { super(null, inst, parent); this.tableId = tableId; this.namespaceId = getNamespaceId(); } - String getTableId() { - return tableId; - } - @Override protected String getNamespaceId() { return Tables.getNamespaceId(inst, tableId); http://git-wip-us.apache.org/repos/asf/accumulo/blob/a194c0b0/server/base/src/main/java/org/apache/accumulo/server/conf/ZooConfigurationFactory.java ---------------------------------------------------------------------- diff --git a/server/base/src/main/java/org/apache/accumulo/server/conf/ZooConfigurationFactory.java b/server/base/src/main/java/org/apache/accumulo/server/conf/ZooConfigurationFactory.java index 4fbb645..6c8ceca 100644 --- a/server/base/src/main/java/org/apache/accumulo/server/conf/ZooConfigurationFactory.java +++ b/server/base/src/main/java/org/apache/accumulo/server/conf/ZooConfigurationFactory.java @@ -82,17 +82,6 @@ class ZooConfigurationFactory { } /** - * Gets a configuration object with the given parent. A default instance is used. Repeated calls will return the same object. - * - * @param parent - * parent configuration (required) - * @return configuration - */ - public ZooConfiguration getInstance(AccumuloConfiguration parent) { - return getInstance(null, parent); - } - - /** * Gets a configuration object for the given instance with the given parent. Repeated calls will return the same object. * * @param inst http://git-wip-us.apache.org/repos/asf/accumulo/blob/a194c0b0/server/base/src/main/java/org/apache/accumulo/server/log/SortedLogState.java ---------------------------------------------------------------------- diff --git a/server/base/src/main/java/org/apache/accumulo/server/log/SortedLogState.java b/server/base/src/main/java/org/apache/accumulo/server/log/SortedLogState.java index c0580ac..1ce4840 100644 --- a/server/base/src/main/java/org/apache/accumulo/server/log/SortedLogState.java +++ b/server/base/src/main/java/org/apache/accumulo/server/log/SortedLogState.java @@ -39,10 +39,6 @@ public enum SortedLogState { return FINISHED.getMarker().equals(fileName); } - public static boolean isFailed(String fileName) { - return FAILED.getMarker().equals(fileName); - } - public static Path getFinishedMarkerPath(String rootPath) { return new Path(rootPath, FINISHED.getMarker()); } @@ -55,10 +51,6 @@ public enum SortedLogState { return new Path(rootPath, FAILED.getMarker()); } - public static Path getFailedMarkerPath(Path rootPath) { - return new Path(rootPath, FAILED.getMarker()); - } - @Override public String toString() { return marker; http://git-wip-us.apache.org/repos/asf/accumulo/blob/a194c0b0/server/base/src/main/java/org/apache/accumulo/server/master/LiveTServerSet.java ---------------------------------------------------------------------- diff --git a/server/base/src/main/java/org/apache/accumulo/server/master/LiveTServerSet.java b/server/base/src/main/java/org/apache/accumulo/server/master/LiveTServerSet.java index 13cd0a1..cad9bb7 100644 --- a/server/base/src/main/java/org/apache/accumulo/server/master/LiveTServerSet.java +++ b/server/base/src/main/java/org/apache/accumulo/server/master/LiveTServerSet.java @@ -176,15 +176,6 @@ public class LiveTServerSet implements Watcher { } } - public void flushTablet(ZooLock lock, KeyExtent extent) throws TException { - TabletClientService.Client client = ThriftUtil.getClient(new TabletClientService.Client.Factory(), address, context); - try { - client.flushTablet(Tracer.traceInfo(), context.rpcCreds(), lockString(lock), extent.toThrift()); - } finally { - ThriftUtil.returnClient(client); - } - } - public void compact(ZooLock lock, String tableId, byte[] startRow, byte[] endRow) throws TException { TabletClientService.Client client = ThriftUtil.getClient(new TabletClientService.Client.Factory(), address, context); try { http://git-wip-us.apache.org/repos/asf/accumulo/blob/a194c0b0/server/base/src/main/java/org/apache/accumulo/server/master/state/DistributedStoreException.java ---------------------------------------------------------------------- diff --git a/server/base/src/main/java/org/apache/accumulo/server/master/state/DistributedStoreException.java b/server/base/src/main/java/org/apache/accumulo/server/master/state/DistributedStoreException.java index 3290075..85cddc1 100644 --- a/server/base/src/main/java/org/apache/accumulo/server/master/state/DistributedStoreException.java +++ b/server/base/src/main/java/org/apache/accumulo/server/master/state/DistributedStoreException.java @@ -28,7 +28,4 @@ public class DistributedStoreException extends Exception { super(cause); } - public DistributedStoreException(String why, Exception cause) { - super(why, cause); - } } http://git-wip-us.apache.org/repos/asf/accumulo/blob/a194c0b0/server/base/src/main/java/org/apache/accumulo/server/master/state/TServerInstance.java ---------------------------------------------------------------------- diff --git a/server/base/src/main/java/org/apache/accumulo/server/master/state/TServerInstance.java b/server/base/src/main/java/org/apache/accumulo/server/master/state/TServerInstance.java index c0c71e6..d2d4f44 100644 --- a/server/base/src/main/java/org/apache/accumulo/server/master/state/TServerInstance.java +++ b/server/base/src/main/java/org/apache/accumulo/server/master/state/TServerInstance.java @@ -112,10 +112,6 @@ public class TServerInstance implements Comparable, Serializabl return cachedStringRepresentation; } - public int port() { - return getLocation().getPort(); - } - public String host() { return getLocation().getHostText(); } http://git-wip-us.apache.org/repos/asf/accumulo/blob/a194c0b0/server/base/src/main/java/org/apache/accumulo/server/master/state/TabletServerState.java ---------------------------------------------------------------------- diff --git a/server/base/src/main/java/org/apache/accumulo/server/master/state/TabletServerState.java b/server/base/src/main/java/org/apache/accumulo/server/master/state/TabletServerState.java index dde9807..942eabf 100644 --- a/server/base/src/main/java/org/apache/accumulo/server/master/state/TabletServerState.java +++ b/server/base/src/main/java/org/apache/accumulo/server/master/state/TabletServerState.java @@ -16,10 +16,8 @@ */ package org.apache.accumulo.server.master.state; -import java.util.Collections; import java.util.HashMap; import java.util.HashSet; -import java.util.Set; public enum TabletServerState { // not a valid state, reserved for internal use only @@ -70,7 +68,4 @@ public enum TabletServerState { throw new IndexOutOfBoundsException("No such state"); } - public static Set getBadStates() { - return Collections.unmodifiableSet(badStates); - } } http://git-wip-us.apache.org/repos/asf/accumulo/blob/a194c0b0/server/base/src/main/java/org/apache/accumulo/server/metrics/AbstractMetricsImpl.java ---------------------------------------------------------------------- diff --git a/server/base/src/main/java/org/apache/accumulo/server/metrics/AbstractMetricsImpl.java b/server/base/src/main/java/org/apache/accumulo/server/metrics/AbstractMetricsImpl.java index 39d5602..42d2d00 100644 --- a/server/base/src/main/java/org/apache/accumulo/server/metrics/AbstractMetricsImpl.java +++ b/server/base/src/main/java/org/apache/accumulo/server/metrics/AbstractMetricsImpl.java @@ -148,10 +148,6 @@ public abstract class AbstractMetricsImpl implements Metrics { registry.put(name, new Metric()); } - public Metric getMetric(String name) { - return registry.get(name); - } - public long getMetricCount(String name) { return registry.get(name).getCount(); } http://git-wip-us.apache.org/repos/asf/accumulo/blob/a194c0b0/server/base/src/main/java/org/apache/accumulo/server/metrics/MetricsConfiguration.java ---------------------------------------------------------------------- diff --git a/server/base/src/main/java/org/apache/accumulo/server/metrics/MetricsConfiguration.java b/server/base/src/main/java/org/apache/accumulo/server/metrics/MetricsConfiguration.java index 8d11243..d772048 100644 --- a/server/base/src/main/java/org/apache/accumulo/server/metrics/MetricsConfiguration.java +++ b/server/base/src/main/java/org/apache/accumulo/server/metrics/MetricsConfiguration.java @@ -17,7 +17,6 @@ package org.apache.accumulo.server.metrics; import java.io.File; -import java.util.Iterator; import org.apache.accumulo.core.util.Daemon; import org.apache.commons.configuration.AbstractFileConfiguration; @@ -29,7 +28,6 @@ import org.apache.commons.configuration.XMLConfiguration; import org.apache.commons.configuration.event.ConfigurationEvent; import org.apache.commons.configuration.event.ConfigurationListener; import org.apache.commons.configuration.reloading.FileChangedReloadingStrategy; -import org.apache.commons.lang.builder.ToStringBuilder; public class MetricsConfiguration { @@ -210,26 +208,10 @@ public class MetricsConfiguration { return enabled; } - public static String toStringValue(Configuration config) { - ToStringBuilder tsb = new ToStringBuilder(MetricsConfiguration.class); - Iterator keys = config.getKeys(); - while (keys.hasNext()) { - tsb.append("\n"); - String k = (String) keys.next(); - Object v = config.getString(k); - if (null == v) - v = config.getList(k); - tsb.append(k, v.toString()); - } - return tsb.toString(); - } - public static void main(String[] args) throws Exception { MetricsConfiguration mc = new MetricsConfiguration("master"); while (true) { - // System.out.println(MetricsConfiguration.toStringValue(getSystemConfiguration())); System.out.println("------------------------------------------------------------------------------------------------"); - // System.out.println(MetricsConfiguration.toStringValue()); long t1 = System.currentTimeMillis(); System.out.println(mc.isEnabled() + " took: " + (System.currentTimeMillis() - t1)); Thread.sleep(1000); http://git-wip-us.apache.org/repos/asf/accumulo/blob/a194c0b0/server/base/src/main/java/org/apache/accumulo/server/replication/StatusFormatter.java ---------------------------------------------------------------------- diff --git a/server/base/src/main/java/org/apache/accumulo/server/replication/StatusFormatter.java b/server/base/src/main/java/org/apache/accumulo/server/replication/StatusFormatter.java index cee30bc..a674802 100644 --- a/server/base/src/main/java/org/apache/accumulo/server/replication/StatusFormatter.java +++ b/server/base/src/main/java/org/apache/accumulo/server/replication/StatusFormatter.java @@ -138,11 +138,6 @@ public class StatusFormatter implements Formatter { return appendBytes(sb, t.getBytes(), 0, t.getLength()); } - protected String getValue(Value v) { - StringBuilder sb = new StringBuilder(); - return appendBytes(sb, v.get(), 0, v.get().length).toString(); - } - protected StringBuilder appendBytes(StringBuilder sb, byte ba[], int offset, int len) { for (int i = 0; i < len; i++) { int c = 0xff & ba[offset + i]; http://git-wip-us.apache.org/repos/asf/accumulo/blob/a194c0b0/server/base/src/main/java/org/apache/accumulo/server/rpc/TBufferedServerSocket.java ---------------------------------------------------------------------- diff --git a/server/base/src/main/java/org/apache/accumulo/server/rpc/TBufferedServerSocket.java b/server/base/src/main/java/org/apache/accumulo/server/rpc/TBufferedServerSocket.java deleted file mode 100644 index 2887f48..0000000 --- a/server/base/src/main/java/org/apache/accumulo/server/rpc/TBufferedServerSocket.java +++ /dev/null @@ -1,71 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.apache.accumulo.server.rpc; - -import java.io.IOException; -import java.net.ServerSocket; - -import org.apache.accumulo.core.rpc.TBufferedSocket; -import org.apache.thrift.transport.TServerTransport; -import org.apache.thrift.transport.TSocket; -import org.apache.thrift.transport.TTransport; -import org.apache.thrift.transport.TTransportException; - -// Thrift-959 removed the small buffer from TSocket; this adds it back for servers -public class TBufferedServerSocket extends TServerTransport { - - // expose acceptImpl - static class TServerSocket extends org.apache.thrift.transport.TServerSocket { - public TServerSocket(ServerSocket serverSocket) { - super(serverSocket); - } - - public TSocket acceptImplPublic() throws TTransportException { - return acceptImpl(); - } - } - - final TServerSocket impl; - final int bufferSize; - - public TBufferedServerSocket(ServerSocket serverSocket, int bufferSize) { - this.impl = new TServerSocket(serverSocket); - this.bufferSize = bufferSize; - } - - @Override - public void listen() throws TTransportException { - impl.listen(); - } - - @Override - public void close() { - impl.close(); - } - - // Wrap accepted sockets using buffered IO - @Override - protected TTransport acceptImpl() throws TTransportException { - TSocket sock = impl.acceptImplPublic(); - try { - return new TBufferedSocket(sock, this.bufferSize); - } catch (IOException e) { - throw new TTransportException(e); - } - } - -} http://git-wip-us.apache.org/repos/asf/accumulo/blob/a194c0b0/server/base/src/main/java/org/apache/accumulo/server/rpc/TNonblockingServerSocket.java ---------------------------------------------------------------------- diff --git a/server/base/src/main/java/org/apache/accumulo/server/rpc/TNonblockingServerSocket.java b/server/base/src/main/java/org/apache/accumulo/server/rpc/TNonblockingServerSocket.java index c0bcdb7..a6dc6ab 100644 --- a/server/base/src/main/java/org/apache/accumulo/server/rpc/TNonblockingServerSocket.java +++ b/server/base/src/main/java/org/apache/accumulo/server/rpc/TNonblockingServerSocket.java @@ -62,13 +62,6 @@ public class TNonblockingServerSocket extends TNonblockingServerTransport { /** * Creates just a port listening server socket */ - public TNonblockingServerSocket(int port) throws TTransportException { - this(port, 0); - } - - /** - * Creates just a port listening server socket - */ public TNonblockingServerSocket(int port, int clientTimeout) throws TTransportException { this(new InetSocketAddress(port), clientTimeout); } http://git-wip-us.apache.org/repos/asf/accumulo/blob/a194c0b0/server/base/src/main/java/org/apache/accumulo/server/security/SecurityOperation.java ---------------------------------------------------------------------- diff --git a/server/base/src/main/java/org/apache/accumulo/server/security/SecurityOperation.java b/server/base/src/main/java/org/apache/accumulo/server/security/SecurityOperation.java index f08742d..d7bee31 100644 --- a/server/base/src/main/java/org/apache/accumulo/server/security/SecurityOperation.java +++ b/server/base/src/main/java/org/apache/accumulo/server/security/SecurityOperation.java @@ -79,10 +79,6 @@ public class SecurityOperation { static SecurityOperation instance; - public static synchronized SecurityOperation getInstance(AccumuloServerContext context) { - return getInstance(context, false); - } - public static synchronized SecurityOperation getInstance(AccumuloServerContext context, boolean initialize) { if (instance == null) { String instanceId = context.getInstance().getInstanceID(); http://git-wip-us.apache.org/repos/asf/accumulo/blob/a194c0b0/server/base/src/main/java/org/apache/accumulo/server/security/handler/KerberosAuthorizor.java ---------------------------------------------------------------------- diff --git a/server/base/src/main/java/org/apache/accumulo/server/security/handler/KerberosAuthorizor.java b/server/base/src/main/java/org/apache/accumulo/server/security/handler/KerberosAuthorizor.java index b047f1a..bd48440 100644 --- a/server/base/src/main/java/org/apache/accumulo/server/security/handler/KerberosAuthorizor.java +++ b/server/base/src/main/java/org/apache/accumulo/server/security/handler/KerberosAuthorizor.java @@ -32,14 +32,6 @@ import org.apache.accumulo.core.util.Base64; */ public class KerberosAuthorizor implements Authorizor { - private static KerberosAuthorizor INST; - - public static synchronized KerberosAuthorizor getInstance() { - if (INST == null) - INST = new KerberosAuthorizor(); - return INST; - } - private final ZKAuthorizor zkAuthorizor; public KerberosAuthorizor() { http://git-wip-us.apache.org/repos/asf/accumulo/blob/a194c0b0/server/base/src/main/java/org/apache/accumulo/server/security/handler/KerberosPermissionHandler.java ---------------------------------------------------------------------- diff --git a/server/base/src/main/java/org/apache/accumulo/server/security/handler/KerberosPermissionHandler.java b/server/base/src/main/java/org/apache/accumulo/server/security/handler/KerberosPermissionHandler.java index 691c555..7de48a6 100644 --- a/server/base/src/main/java/org/apache/accumulo/server/security/handler/KerberosPermissionHandler.java +++ b/server/base/src/main/java/org/apache/accumulo/server/security/handler/KerberosPermissionHandler.java @@ -33,14 +33,6 @@ import org.apache.accumulo.core.util.Base64; */ public class KerberosPermissionHandler implements PermissionHandler { - private static KerberosPermissionHandler INST; - - public static synchronized KerberosPermissionHandler getInstance() { - if (INST == null) - INST = new KerberosPermissionHandler(); - return INST; - } - private final ZKPermHandler zkPermissionHandler; public KerberosPermissionHandler() { http://git-wip-us.apache.org/repos/asf/accumulo/blob/a194c0b0/server/base/src/main/java/org/apache/accumulo/server/tables/TableManager.java ---------------------------------------------------------------------- diff --git a/server/base/src/main/java/org/apache/accumulo/server/tables/TableManager.java b/server/base/src/main/java/org/apache/accumulo/server/tables/TableManager.java index 293aaf8..0b23061 100644 --- a/server/base/src/main/java/org/apache/accumulo/server/tables/TableManager.java +++ b/server/base/src/main/java/org/apache/accumulo/server/tables/TableManager.java @@ -239,10 +239,6 @@ public class TableManager { } } - public boolean removeObserver(TableObserver to) { - return observers.remove(to); - } - private class TableStateWatcher implements Watcher { @Override public void process(WatchedEvent event) { http://git-wip-us.apache.org/repos/asf/accumulo/blob/a194c0b0/server/base/src/main/java/org/apache/accumulo/server/util/AccumuloStatus.java ---------------------------------------------------------------------- diff --git a/server/base/src/main/java/org/apache/accumulo/server/util/AccumuloStatus.java b/server/base/src/main/java/org/apache/accumulo/server/util/AccumuloStatus.java index 1e75124..5d95d68 100644 --- a/server/base/src/main/java/org/apache/accumulo/server/util/AccumuloStatus.java +++ b/server/base/src/main/java/org/apache/accumulo/server/util/AccumuloStatus.java @@ -19,9 +19,7 @@ package org.apache.accumulo.server.util; import java.io.IOException; import org.apache.accumulo.core.Constants; -import org.apache.accumulo.core.zookeeper.ZooUtil; import org.apache.accumulo.fate.zookeeper.IZooReader; -import org.apache.accumulo.server.client.HdfsZooInstance; import org.apache.zookeeper.KeeperException; public class AccumuloStatus { @@ -32,18 +30,6 @@ public class AccumuloStatus { * @throws IOException * if there are issues connecting to ZooKeeper to determine service status */ - public static boolean isAccumuloOffline(IZooReader reader) throws IOException { - String rootPath = ZooUtil.getRoot(HdfsZooInstance.getInstance()); - return isAccumuloOffline(reader, rootPath); - } - - /** - * Determines if there could be an accumulo instance running via zookeeper lock checking - * - * @return true iff all servers show no indication of being registered in zookeeper, otherwise false - * @throws IOException - * if there are issues connecting to ZooKeeper to determine service status - */ public static boolean isAccumuloOffline(IZooReader reader, String rootPath) throws IOException { try { for (String child : reader.getChildren(rootPath + Constants.ZTSERVERS)) { http://git-wip-us.apache.org/repos/asf/accumulo/blob/a194c0b0/server/base/src/main/java/org/apache/accumulo/server/util/CleanZookeeper.java ---------------------------------------------------------------------- diff --git a/server/base/src/main/java/org/apache/accumulo/server/util/CleanZookeeper.java b/server/base/src/main/java/org/apache/accumulo/server/util/CleanZookeeper.java index afe7f6f..b3ca6dd 100644 --- a/server/base/src/main/java/org/apache/accumulo/server/util/CleanZookeeper.java +++ b/server/base/src/main/java/org/apache/accumulo/server/util/CleanZookeeper.java @@ -37,9 +37,6 @@ public class CleanZookeeper { private static final Logger log = LoggerFactory.getLogger(CleanZookeeper.class); static class Opts extends Help { - @Parameter(names = {"-z", "--keepers"}, - description = "Comma-separated list of zookeeper hosts, if different than instance.zookeeper.host in accumulo-site.xml") - String keepers = "localhost:2181"; @Parameter(names = {"--password"}, description = "The system secret, if different than instance.secret in accumulo-site.xml", password = true) String auth; }