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 2924B10C35 for ; Fri, 14 Jun 2013 21:19:55 +0000 (UTC) Received: (qmail 40247 invoked by uid 500); 14 Jun 2013 21:19:54 -0000 Delivered-To: apmail-accumulo-commits-archive@accumulo.apache.org Received: (qmail 40222 invoked by uid 500); 14 Jun 2013 21:19: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 40208 invoked by uid 99); 14 Jun 2013 21:19:54 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 14 Jun 2013 21:19:54 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 14 Jun 2013 21:19:49 +0000 Received: from eris.apache.org (localhost [127.0.0.1]) by eris.apache.org (Postfix) with ESMTP id 4BB8823888D2; Fri, 14 Jun 2013 21:19:30 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1493250 [1/3] - in /accumulo/trunk: core/src/main/java/org/apache/accumulo/core/ core/src/main/java/org/apache/accumulo/core/cli/ core/src/main/java/org/apache/accumulo/core/client/admin/ core/src/main/java/org/apache/accumulo/core/client/... Date: Fri, 14 Jun 2013 21:19:25 -0000 To: commits@accumulo.apache.org From: ctubbsii@apache.org X-Mailer: svnmailer-1.0.8-patched Message-Id: <20130614211930.4BB8823888D2@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: ctubbsii Date: Fri Jun 14 21:19:23 2013 New Revision: 1493250 URL: http://svn.apache.org/r1493250 Log: ACCUMULO-1516 deprecate Constants.NO_AUTHS in favor of Authorizations.EMPTY; update usage throughout code, cleaning up some unnecessary javadoc/non-javadoc comments along the way Modified: accumulo/trunk/core/src/main/java/org/apache/accumulo/core/Constants.java accumulo/trunk/core/src/main/java/org/apache/accumulo/core/cli/ClientOpts.java accumulo/trunk/core/src/main/java/org/apache/accumulo/core/client/admin/InstanceOperationsImpl.java accumulo/trunk/core/src/main/java/org/apache/accumulo/core/client/impl/MetadataLocationObtainer.java accumulo/trunk/core/src/main/java/org/apache/accumulo/core/client/impl/OfflineScanner.java accumulo/trunk/core/src/main/java/org/apache/accumulo/core/client/impl/TabletServerBatchReader.java accumulo/trunk/core/src/main/java/org/apache/accumulo/core/client/impl/TabletServerBatchReaderIterator.java accumulo/trunk/core/src/main/java/org/apache/accumulo/core/client/mapred/InputFormatBase.java accumulo/trunk/core/src/main/java/org/apache/accumulo/core/client/mapreduce/InputFormatBase.java accumulo/trunk/core/src/main/java/org/apache/accumulo/core/client/mapreduce/lib/util/InputConfigurator.java accumulo/trunk/core/src/main/java/org/apache/accumulo/core/client/mock/MockAccumulo.java accumulo/trunk/core/src/main/java/org/apache/accumulo/core/client/mock/MockInstanceOperations.java accumulo/trunk/core/src/main/java/org/apache/accumulo/core/security/Authorizations.java accumulo/trunk/core/src/main/java/org/apache/accumulo/core/util/Merge.java accumulo/trunk/core/src/main/java/org/apache/accumulo/core/util/MetadataTable.java accumulo/trunk/core/src/main/java/org/apache/accumulo/core/util/TableDiskUsage.java accumulo/trunk/core/src/main/java/org/apache/accumulo/core/util/shell/commands/GetSplitsCommand.java accumulo/trunk/core/src/main/java/org/apache/accumulo/core/util/shell/commands/ScanCommand.java accumulo/trunk/core/src/test/java/org/apache/accumulo/core/cli/TestClientOpts.java accumulo/trunk/core/src/test/java/org/apache/accumulo/core/client/admin/FindMaxTest.java accumulo/trunk/core/src/test/java/org/apache/accumulo/core/client/mock/MockConnectorTest.java accumulo/trunk/core/src/test/java/org/apache/accumulo/core/client/mock/MockTableOperationsTest.java accumulo/trunk/core/src/test/java/org/apache/accumulo/core/client/mock/TestBatchScanner821.java accumulo/trunk/core/src/test/java/org/apache/accumulo/core/iterators/user/IntersectingIteratorTest.java accumulo/trunk/core/src/test/java/org/apache/accumulo/core/iterators/user/RowFilterTest.java accumulo/trunk/core/src/test/java/org/apache/accumulo/core/util/shell/command/FormatterCommandTest.java accumulo/trunk/examples/simple/src/main/java/org/apache/accumulo/examples/simple/client/RowOperations.java accumulo/trunk/server/src/main/java/org/apache/accumulo/server/gc/SimpleGarbageCollector.java accumulo/trunk/server/src/main/java/org/apache/accumulo/server/master/Master.java accumulo/trunk/server/src/main/java/org/apache/accumulo/server/master/balancer/ChaoticLoadBalancer.java accumulo/trunk/server/src/main/java/org/apache/accumulo/server/master/state/MergeStats.java accumulo/trunk/server/src/main/java/org/apache/accumulo/server/master/state/MetaDataTableScanner.java accumulo/trunk/server/src/main/java/org/apache/accumulo/server/master/tableOps/BulkImport.java accumulo/trunk/server/src/main/java/org/apache/accumulo/server/master/tableOps/CompactRange.java accumulo/trunk/server/src/main/java/org/apache/accumulo/server/master/tableOps/DeleteTable.java accumulo/trunk/server/src/main/java/org/apache/accumulo/server/master/tableOps/ExportTable.java accumulo/trunk/server/src/main/java/org/apache/accumulo/server/master/tableOps/TraceRepo.java accumulo/trunk/server/src/main/java/org/apache/accumulo/server/problems/ProblemReports.java accumulo/trunk/server/src/main/java/org/apache/accumulo/server/security/SecurityOperation.java accumulo/trunk/server/src/main/java/org/apache/accumulo/server/security/handler/InsecurePermHandler.java accumulo/trunk/server/src/main/java/org/apache/accumulo/server/security/handler/ZKAuthorizor.java accumulo/trunk/server/src/main/java/org/apache/accumulo/server/tabletserver/Tablet.java accumulo/trunk/server/src/main/java/org/apache/accumulo/server/tabletserver/TabletServer.java accumulo/trunk/server/src/main/java/org/apache/accumulo/server/tabletserver/log/DfsLogger.java accumulo/trunk/server/src/main/java/org/apache/accumulo/server/util/AddFilesWithMissingEntries.java accumulo/trunk/server/src/main/java/org/apache/accumulo/server/util/CheckForMetadataProblems.java accumulo/trunk/server/src/main/java/org/apache/accumulo/server/util/LocalityCheck.java accumulo/trunk/server/src/main/java/org/apache/accumulo/server/util/MetadataTable.java accumulo/trunk/server/src/main/java/org/apache/accumulo/server/util/OfflineMetadataScanner.java accumulo/trunk/server/src/main/java/org/apache/accumulo/server/util/VerifyTabletAssignments.java accumulo/trunk/server/src/test/java/org/apache/accumulo/server/gc/TestConfirmDeletes.java accumulo/trunk/server/src/test/java/org/apache/accumulo/server/master/TestMergeState.java accumulo/trunk/server/src/test/java/org/apache/accumulo/server/util/CloneTest.java accumulo/trunk/server/src/test/java/org/apache/accumulo/server/util/TabletIteratorTest.java accumulo/trunk/test/src/main/java/org/apache/accumulo/test/QueryMetadataTable.java accumulo/trunk/test/src/main/java/org/apache/accumulo/test/continuous/ContinuousWalk.java accumulo/trunk/test/src/main/java/org/apache/accumulo/test/functional/AddSplitTest.java accumulo/trunk/test/src/main/java/org/apache/accumulo/test/functional/BadIteratorMincTest.java accumulo/trunk/test/src/main/java/org/apache/accumulo/test/functional/BatchScanSplitTest.java accumulo/trunk/test/src/main/java/org/apache/accumulo/test/functional/BatchWriterFlushTest.java accumulo/trunk/test/src/main/java/org/apache/accumulo/test/functional/BloomFilterTest.java accumulo/trunk/test/src/main/java/org/apache/accumulo/test/functional/BulkFileTest.java accumulo/trunk/test/src/main/java/org/apache/accumulo/test/functional/ConcurrencyTest.java accumulo/trunk/test/src/main/java/org/apache/accumulo/test/functional/ConstraintTest.java accumulo/trunk/test/src/main/java/org/apache/accumulo/test/functional/CreateAndUseTest.java accumulo/trunk/test/src/main/java/org/apache/accumulo/test/functional/CreateManyScannersTest.java accumulo/trunk/test/src/main/java/org/apache/accumulo/test/functional/DeleteEverythingTest.java accumulo/trunk/test/src/main/java/org/apache/accumulo/test/functional/DeleteRowsSplitTest.java accumulo/trunk/test/src/main/java/org/apache/accumulo/test/functional/DeleteRowsTest.java accumulo/trunk/test/src/main/java/org/apache/accumulo/test/functional/FunctionalTest.java accumulo/trunk/test/src/main/java/org/apache/accumulo/test/functional/LargeRowTest.java accumulo/trunk/test/src/main/java/org/apache/accumulo/test/functional/LogicalTimeTest.java accumulo/trunk/test/src/main/java/org/apache/accumulo/test/functional/MergeTest.java accumulo/trunk/test/src/main/java/org/apache/accumulo/test/functional/PermissionsTest.java accumulo/trunk/test/src/main/java/org/apache/accumulo/test/functional/RowDeleteTest.java accumulo/trunk/test/src/main/java/org/apache/accumulo/test/functional/ScanRangeTest.java accumulo/trunk/test/src/main/java/org/apache/accumulo/test/functional/ServerSideErrorTest.java accumulo/trunk/test/src/main/java/org/apache/accumulo/test/functional/SparseColumnFamilyTest.java accumulo/trunk/test/src/main/java/org/apache/accumulo/test/functional/SplitRecoveryTest.java accumulo/trunk/test/src/main/java/org/apache/accumulo/test/functional/TimeoutTest.java accumulo/trunk/test/src/main/java/org/apache/accumulo/test/performance/metadata/MetadataBatchScanTest.java accumulo/trunk/test/src/main/java/org/apache/accumulo/test/performance/thrift/NullTserver.java accumulo/trunk/test/src/main/java/org/apache/accumulo/test/randomwalk/concurrent/BatchScan.java accumulo/trunk/test/src/main/java/org/apache/accumulo/test/randomwalk/concurrent/CheckBalance.java accumulo/trunk/test/src/main/java/org/apache/accumulo/test/randomwalk/concurrent/IsolatedScan.java accumulo/trunk/test/src/main/java/org/apache/accumulo/test/randomwalk/concurrent/ScanTable.java accumulo/trunk/test/src/main/java/org/apache/accumulo/test/randomwalk/image/ScanMeta.java accumulo/trunk/test/src/main/java/org/apache/accumulo/test/randomwalk/multitable/CopyTool.java accumulo/trunk/test/src/main/java/org/apache/accumulo/test/randomwalk/sequential/MapRedVerify.java accumulo/trunk/test/src/main/java/org/apache/accumulo/test/randomwalk/shard/DeleteSomeDocs.java accumulo/trunk/test/src/main/java/org/apache/accumulo/test/randomwalk/shard/DeleteWord.java accumulo/trunk/test/src/main/java/org/apache/accumulo/test/randomwalk/shard/Grep.java accumulo/trunk/test/src/main/java/org/apache/accumulo/test/randomwalk/shard/Reindex.java accumulo/trunk/test/src/main/java/org/apache/accumulo/test/randomwalk/shard/Search.java accumulo/trunk/test/src/main/java/org/apache/accumulo/test/randomwalk/shard/VerifyIndex.java accumulo/trunk/test/src/test/java/org/apache/accumulo/test/ShellServerTest.java accumulo/trunk/test/src/test/java/org/apache/accumulo/test/TestAccumuloSplitRecovery.java accumulo/trunk/test/src/test/java/org/apache/accumulo/test/iterator/RegExTest.java accumulo/trunk/trace/src/main/java/org/apache/accumulo/trace/instrument/receivers/ZooSpanClient.java Modified: accumulo/trunk/core/src/main/java/org/apache/accumulo/core/Constants.java URL: http://svn.apache.org/viewvc/accumulo/trunk/core/src/main/java/org/apache/accumulo/core/Constants.java?rev=1493250&r1=1493249&r2=1493250&view=diff ============================================================================== --- accumulo/trunk/core/src/main/java/org/apache/accumulo/core/Constants.java (original) +++ accumulo/trunk/core/src/main/java/org/apache/accumulo/core/Constants.java Fri Jun 14 21:19:23 2013 @@ -99,7 +99,8 @@ public class Constants { public static final String METADATA_DELETE_FLAG_PREFIX = "~del"; public static final String METADATA_DELETE_FLAG_FOR_METADATA_PREFIX = "!!" + METADATA_DELETE_FLAG_PREFIX; public static final Range METADATA_DELETES_KEYSPACE = new Range(new Key(new Text(METADATA_DELETE_FLAG_PREFIX)), true, new Key(new Text("~dem")), false); - public static final Range METADATA_DELETES_FOR_METADATA_KEYSPACE = new Range(new Key(new Text(METADATA_DELETE_FLAG_FOR_METADATA_PREFIX)), true, new Key(new Text("!!~dem")), false); + public static final Range METADATA_DELETES_FOR_METADATA_KEYSPACE = new Range(new Key(new Text(METADATA_DELETE_FLAG_FOR_METADATA_PREFIX)), true, new Key( + new Text("!!~dem")), false); public static final String METADATA_BLIP_FLAG_PREFIX = "~blip"; // BLIP = bulk load in progress public static final Range METADATA_BLIP_KEYSPACE = new Range(new Key(new Text(METADATA_BLIP_FLAG_PREFIX)), true, new Key(new Text("~bliq")), false); @@ -154,9 +155,11 @@ public class Constants { // Security configuration public static final String PW_HASH_ALGORITHM = "SHA-256"; - // Representation of an empty set of authorizations - // (used throughout the code, because scans of metadata table and many tests do not set record-level visibility) - public static final Authorizations NO_AUTHS = new Authorizations(); + /** + * @deprecated since 1.6.0; Use {@link Authorizations#EMPTY} instead + */ + @Deprecated + public static final Authorizations NO_AUTHS = Authorizations.EMPTY; public static final int DEFAULT_MINOR_COMPACTION_MAX_SLEEP_TIME = 60 * 3; // in seconds @@ -197,7 +200,6 @@ public class Constants { public static String getRootTabletDir(final AccumuloConfiguration conf) { return getMetadataTableDir(conf) + ZROOT_TABLET; } - /** * @param conf @@ -206,6 +208,6 @@ public class Constants { public static String getWalDirectory(final AccumuloConfiguration conf) { return getBaseDir(conf) + "/wal"; } - - public static final String AUDITLOG = "Audit"; + + public static final String AUDITLOG = "Audit"; } Modified: accumulo/trunk/core/src/main/java/org/apache/accumulo/core/cli/ClientOpts.java URL: http://svn.apache.org/viewvc/accumulo/trunk/core/src/main/java/org/apache/accumulo/core/cli/ClientOpts.java?rev=1493250&r1=1493249&r2=1493250&view=diff ============================================================================== --- accumulo/trunk/core/src/main/java/org/apache/accumulo/core/cli/ClientOpts.java (original) +++ accumulo/trunk/core/src/main/java/org/apache/accumulo/core/cli/ClientOpts.java Fri Jun 14 21:19:23 2013 @@ -114,12 +114,11 @@ public class ClientOpts extends Help { @Parameter(names = {"-tc", "--tokenClass"}, description = "Token class") public String tokenClassName = PasswordToken.class.getName(); - + @DynamicParameter(names = "-l", description = "login properties in the format key=value. Reuse -l for each property (prompt for properties if this option is missing") public Map loginProps = new LinkedHashMap(); - public AuthenticationToken getToken() { if (!loginProps.isEmpty()) { Properties props = new Properties(); @@ -133,7 +132,7 @@ public class ClientOpts extends Help { } catch (Exception e) { throw new RuntimeException(e); } - + } if (securePassword != null) @@ -152,7 +151,7 @@ public class ClientOpts extends Help { public String instance = null; @Parameter(names = {"-auths", "--auths"}, converter = AuthConverter.class, description = "the authorizations to use when reading or writing") - public Authorizations auths = Constants.NO_AUTHS; + public Authorizations auths = Authorizations.EMPTY; @Parameter(names = "--debug", description = "turn on TRACE-level log messages") public boolean debug = false; Modified: accumulo/trunk/core/src/main/java/org/apache/accumulo/core/client/admin/InstanceOperationsImpl.java URL: http://svn.apache.org/viewvc/accumulo/trunk/core/src/main/java/org/apache/accumulo/core/client/admin/InstanceOperationsImpl.java?rev=1493250&r1=1493249&r2=1493250&view=diff ============================================================================== --- accumulo/trunk/core/src/main/java/org/apache/accumulo/core/client/admin/InstanceOperationsImpl.java (original) +++ accumulo/trunk/core/src/main/java/org/apache/accumulo/core/client/admin/InstanceOperationsImpl.java Fri Jun 14 21:19:23 2013 @@ -66,11 +66,6 @@ public class InstanceOperationsImpl impl this.credentials = credentials; } - /* - * (non-Javadoc) - * - * @see org.apache.accumulo.core.client.admin.InstanceOperations#setProperty(java.lang.String, java.lang.String) - */ @Override public void setProperty(final String property, final String value) throws AccumuloException, AccumuloSecurityException { ArgumentChecker.notNull(property, value); @@ -82,11 +77,6 @@ public class InstanceOperationsImpl impl }); } - /* - * (non-Javadoc) - * - * @see org.apache.accumulo.core.client.admin.InstanceOperations#removeProperty(java.lang.String) - */ @Override public void removeProperty(final String property) throws AccumuloException, AccumuloSecurityException { ArgumentChecker.notNull(property); @@ -98,11 +88,6 @@ public class InstanceOperationsImpl impl }); } - /* - * (non-Javadoc) - * - * @see org.apache.accumulo.core.client.admin.InstanceOperations#getSystemConfiguration() - */ @Override public Map getSystemConfiguration() throws AccumuloException, AccumuloSecurityException { return ServerClient.execute(instance, new ClientExecReturn,ClientService.Client>() { @@ -113,11 +98,6 @@ public class InstanceOperationsImpl impl }); } - /* - * (non-Javadoc) - * - * @see org.apache.accumulo.core.client.admin.InstanceOperations#getSiteConfiguration() - */ @Override public Map getSiteConfiguration() throws AccumuloException, AccumuloSecurityException { return ServerClient.execute(instance, new ClientExecReturn,ClientService.Client>() { @@ -128,12 +108,6 @@ public class InstanceOperationsImpl impl }); } - /* - * (non-Javadoc) - * - * @see org.apache.accumulo.core.client.admin.InstanceOperations#getTabletServers() - */ - @Override public List getTabletServers() { ZooCache cache = ZooCache.getInstance(instance.getZooKeepers(), instance.getZooKeepersSessionTimeOut()); @@ -153,12 +127,6 @@ public class InstanceOperationsImpl impl return results; } - /* - * (non-Javadoc) - * - * @see org.apache.accumulo.core.client.admin.InstanceOperations#getActiveScans(java.lang.String) - */ - @Override public List getActiveScans(String tserver) throws AccumuloException, AccumuloSecurityException { Client client = null; @@ -186,11 +154,6 @@ public class InstanceOperationsImpl impl } } - /* - * (non-Javadoc) - * - * @see org.apache.accumulo.core.client.admin.InstanceOperations#testClassLoad(java.lang.String, java.lang.String) - */ @Override public boolean testClassLoad(final String className, final String asTypeName) throws AccumuloException, AccumuloSecurityException { return ServerClient.execute(instance, new ClientExecReturn() { @@ -201,11 +164,6 @@ public class InstanceOperationsImpl impl }); } - /* - * (non-Javadoc) - * - * @see org.apache.accumulo.core.client.admin.InstanceOperations#getActiveCompactions(java.lang.String) - */ @Override public List getActiveCompactions(String tserver) throws AccumuloException, AccumuloSecurityException { Client client = null; @@ -229,11 +187,6 @@ public class InstanceOperationsImpl impl } } - /* - * (non-Javadoc) - * - * @see org.apache.accumulo.core.client.admin.InstanceOperations#ping(java.lang.String) - */ @Override public void ping(String tserver) throws AccumuloException { TTransport transport = null; Modified: accumulo/trunk/core/src/main/java/org/apache/accumulo/core/client/impl/MetadataLocationObtainer.java URL: http://svn.apache.org/viewvc/accumulo/trunk/core/src/main/java/org/apache/accumulo/core/client/impl/MetadataLocationObtainer.java?rev=1493250&r1=1493249&r2=1493250&view=diff ============================================================================== --- accumulo/trunk/core/src/main/java/org/apache/accumulo/core/client/impl/MetadataLocationObtainer.java (original) +++ accumulo/trunk/core/src/main/java/org/apache/accumulo/core/client/impl/MetadataLocationObtainer.java Fri Jun 14 21:19:23 2013 @@ -44,6 +44,7 @@ import org.apache.accumulo.core.data.Ran import org.apache.accumulo.core.data.Value; import org.apache.accumulo.core.data.thrift.IterInfo; import org.apache.accumulo.core.iterators.user.WholeRowIterator; +import org.apache.accumulo.core.security.Authorizations; import org.apache.accumulo.core.security.thrift.TCredentials; import org.apache.accumulo.core.tabletserver.thrift.NotServingTabletException; import org.apache.accumulo.core.util.MetadataTable; @@ -94,7 +95,7 @@ public class MetadataLocationObtainer im Map> serverSideIteratorOptions = Collections.emptyMap(); boolean more = ThriftScanner.getBatchFromServer(credentials, range, src.tablet_extent, src.tablet_location, encodedResults, locCols, - serverSideIteratorList, serverSideIteratorOptions, Constants.SCAN_BATCH_SIZE, Constants.NO_AUTHS, false, instance.getConfiguration()); + serverSideIteratorList, serverSideIteratorOptions, Constants.SCAN_BATCH_SIZE, Authorizations.EMPTY, false, instance.getConfiguration()); decodeRows(encodedResults, results); @@ -102,7 +103,7 @@ public class MetadataLocationObtainer im range = new Range(results.lastKey().followingKey(PartialKey.ROW_COLFAM_COLQUAL_COLVIS_TIME), true, new Key(stopRow).followingKey(PartialKey.ROW), false); encodedResults.clear(); more = ThriftScanner.getBatchFromServer(credentials, range, src.tablet_extent, src.tablet_location, encodedResults, locCols, serverSideIteratorList, - serverSideIteratorOptions, Constants.SCAN_BATCH_SIZE, Constants.NO_AUTHS, false, instance.getConfiguration()); + serverSideIteratorOptions, Constants.SCAN_BATCH_SIZE, Authorizations.EMPTY, false, instance.getConfiguration()); decodeRows(encodedResults, results); } @@ -178,7 +179,7 @@ public class MetadataLocationObtainer im Map> unscanned = new HashMap>(); Map> failures = new HashMap>(); try { - TabletServerBatchReaderIterator.doLookup(tserver, tabletsRanges, failures, unscanned, rr, columns, credentials, opts, Constants.NO_AUTHS, + TabletServerBatchReaderIterator.doLookup(tserver, tabletsRanges, failures, unscanned, rr, columns, credentials, opts, Authorizations.EMPTY, instance.getConfiguration()); if (failures.size() > 0) { // invalidate extents in parents cache Modified: accumulo/trunk/core/src/main/java/org/apache/accumulo/core/client/impl/OfflineScanner.java URL: http://svn.apache.org/viewvc/accumulo/trunk/core/src/main/java/org/apache/accumulo/core/client/impl/OfflineScanner.java?rev=1493250&r1=1493249&r2=1493250&view=diff ============================================================================== --- accumulo/trunk/core/src/main/java/org/apache/accumulo/core/client/impl/OfflineScanner.java (original) +++ accumulo/trunk/core/src/main/java/org/apache/accumulo/core/client/impl/OfflineScanner.java Fri Jun 14 21:19:23 2013 @@ -246,7 +246,7 @@ class OfflineIterator implements Iterato } private Pair getTabletFiles(Range nextRange, List relFiles) throws TableNotFoundException { - Scanner scanner = conn.createScanner(Constants.METADATA_TABLE_NAME, Constants.NO_AUTHS); + Scanner scanner = conn.createScanner(Constants.METADATA_TABLE_NAME, Authorizations.EMPTY); scanner.setBatchSize(100); scanner.setRange(nextRange); Modified: accumulo/trunk/core/src/main/java/org/apache/accumulo/core/client/impl/TabletServerBatchReader.java URL: http://svn.apache.org/viewvc/accumulo/trunk/core/src/main/java/org/apache/accumulo/core/client/impl/TabletServerBatchReader.java?rev=1493250&r1=1493249&r2=1493250&view=diff ============================================================================== --- accumulo/trunk/core/src/main/java/org/apache/accumulo/core/client/impl/TabletServerBatchReader.java (original) +++ accumulo/trunk/core/src/main/java/org/apache/accumulo/core/client/impl/TabletServerBatchReader.java Fri Jun 14 21:19:23 2013 @@ -22,7 +22,6 @@ import java.util.Iterator; import java.util.Map.Entry; import java.util.concurrent.ExecutorService; -import org.apache.accumulo.core.Constants; import org.apache.accumulo.core.client.BatchScanner; import org.apache.accumulo.core.client.Instance; import org.apache.accumulo.core.data.Key; @@ -45,7 +44,7 @@ public class TabletServerBatchReader ext private ArrayList ranges; private TCredentials credentials; - private Authorizations authorizations = Constants.NO_AUTHS; + private Authorizations authorizations = Authorizations.EMPTY; private static int nextBatchReaderInstance = 1; Modified: accumulo/trunk/core/src/main/java/org/apache/accumulo/core/client/impl/TabletServerBatchReaderIterator.java URL: http://svn.apache.org/viewvc/accumulo/trunk/core/src/main/java/org/apache/accumulo/core/client/impl/TabletServerBatchReaderIterator.java?rev=1493250&r1=1493249&r2=1493250&view=diff ============================================================================== --- accumulo/trunk/core/src/main/java/org/apache/accumulo/core/client/impl/TabletServerBatchReaderIterator.java (original) +++ accumulo/trunk/core/src/main/java/org/apache/accumulo/core/client/impl/TabletServerBatchReaderIterator.java Fri Jun 14 21:19:23 2013 @@ -34,9 +34,6 @@ import java.util.concurrent.ExecutorServ import java.util.concurrent.Semaphore; import java.util.concurrent.TimeUnit; -import org.apache.accumulo.trace.instrument.TraceRunnable; -import org.apache.accumulo.trace.instrument.Tracer; -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.Instance; @@ -66,6 +63,8 @@ import org.apache.accumulo.core.util.Byt import org.apache.accumulo.core.util.OpTimer; import org.apache.accumulo.core.util.ThriftUtil; import org.apache.accumulo.core.util.UtilWaitThread; +import org.apache.accumulo.trace.instrument.TraceRunnable; +import org.apache.accumulo.trace.instrument.Tracer; import org.apache.hadoop.io.Text; import org.apache.log4j.Level; import org.apache.log4j.Logger; @@ -81,7 +80,7 @@ public class TabletServerBatchReaderIter private final Instance instance; private final TCredentials credentials; private final String table; - private Authorizations authorizations = Constants.NO_AUTHS; + private Authorizations authorizations = Authorizations.EMPTY; private final int numThreads; private final ExecutorService queryThreadPool; private final ScannerOptions options; @@ -612,8 +611,8 @@ public class TabletServerBatchReaderIter } static void doLookup(String server, Map> requested, Map> failures, Map> unscanned, - ResultReceiver receiver, List columns, TCredentials credentials, ScannerOptions options, Authorizations authorizations, AccumuloConfiguration conf, - TimeoutTracker timeoutTracker) throws IOException, AccumuloSecurityException, AccumuloServerException { + ResultReceiver receiver, List columns, TCredentials credentials, ScannerOptions options, Authorizations authorizations, + AccumuloConfiguration conf, TimeoutTracker timeoutTracker) throws IOException, AccumuloSecurityException, AccumuloServerException { if (requested.size() == 0) { return; Modified: accumulo/trunk/core/src/main/java/org/apache/accumulo/core/client/mapred/InputFormatBase.java URL: http://svn.apache.org/viewvc/accumulo/trunk/core/src/main/java/org/apache/accumulo/core/client/mapred/InputFormatBase.java?rev=1493250&r1=1493249&r2=1493250&view=diff ============================================================================== --- accumulo/trunk/core/src/main/java/org/apache/accumulo/core/client/mapred/InputFormatBase.java (original) +++ accumulo/trunk/core/src/main/java/org/apache/accumulo/core/client/mapred/InputFormatBase.java Fri Jun 14 21:19:23 2013 @@ -686,7 +686,7 @@ public abstract class InputFormatBase implementingClass, Configuration conf) { String authString = conf.get(enumToConfKey(implementingClass, ScanOpts.AUTHORIZATIONS)); - return authString == null ? Constants.NO_AUTHS : new Authorizations(authString.getBytes()); + return authString == null ? Authorizations.EMPTY : new Authorizations(authString.getBytes()); } /** Modified: accumulo/trunk/core/src/main/java/org/apache/accumulo/core/client/mock/MockAccumulo.java URL: http://svn.apache.org/viewvc/accumulo/trunk/core/src/main/java/org/apache/accumulo/core/client/mock/MockAccumulo.java?rev=1493250&r1=1493249&r2=1493250&view=diff ============================================================================== --- accumulo/trunk/core/src/main/java/org/apache/accumulo/core/client/mock/MockAccumulo.java (original) +++ accumulo/trunk/core/src/main/java/org/apache/accumulo/core/client/mock/MockAccumulo.java Fri Jun 14 21:19:23 2013 @@ -44,7 +44,7 @@ public class MockAccumulo { } { - MockUser root = new MockUser("root", new PasswordToken(new byte[0]), Constants.NO_AUTHS); + MockUser root = new MockUser("root", new PasswordToken(new byte[0]), Authorizations.EMPTY); root.permissions.add(SystemPermission.SYSTEM); users.put(root.name, root); createTable("root", Constants.METADATA_TABLE_NAME, true, TimeType.LOGICAL); @@ -88,8 +88,8 @@ public class MockAccumulo { public Collection getSplits(String tableName) { return tables.get(tableName).getSplits(); } - + public void merge(String tableName, Text start, Text end) { tables.get(tableName).merge(start, end); - } + } } Modified: accumulo/trunk/core/src/main/java/org/apache/accumulo/core/client/mock/MockInstanceOperations.java URL: http://svn.apache.org/viewvc/accumulo/trunk/core/src/main/java/org/apache/accumulo/core/client/mock/MockInstanceOperations.java?rev=1493250&r1=1493249&r2=1493250&view=diff ============================================================================== --- accumulo/trunk/core/src/main/java/org/apache/accumulo/core/client/mock/MockInstanceOperations.java (original) +++ accumulo/trunk/core/src/main/java/org/apache/accumulo/core/client/mock/MockInstanceOperations.java Fri Jun 14 21:19:23 2013 @@ -33,78 +33,40 @@ import org.apache.accumulo.start.classlo public class MockInstanceOperations implements InstanceOperations { MockAccumulo acu; - /** - * @param acu - */ public MockInstanceOperations(MockAccumulo acu) { this.acu = acu; } - /* - * (non-Javadoc) - * - * @see org.apache.accumulo.core.client.admin.InstanceOperations#setProperty(java.lang.String, java.lang.String) - */ @Override public void setProperty(String property, String value) throws AccumuloException, AccumuloSecurityException { acu.setProperty(property, value); } - /* - * (non-Javadoc) - * - * @see org.apache.accumulo.core.client.admin.InstanceOperations#removeProperty(java.lang.String) - */ @Override public void removeProperty(String property) throws AccumuloException, AccumuloSecurityException { acu.removeProperty(property); } - /* - * (non-Javadoc) - * - * @see org.apache.accumulo.core.client.admin.InstanceOperations#getSystemConfiguration() - */ @Override public Map getSystemConfiguration() throws AccumuloException, AccumuloSecurityException { return acu.systemProperties; } - /* - * (non-Javadoc) - * - * @see org.apache.accumulo.core.client.admin.InstanceOperations#getSiteConfiguration() - */ @Override public Map getSiteConfiguration() throws AccumuloException, AccumuloSecurityException { return acu.systemProperties; } - /* - * (non-Javadoc) - * - * @see org.apache.accumulo.core.client.admin.InstanceOperations#getTabletServers() - */ @Override public List getTabletServers() { return new ArrayList(); } - /* - * (non-Javadoc) - * - * @see org.apache.accumulo.core.client.admin.InstanceOperations#getActiveScans(java.lang.String) - */ @Override public List getActiveScans(String tserver) throws AccumuloException, AccumuloSecurityException { return new ArrayList(); } - /* - * (non-Javadoc) - * - * @see org.apache.accumulo.core.client.admin.InstanceOperations#testClassLoad(java.lang.String, java.lang.String) - */ @Override public boolean testClassLoad(String className, String asTypeName) throws AccumuloException, AccumuloSecurityException { try { @@ -116,11 +78,6 @@ public class MockInstanceOperations impl return true; } - /* - * (non-Javadoc) - * - * @see org.apache.accumulo.core.client.admin.InstanceOperations#getActiveCompactions(java.lang.String) - */ @Override public List getActiveCompactions(String tserver) throws AccumuloException, AccumuloSecurityException { return new ArrayList(); @@ -128,6 +85,6 @@ public class MockInstanceOperations impl @Override public void ping(String tserver) throws AccumuloException { - + } } Modified: accumulo/trunk/core/src/main/java/org/apache/accumulo/core/security/Authorizations.java URL: http://svn.apache.org/viewvc/accumulo/trunk/core/src/main/java/org/apache/accumulo/core/security/Authorizations.java?rev=1493250&r1=1493249&r2=1493250&view=diff ============================================================================== --- accumulo/trunk/core/src/main/java/org/apache/accumulo/core/security/Authorizations.java (original) +++ accumulo/trunk/core/src/main/java/org/apache/accumulo/core/security/Authorizations.java Fri Jun 14 21:19:23 2013 @@ -41,6 +41,8 @@ public class Authorizations implements I private Set auths = new HashSet(); private List authsList = new ArrayList(); + public static final Authorizations EMPTY = new Authorizations(); + private static final boolean[] validAuthChars = new boolean[256]; public static final String HEADER = "!AUTH1:"; Modified: accumulo/trunk/core/src/main/java/org/apache/accumulo/core/util/Merge.java URL: http://svn.apache.org/viewvc/accumulo/trunk/core/src/main/java/org/apache/accumulo/core/util/Merge.java?rev=1493250&r1=1493249&r2=1493250&view=diff ============================================================================== --- accumulo/trunk/core/src/main/java/org/apache/accumulo/core/util/Merge.java (original) +++ accumulo/trunk/core/src/main/java/org/apache/accumulo/core/util/Merge.java Fri Jun 14 21:19:23 2013 @@ -32,6 +32,7 @@ import org.apache.accumulo.core.conf.Pro import org.apache.accumulo.core.data.Key; import org.apache.accumulo.core.data.KeyExtent; import org.apache.accumulo.core.data.Value; +import org.apache.accumulo.core.security.Authorizations; import org.apache.commons.cli.ParseException; import org.apache.hadoop.io.Text; import org.apache.log4j.Logger; @@ -61,6 +62,7 @@ public class Merge { return AccumuloConfiguration.getMemoryInBytes(value); } } + static class TextConverter implements IStringConverter { @Override public Text convert(String value) { @@ -69,13 +71,13 @@ public class Merge { } static class Opts extends ClientOnRequiredTable { - @Parameter(names={"-s", "--size"}, description="merge goal size", converter=MemoryConverter.class) + @Parameter(names = {"-s", "--size"}, description = "merge goal size", converter = MemoryConverter.class) Long goalSize = null; - @Parameter(names={"-f", "--force"}, description="merge small tablets even if merging them to larger tablets might cause a split") + @Parameter(names = {"-f", "--force"}, description = "merge small tablets even if merging them to larger tablets might cause a split") boolean force = false; - @Parameter(names={"-b", "--begin"}, description="start tablet", converter=TextConverter.class) + @Parameter(names = {"-b", "--begin"}, description = "start tablet", converter = TextConverter.class) Text begin = null; - @Parameter(names={"-e", "--end"}, description="end tablet", converter=TextConverter.class) + @Parameter(names = {"-e", "--end"}, description = "end tablet", converter = TextConverter.class) Text end = null; } @@ -210,7 +212,7 @@ public class Merge { Scanner scanner; try { tableId = Tables.getTableId(conn.getInstance(), tablename); - scanner = conn.createScanner(Constants.METADATA_TABLE_NAME, Constants.NO_AUTHS); + scanner = conn.createScanner(Constants.METADATA_TABLE_NAME, Authorizations.EMPTY); } catch (Exception e) { throw new MergeException(e); } Modified: accumulo/trunk/core/src/main/java/org/apache/accumulo/core/util/MetadataTable.java URL: http://svn.apache.org/viewvc/accumulo/trunk/core/src/main/java/org/apache/accumulo/core/util/MetadataTable.java?rev=1493250&r1=1493249&r2=1493250&view=diff ============================================================================== --- accumulo/trunk/core/src/main/java/org/apache/accumulo/core/util/MetadataTable.java (original) +++ accumulo/trunk/core/src/main/java/org/apache/accumulo/core/util/MetadataTable.java Fri Jun 14 21:19:23 2013 @@ -38,6 +38,7 @@ import org.apache.accumulo.core.data.Key import org.apache.accumulo.core.data.PartialKey; import org.apache.accumulo.core.data.Range; import org.apache.accumulo.core.data.Value; +import org.apache.accumulo.core.security.Authorizations; import org.apache.accumulo.core.security.CredentialHelper; import org.apache.accumulo.core.security.thrift.TCredentials; import org.apache.hadoop.io.Text; @@ -94,6 +95,7 @@ public class MetadataTable { return ("" + size + "," + numEntries).getBytes(); } + @Override public boolean equals(Object o) { if (o instanceof DataFileValue) { DataFileValue odfv = (DataFileValue) o; @@ -104,10 +106,12 @@ public class MetadataTable { return false; } + @Override public int hashCode() { return Long.valueOf(size + numEntries).hashCode(); } + @Override public String toString() { return size + " " + numEntries; } @@ -164,7 +168,7 @@ public class MetadataTable { results.put(ke, location); else locationless.add(ke); - + location = null; prevRow = null; } @@ -172,7 +176,7 @@ public class MetadataTable { return new Pair,List>(results, locationless); } - + public static SortedMap> getTabletEntries(SortedMap tabletKeyValues, List columns) { TreeMap> tabletEntries = new TreeMap>(); @@ -200,12 +204,13 @@ public class MetadataTable { return tabletEntries; } - + public static void getEntries(Instance instance, TCredentials credentials, String table, boolean isTid, Map locations, SortedSet tablets) throws AccumuloException, AccumuloSecurityException, TableNotFoundException { String tableId = isTid ? table : Tables.getNameToIdMap(instance).get(table); - Scanner scanner = instance.getConnector(credentials.getPrincipal(), CredentialHelper.extractToken(credentials)).createScanner(Constants.METADATA_TABLE_NAME, Constants.NO_AUTHS); + Scanner scanner = instance.getConnector(credentials.getPrincipal(), CredentialHelper.extractToken(credentials)).createScanner( + Constants.METADATA_TABLE_NAME, Authorizations.EMPTY); Constants.METADATA_PREV_ROW_COLUMN.fetch(scanner); scanner.fetchColumnFamily(Constants.METADATA_CURRENT_LOCATION_COLUMN_FAMILY); Modified: accumulo/trunk/core/src/main/java/org/apache/accumulo/core/util/TableDiskUsage.java URL: http://svn.apache.org/viewvc/accumulo/trunk/core/src/main/java/org/apache/accumulo/core/util/TableDiskUsage.java?rev=1493250&r1=1493249&r2=1493250&view=diff ============================================================================== --- accumulo/trunk/core/src/main/java/org/apache/accumulo/core/util/TableDiskUsage.java (original) +++ accumulo/trunk/core/src/main/java/org/apache/accumulo/core/util/TableDiskUsage.java Fri Jun 14 21:19:23 2013 @@ -39,6 +39,7 @@ import org.apache.accumulo.core.conf.Acc import org.apache.accumulo.core.data.Key; import org.apache.accumulo.core.data.KeyExtent; import org.apache.accumulo.core.data.Value; +import org.apache.accumulo.core.security.Authorizations; import org.apache.hadoop.fs.FileStatus; import org.apache.hadoop.fs.FileSystem; import org.apache.hadoop.fs.Path; @@ -117,9 +118,8 @@ public class TableDiskUsage { void print(String line); } - public static void printDiskUsage(AccumuloConfiguration acuConf, Collection tables, FileSystem fs, Connector conn, boolean humanReadable) - throws TableNotFoundException, - IOException { + public static void printDiskUsage(AccumuloConfiguration acuConf, Collection tables, FileSystem fs, Connector conn, boolean humanReadable) + throws TableNotFoundException, IOException { printDiskUsage(acuConf, tables, fs, conn, new Printer() { @Override public void print(String line) { @@ -141,7 +141,7 @@ public class TableDiskUsage { for (String tableId : tableIds) { Scanner mdScanner = null; try { - mdScanner = conn.createScanner(Constants.METADATA_TABLE_NAME, Constants.NO_AUTHS); + mdScanner = conn.createScanner(Constants.METADATA_TABLE_NAME, Authorizations.EMPTY); } catch (TableNotFoundException e) { throw new RuntimeException(e); } @@ -229,8 +229,8 @@ public class TableDiskUsage { return usage; } - public static void printDiskUsage(AccumuloConfiguration acuConf, Collection tables, FileSystem fs, Connector conn, Printer printer, boolean humanReadable) - throws TableNotFoundException, IOException { + public static void printDiskUsage(AccumuloConfiguration acuConf, Collection tables, FileSystem fs, Connector conn, Printer printer, + boolean humanReadable) throws TableNotFoundException, IOException { HashSet tableIds = new HashSet(); @@ -243,7 +243,7 @@ public class TableDiskUsage { } Map,Long> usage = getDiskUsage(acuConf, tableIds, fs, conn, humanReadable); - + String valueFormat = humanReadable ? "%9s" : "%,24d"; for (Entry,Long> entry : usage.entrySet()) { Object value = humanReadable ? NumUtil.bigNumberForSize(entry.getValue()) : entry.getValue(); Modified: accumulo/trunk/core/src/main/java/org/apache/accumulo/core/util/shell/commands/GetSplitsCommand.java URL: http://svn.apache.org/viewvc/accumulo/trunk/core/src/main/java/org/apache/accumulo/core/util/shell/commands/GetSplitsCommand.java?rev=1493250&r1=1493249&r2=1493250&view=diff ============================================================================== --- accumulo/trunk/core/src/main/java/org/apache/accumulo/core/util/shell/commands/GetSplitsCommand.java (original) +++ accumulo/trunk/core/src/main/java/org/apache/accumulo/core/util/shell/commands/GetSplitsCommand.java Fri Jun 14 21:19:23 2013 @@ -31,6 +31,7 @@ import org.apache.accumulo.core.data.Key import org.apache.accumulo.core.data.KeyExtent; import org.apache.accumulo.core.data.Range; import org.apache.accumulo.core.data.Value; +import org.apache.accumulo.core.security.Authorizations; import org.apache.accumulo.core.util.TextUtil; import org.apache.accumulo.core.util.format.BinaryFormatter; import org.apache.accumulo.core.util.shell.Shell; @@ -68,7 +69,7 @@ public class GetSplitsCommand extends Co p.print(encode(encode, row)); } } else { - final Scanner scanner = shellState.getConnector().createScanner(Constants.METADATA_TABLE_NAME, Constants.NO_AUTHS); + final Scanner scanner = shellState.getConnector().createScanner(Constants.METADATA_TABLE_NAME, Authorizations.EMPTY); Constants.METADATA_PREV_ROW_COLUMN.fetch(scanner); final Text start = new Text(shellState.getConnector().tableOperations().tableIdMap().get(tableName)); final Text end = new Text(start); Modified: accumulo/trunk/core/src/main/java/org/apache/accumulo/core/util/shell/commands/ScanCommand.java URL: http://svn.apache.org/viewvc/accumulo/trunk/core/src/main/java/org/apache/accumulo/core/util/shell/commands/ScanCommand.java?rev=1493250&r1=1493249&r2=1493250&view=diff ============================================================================== --- accumulo/trunk/core/src/main/java/org/apache/accumulo/core/util/shell/commands/ScanCommand.java (original) +++ accumulo/trunk/core/src/main/java/org/apache/accumulo/core/util/shell/commands/ScanCommand.java Fri Jun 14 21:19:23 2013 @@ -22,7 +22,6 @@ import java.util.List; import java.util.Map.Entry; 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.IteratorSetting; @@ -57,8 +56,9 @@ public class ScanCommand extends Command private Option timeoutOption; private Option profileOpt; + @Override public int execute(final String fullCommand, final CommandLine cl, final Shell shellState) throws Exception { - + final String outputFile = cl.getOptionValue(outputFileOpt.getOpt()); final PrintFile printFile = outputFile == null ? null : new PrintFile(outputFile); @@ -83,7 +83,7 @@ public class ScanCommand extends Command // set timeout scanner.setTimeout(getTimeout(cl), TimeUnit.MILLISECONDS); - + // output the records if (cl.hasOption(showFewOpt.getOpt())) { final String showLength = cl.getOptionValue(showFewOpt.getOpt()); @@ -117,7 +117,7 @@ public class ScanCommand extends Command return Long.MAX_VALUE; } - + protected void addScanIterators(final Shell shellState, CommandLine cl, final Scanner scanner, final String tableName) { List tableScanIterators; @@ -135,7 +135,7 @@ public class ScanCommand extends Command return; } } - + Shell.log.debug("Found " + tableScanIterators.size() + " scan iterators to set"); for (IteratorSetting setting : tableScanIterators) { @@ -161,7 +161,7 @@ public class ScanCommand extends Command shellState.printRecords(scanner, cl.hasOption(timestampOpt.getOpt()), !cl.hasOption(disablePaginationOpt.getOpt()), formatter, outFile); } } - + protected void printBinaryRecords(final CommandLine cl, final Shell shellState, final Iterable> scanner) throws IOException { printBinaryRecords(cl, shellState, scanner, null); } @@ -187,16 +187,16 @@ public class ScanCommand extends Command } catch (ClassNotFoundException e) { shellState.getReader().println("Interpreter class could not be loaded.\n" + e.getMessage()); } - + if (clazz == null) clazz = InterpreterCommand.getCurrentInterpreter(tableName, shellState); - + if (clazz == null) clazz = DefaultScanInterpreter.class; return clazz.newInstance(); } - + protected Class getFormatter(final CommandLine cl, final String tableName, final Shell shellState) throws IOException { try { @@ -260,7 +260,7 @@ public class ScanCommand extends Command static Authorizations parseAuthorizations(final String field) { if (field == null || field.isEmpty()) { - return Constants.NO_AUTHS; + return Authorizations.EMPTY; } return new Authorizations(field.split(",")); } @@ -302,7 +302,7 @@ public class ScanCommand extends Command profileOpt = new Option("pn", "profile", true, "iterator profile name"); profileOpt.setArgName("profile"); - + o.addOption(scanOptAuths); o.addOption(scanOptRow); o.addOption(OptUtil.startRowOpt()); Modified: accumulo/trunk/core/src/test/java/org/apache/accumulo/core/cli/TestClientOpts.java URL: http://svn.apache.org/viewvc/accumulo/trunk/core/src/test/java/org/apache/accumulo/core/cli/TestClientOpts.java?rev=1493250&r1=1493249&r2=1493250&view=diff ============================================================================== --- accumulo/trunk/core/src/test/java/org/apache/accumulo/core/cli/TestClientOpts.java (original) +++ accumulo/trunk/core/src/test/java/org/apache/accumulo/core/cli/TestClientOpts.java Fri Jun 14 21:19:23 2013 @@ -23,7 +23,6 @@ import static org.junit.Assert.assertTru import java.util.concurrent.TimeUnit; -import org.apache.accumulo.core.Constants; import org.apache.accumulo.core.client.BatchWriterConfig; import org.apache.accumulo.core.client.security.tokens.PasswordToken; import org.apache.accumulo.core.security.Authorizations; @@ -51,7 +50,7 @@ public class TestClientOpts { assertFalse(args.trace); assertEquals(10, bsOpts.scanThreads.intValue()); assertEquals(null, args.instance); - assertEquals(Constants.NO_AUTHS, args.auths); + assertEquals(Authorizations.EMPTY, args.auths); assertEquals("localhost:2181", args.zookeepers); assertFalse(args.help); Modified: accumulo/trunk/core/src/test/java/org/apache/accumulo/core/client/admin/FindMaxTest.java URL: http://svn.apache.org/viewvc/accumulo/trunk/core/src/test/java/org/apache/accumulo/core/client/admin/FindMaxTest.java?rev=1493250&r1=1493249&r2=1493250&view=diff ============================================================================== --- accumulo/trunk/core/src/test/java/org/apache/accumulo/core/client/admin/FindMaxTest.java (original) +++ accumulo/trunk/core/src/test/java/org/apache/accumulo/core/client/admin/FindMaxTest.java Fri Jun 14 21:19:23 2013 @@ -21,7 +21,6 @@ import java.util.Map.Entry; import junit.framework.TestCase; -import org.apache.accumulo.core.Constants; import org.apache.accumulo.core.client.BatchWriter; import org.apache.accumulo.core.client.BatchWriterConfig; import org.apache.accumulo.core.client.Connector; @@ -31,6 +30,7 @@ import org.apache.accumulo.core.client.s import org.apache.accumulo.core.data.Key; import org.apache.accumulo.core.data.Mutation; import org.apache.accumulo.core.data.Value; +import org.apache.accumulo.core.security.Authorizations; import org.apache.hadoop.io.Text; public class FindMaxTest extends TestCase { @@ -70,7 +70,7 @@ public class FindMaxTest extends TestCas bw.close(); - Scanner scanner = conn.createScanner("foo", Constants.NO_AUTHS); + Scanner scanner = conn.createScanner("foo", Authorizations.EMPTY); ArrayList rows = new ArrayList(); @@ -79,33 +79,33 @@ public class FindMaxTest extends TestCas } for (int i = rows.size() - 1; i > 0; i--) { - Text max = FindMax.findMax(conn.createScanner("foo", Constants.NO_AUTHS), null, true, rows.get(i), false); + Text max = FindMax.findMax(conn.createScanner("foo", Authorizations.EMPTY), null, true, rows.get(i), false); assertEquals(rows.get(i - 1), max); - max = FindMax.findMax(conn.createScanner("foo", Constants.NO_AUTHS), rows.get(i - 1), true, rows.get(i), false); + max = FindMax.findMax(conn.createScanner("foo", Authorizations.EMPTY), rows.get(i - 1), true, rows.get(i), false); assertEquals(rows.get(i - 1), max); - max = FindMax.findMax(conn.createScanner("foo", Constants.NO_AUTHS), rows.get(i - 1), false, rows.get(i), false); + max = FindMax.findMax(conn.createScanner("foo", Authorizations.EMPTY), rows.get(i - 1), false, rows.get(i), false); assertNull(max); - max = FindMax.findMax(conn.createScanner("foo", Constants.NO_AUTHS), null, true, rows.get(i), true); + max = FindMax.findMax(conn.createScanner("foo", Authorizations.EMPTY), null, true, rows.get(i), true); assertEquals(rows.get(i), max); - max = FindMax.findMax(conn.createScanner("foo", Constants.NO_AUTHS), rows.get(i), true, rows.get(i), true); + max = FindMax.findMax(conn.createScanner("foo", Authorizations.EMPTY), rows.get(i), true, rows.get(i), true); assertEquals(rows.get(i), max); - max = FindMax.findMax(conn.createScanner("foo", Constants.NO_AUTHS), rows.get(i - 1), false, rows.get(i), true); + max = FindMax.findMax(conn.createScanner("foo", Authorizations.EMPTY), rows.get(i - 1), false, rows.get(i), true); assertEquals(rows.get(i), max); } - Text max = FindMax.findMax(conn.createScanner("foo", Constants.NO_AUTHS), null, true, null, true); + Text max = FindMax.findMax(conn.createScanner("foo", Authorizations.EMPTY), null, true, null, true); assertEquals(rows.get(rows.size() - 1), max); - max = FindMax.findMax(conn.createScanner("foo", Constants.NO_AUTHS), null, true, new Text(new byte[] {0}), false); + max = FindMax.findMax(conn.createScanner("foo", Authorizations.EMPTY), null, true, new Text(new byte[] {0}), false); assertNull(max); - max = FindMax.findMax(conn.createScanner("foo", Constants.NO_AUTHS), null, true, new Text(new byte[] {0}), true); + max = FindMax.findMax(conn.createScanner("foo", Authorizations.EMPTY), null, true, new Text(new byte[] {0}), true); assertEquals(rows.get(0), max); } } Modified: accumulo/trunk/core/src/test/java/org/apache/accumulo/core/client/mock/MockConnectorTest.java URL: http://svn.apache.org/viewvc/accumulo/trunk/core/src/test/java/org/apache/accumulo/core/client/mock/MockConnectorTest.java?rev=1493250&r1=1493249&r2=1493250&view=diff ============================================================================== --- accumulo/trunk/core/src/test/java/org/apache/accumulo/core/client/mock/MockConnectorTest.java (original) +++ accumulo/trunk/core/src/test/java/org/apache/accumulo/core/client/mock/MockConnectorTest.java Fri Jun 14 21:19:23 2013 @@ -25,10 +25,9 @@ import java.util.Collections; import java.util.Iterator; import java.util.List; import java.util.Map.Entry; -import java.util.concurrent.TimeUnit; import java.util.Random; +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.BatchDeleter; @@ -71,7 +70,7 @@ public class MockConnectorTest { bw.addMutation(m); } bw.close(); - BatchScanner s = c.createBatchScanner("test", Constants.NO_AUTHS, 2); + BatchScanner s = c.createBatchScanner("test", Authorizations.EMPTY, 2); s.setRanges(Collections.singletonList(new Range())); Key key = null; int count = 0; @@ -101,8 +100,9 @@ public class MockConnectorTest { public void testBadMutations() throws Exception { Connector c = new MockConnector("root", new MockInstance()); c.tableOperations().create("test"); - BatchWriter bw = c.createBatchWriter("test", new BatchWriterConfig().setMaxMemory(10000L).setMaxLatency(1000L, TimeUnit.MILLISECONDS).setMaxWriteThreads(4)); - + BatchWriter bw = c + .createBatchWriter("test", new BatchWriterConfig().setMaxMemory(10000L).setMaxLatency(1000L, TimeUnit.MILLISECONDS).setMaxWriteThreads(4)); + try { bw.addMutation(null); Assert.fail("addMutation should throw IAE for null mutation"); @@ -111,16 +111,15 @@ public class MockConnectorTest { bw.addMutations(null); Assert.fail("addMutations should throw IAE for null iterable"); } catch (IllegalArgumentException iae) {} - - bw.addMutations(Collections.emptyList()); - + + bw.addMutations(Collections. emptyList()); + Mutation bad = new Mutation("bad"); try { bw.addMutation(bad); Assert.fail("addMutation should throw IAE for empty mutation"); } catch (IllegalArgumentException iae) {} - - + Mutation good = new Mutation("good"); good.put(asText(random.nextInt()), asText(random.nextInt()), new Value("good".getBytes())); List mutations = new ArrayList(); @@ -130,10 +129,10 @@ public class MockConnectorTest { bw.addMutations(mutations); Assert.fail("addMutations should throw IAE if it contains empty mutation"); } catch (IllegalArgumentException iae) {} - + bw.close(); } - + @Test public void testAggregation() throws Exception { MockInstance mockInstance = new MockInstance(); @@ -154,7 +153,7 @@ public class MockConnectorTest { } bw.close(); - Scanner s = c.createScanner("perDayCounts", Constants.NO_AUTHS); + Scanner s = c.createScanner("perDayCounts", Authorizations.EMPTY); Iterator> iterator = s.iterator(); assertTrue(iterator.hasNext()); checkEntry(iterator.next(), "bar", "day", "20080101", "2"); @@ -185,7 +184,7 @@ public class MockConnectorTest { bw.addMutation(m2); bw.flush(); - Scanner scanner = c.createScanner("test", Constants.NO_AUTHS); + Scanner scanner = c.createScanner("test", Authorizations.EMPTY); int count = 0; for (@SuppressWarnings("unused") @@ -213,7 +212,7 @@ public class MockConnectorTest { c.tableOperations().delete("test"); c.tableOperations().create("test"); - BatchDeleter deleter = c.createBatchDeleter("test", Constants.NO_AUTHS, 2, new BatchWriterConfig()); + BatchDeleter deleter = c.createBatchDeleter("test", Authorizations.EMPTY, 2, new BatchWriterConfig()); // first make sure it deletes fine when its empty deleter.setRanges(Collections.singletonList(new Range(("r1")))); deleter.delete(); @@ -264,7 +263,7 @@ public class MockConnectorTest { * number of rows the table should contain */ private void checkRemaining(Connector c, String tableName, int count) throws Exception { - Scanner scanner = c.createScanner(tableName, Constants.NO_AUTHS); + Scanner scanner = c.createScanner(tableName, Authorizations.EMPTY); int total = 0; for (@SuppressWarnings("unused") @@ -291,7 +290,7 @@ public class MockConnectorTest { int count = 10; - Scanner scanner = c.createScanner("test", Constants.NO_AUTHS); + Scanner scanner = c.createScanner("test", Authorizations.EMPTY); for (Entry entry : scanner) { Key key = entry.getKey(); Mutation m = new Mutation(key.getRow()); @@ -341,7 +340,7 @@ public class MockConnectorTest { b.addMutation(m1); b.flush(); - Scanner scanner = c.createScanner("a", Constants.NO_AUTHS); + Scanner scanner = c.createScanner("a", Authorizations.EMPTY); int count = 0; for (@SuppressWarnings("unused") Entry entry : scanner) { @@ -349,7 +348,7 @@ public class MockConnectorTest { } assertEquals(1, count); count = 0; - scanner = c.createScanner("b", Constants.NO_AUTHS); + scanner = c.createScanner("b", Authorizations.EMPTY); for (@SuppressWarnings("unused") Entry entry : scanner) { count++; @@ -372,7 +371,7 @@ public class MockConnectorTest { bw.close(); - Scanner scanner = c.createScanner("test", Constants.NO_AUTHS); + Scanner scanner = c.createScanner("test", Authorizations.EMPTY); Entry entry = scanner.iterator().next(); Modified: accumulo/trunk/core/src/test/java/org/apache/accumulo/core/client/mock/MockTableOperationsTest.java URL: http://svn.apache.org/viewvc/accumulo/trunk/core/src/test/java/org/apache/accumulo/core/client/mock/MockTableOperationsTest.java?rev=1493250&r1=1493249&r2=1493250&view=diff ============================================================================== --- accumulo/trunk/core/src/test/java/org/apache/accumulo/core/client/mock/MockTableOperationsTest.java (original) +++ accumulo/trunk/core/src/test/java/org/apache/accumulo/core/client/mock/MockTableOperationsTest.java Fri Jun 14 21:19:23 2013 @@ -26,7 +26,6 @@ import java.util.List; import java.util.Map; import java.util.Map.Entry; -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.BatchScanner; @@ -110,7 +109,7 @@ public class MockTableOperationsTest { } protected void assertVersionable(Connector c, String tableName, int size) throws TableNotFoundException { - BatchScanner s = c.createBatchScanner(tableName, Constants.NO_AUTHS, 1); + BatchScanner s = c.createBatchScanner(tableName, Authorizations.EMPTY, 1); s.setRanges(Collections.singleton(Range.exact("row1", "cf", "cq"))); int count = 0; for (Map.Entry e : s) { @@ -266,7 +265,7 @@ public class MockTableOperationsTest { } bw.flush(); to.deleteRows("test", new Text("1"), new Text("2")); - Scanner s = connector.createScanner("test", Constants.NO_AUTHS); + Scanner s = connector.createScanner("test", Authorizations.EMPTY); for (Entry entry : s) { Assert.assertTrue(entry.getKey().getRow().toString().charAt(0) != '1'); } Modified: accumulo/trunk/core/src/test/java/org/apache/accumulo/core/client/mock/TestBatchScanner821.java URL: http://svn.apache.org/viewvc/accumulo/trunk/core/src/test/java/org/apache/accumulo/core/client/mock/TestBatchScanner821.java?rev=1493250&r1=1493249&r2=1493250&view=diff ============================================================================== --- accumulo/trunk/core/src/test/java/org/apache/accumulo/core/client/mock/TestBatchScanner821.java (original) +++ accumulo/trunk/core/src/test/java/org/apache/accumulo/core/client/mock/TestBatchScanner821.java Fri Jun 14 21:19:23 2013 @@ -21,7 +21,6 @@ import static org.junit.Assert.assertEqu import java.util.Collections; import java.util.Map.Entry; -import org.apache.accumulo.core.Constants; import org.apache.accumulo.core.client.BatchScanner; import org.apache.accumulo.core.client.BatchWriter; import org.apache.accumulo.core.client.BatchWriterConfig; @@ -32,6 +31,7 @@ import org.apache.accumulo.core.data.Key import org.apache.accumulo.core.data.Mutation; import org.apache.accumulo.core.data.Range; import org.apache.accumulo.core.data.Value; +import org.apache.accumulo.core.security.Authorizations; import org.junit.Test; public class TestBatchScanner821 { @@ -48,13 +48,13 @@ public class TestBatchScanner821 { bw.addMutation(m); } bw.flush(); - BatchScanner bs = conn.createBatchScanner("test", Constants.NO_AUTHS, 1); + BatchScanner bs = conn.createBatchScanner("test", Authorizations.EMPTY, 1); IteratorSetting cfg = new IteratorSetting(100, TransformIterator.class); bs.addScanIterator(cfg); bs.setRanges(Collections.singletonList(new Range("A", "Z"))); StringBuilder sb = new StringBuilder(); String comma = ""; - for (Entry entry : bs) { + for (Entry entry : bs) { sb.append(comma); sb.append(entry.getKey().getRow()); comma = ","; Modified: accumulo/trunk/core/src/test/java/org/apache/accumulo/core/iterators/user/IntersectingIteratorTest.java URL: http://svn.apache.org/viewvc/accumulo/trunk/core/src/test/java/org/apache/accumulo/core/iterators/user/IntersectingIteratorTest.java?rev=1493250&r1=1493249&r2=1493250&view=diff ============================================================================== --- accumulo/trunk/core/src/test/java/org/apache/accumulo/core/iterators/user/IntersectingIteratorTest.java (original) +++ accumulo/trunk/core/src/test/java/org/apache/accumulo/core/iterators/user/IntersectingIteratorTest.java Fri Jun 14 21:19:23 2013 @@ -28,7 +28,6 @@ import java.util.TreeMap; import junit.framework.TestCase; -import org.apache.accumulo.core.Constants; import org.apache.accumulo.core.client.BatchScanner; import org.apache.accumulo.core.client.BatchWriter; import org.apache.accumulo.core.client.BatchWriterConfig; @@ -46,6 +45,7 @@ import org.apache.accumulo.core.iterator import org.apache.accumulo.core.iterators.SortedKeyValueIterator; import org.apache.accumulo.core.iterators.SortedMapIterator; import org.apache.accumulo.core.iterators.system.MultiIterator; +import org.apache.accumulo.core.security.Authorizations; import org.apache.hadoop.io.Text; import org.apache.log4j.Level; import org.apache.log4j.Logger; @@ -282,7 +282,7 @@ public class IntersectingIteratorTest ex bw.addMutation(m); bw.close(); - BatchScanner bs = connector.createBatchScanner("index", Constants.NO_AUTHS, 10); + BatchScanner bs = connector.createBatchScanner("index", Authorizations.EMPTY, 10); IteratorSetting ii = new IteratorSetting(20, IntersectingIterator.class); IntersectingIterator.setColumnFamilies(ii, new Text[] {new Text("rvy"), new Text("15qh")}); bs.addScanIterator(ii); Modified: accumulo/trunk/core/src/test/java/org/apache/accumulo/core/iterators/user/RowFilterTest.java URL: http://svn.apache.org/viewvc/accumulo/trunk/core/src/test/java/org/apache/accumulo/core/iterators/user/RowFilterTest.java?rev=1493250&r1=1493249&r2=1493250&view=diff ============================================================================== --- accumulo/trunk/core/src/test/java/org/apache/accumulo/core/iterators/user/RowFilterTest.java (original) +++ accumulo/trunk/core/src/test/java/org/apache/accumulo/core/iterators/user/RowFilterTest.java Fri Jun 14 21:19:23 2013 @@ -23,7 +23,6 @@ import java.util.Map.Entry; import junit.framework.TestCase; -import org.apache.accumulo.core.Constants; import org.apache.accumulo.core.client.BatchWriter; import org.apache.accumulo.core.client.BatchWriterConfig; import org.apache.accumulo.core.client.Connector; @@ -37,6 +36,7 @@ import org.apache.accumulo.core.data.Mut import org.apache.accumulo.core.data.Range; import org.apache.accumulo.core.data.Value; import org.apache.accumulo.core.iterators.SortedKeyValueIterator; +import org.apache.accumulo.core.security.Authorizations; import org.apache.hadoop.io.Text; /** @@ -57,7 +57,7 @@ public class RowFilterTest extends TestC if (rowIterator.hasTop()) { firstKey = new Key(rowIterator.getTopKey()); } - + while (rowIterator.hasTop()) { sum += Integer.parseInt(rowIterator.getTopValue().toString()); rowIterator.next(); @@ -80,7 +80,7 @@ public class RowFilterTest extends TestC } } - + public void test1() throws Exception { MockInstance instance = new MockInstance("rft1"); Connector conn = instance.getConnector("", new PasswordToken("")); @@ -130,11 +130,11 @@ public class RowFilterTest extends TestC m.put("cf2", "cq1", "1"); m.put("cf2", "cq2", "1"); bw.addMutation(m); - + IteratorSetting is = new IteratorSetting(40, SummingRowFilter.class); conn.tableOperations().attachIterator("table1", is); - - Scanner scanner = conn.createScanner("table1", Constants.NO_AUTHS); + + Scanner scanner = conn.createScanner("table1", Authorizations.EMPTY); assertEquals(new HashSet(Arrays.asList("2", "3")), getRows(scanner)); scanner.fetchColumn(new Text("cf1"), new Text("cq2")); @@ -161,7 +161,7 @@ public class RowFilterTest extends TestC scanner.fetchColumn(new Text("cf1"), new Text("cq2")); scanner.fetchColumn(new Text("cf1"), new Text("cq4")); assertEquals(new HashSet(Arrays.asList("4")), getRows(scanner)); - + } private HashSet getRows(Scanner scanner) { Modified: accumulo/trunk/core/src/test/java/org/apache/accumulo/core/util/shell/command/FormatterCommandTest.java URL: http://svn.apache.org/viewvc/accumulo/trunk/core/src/test/java/org/apache/accumulo/core/util/shell/command/FormatterCommandTest.java?rev=1493250&r1=1493249&r2=1493250&view=diff ============================================================================== --- accumulo/trunk/core/src/test/java/org/apache/accumulo/core/util/shell/command/FormatterCommandTest.java (original) +++ accumulo/trunk/core/src/test/java/org/apache/accumulo/core/util/shell/command/FormatterCommandTest.java Fri Jun 14 21:19:23 2013 @@ -22,8 +22,6 @@ import java.io.InputStream; import java.util.Iterator; import java.util.Map.Entry; -import org.junit.Assert; - import org.apache.accumulo.core.client.AccumuloException; import org.apache.accumulo.core.client.AccumuloSecurityException; import org.apache.accumulo.core.client.TableExistsException; @@ -35,6 +33,7 @@ import org.apache.accumulo.core.util.she import org.apache.commons.lang.StringUtils; import org.apache.log4j.Level; import org.apache.log4j.Logger; +import org.junit.Assert; import org.junit.Test; /** @@ -50,7 +49,7 @@ public class FormatterCommandTest { Logger.getLogger(Shell.class).setLevel(Level.WARN); final String[] args = new String[] {"--fake", "-u", "root", "-p", ""}; - + final String[] commands = createCommands(); in = MockShell.makeCommands(commands); @@ -61,32 +60,25 @@ public class FormatterCommandTest { // Can't call createtable in the shell with MockAccumulo shell.getConnector().tableOperations().create("test"); - + try { shell.start(); } catch (Exception e) { Assert.fail("Exception while running commands: " + e.getMessage()); - } + } shell.getReader().flush(); final String[] output = StringUtils.split(new String(out.toByteArray()), '\n'); - + boolean formatterOn = false; - final String[] expectedDefault = new String[] { - "row cf:cq [] 1234abcd", - "row cf1:cq1 [] 9876fedc", - "row2 cf:cq [] 13579bdf", - "row2 cf1:cq [] 2468ace" - }; - - final String[] expectedFormatted = new String[] { - "row cf:cq [] 0x31 0x32 0x33 0x34 0x61 0x62 0x63 0x64", - "row cf1:cq1 [] 0x39 0x38 0x37 0x36 0x66 0x65 0x64 0x63", - "row2 cf:cq [] 0x31 0x33 0x35 0x37 0x39 0x62 0x64 0x66", - "row2 cf1:cq [] 0x32 0x34 0x36 0x38 0x61 0x63 0x65" - }; + final String[] expectedDefault = new String[] {"row cf:cq [] 1234abcd", "row cf1:cq1 [] 9876fedc", "row2 cf:cq [] 13579bdf", + "row2 cf1:cq [] 2468ace"}; + + final String[] expectedFormatted = new String[] {"row cf:cq [] 0x31 0x32 0x33 0x34 0x61 0x62 0x63 0x64", + "row cf1:cq1 [] 0x39 0x38 0x37 0x36 0x66 0x65 0x64 0x63", "row2 cf:cq [] 0x31 0x33 0x35 0x37 0x39 0x62 0x64 0x66", + "row2 cf1:cq [] 0x32 0x34 0x36 0x38 0x61 0x63 0x65"}; int outputIndex = 0; while (outputIndex < output.length) { @@ -96,7 +88,7 @@ public class FormatterCommandTest { if (line.contains("formatter")) { formatterOn = true; } - + outputIndex++; } else if (line.startsWith("row")) { int expectedIndex = 0; @@ -121,48 +113,37 @@ public class FormatterCommandTest { } private String[] createCommands() { - return new String[] { - "table test", - "insert row cf cq 1234abcd", - "insert row cf1 cq1 9876fedc", - "insert row2 cf cq 13579bdf", - "insert row2 cf1 cq 2468ace", - "scan", - "formatter -t test -f org.apache.accumulo.core.util.shell.command.FormatterCommandTest$HexFormatter", - "scan" - }; + return new String[] {"table test", "insert row cf cq 1234abcd", "insert row cf1 cq1 9876fedc", "insert row2 cf cq 13579bdf", "insert row2 cf1 cq 2468ace", + "scan", "formatter -t test -f org.apache.accumulo.core.util.shell.command.FormatterCommandTest$HexFormatter", "scan"}; } /** - *

Simple Formatter that will convert each character in the Value - * from decimal to hexadecimal. Will automatically skip over characters in the value - * which do not fall within the [0-9,a-f] range.

+ *

+ * Simple Formatter that will convert each character in the Value from decimal to hexadecimal. Will automatically skip over characters in the + * value which do not fall within the [0-9,a-f] range. + *

* - *

Example: '0' will be displayed as '0x30'

+ *

+ * Example: '0' will be displayed as '0x30' + *

*/ public static class HexFormatter implements Formatter { - private Iterator> iter = null; + private Iterator> iter = null; private boolean printTs = false; - + private final static String tab = "\t"; private final static String newline = "\n"; public HexFormatter() {} - /* (non-Javadoc) - * @see java.util.Iterator#hasNext() - */ @Override public boolean hasNext() { return this.iter.hasNext(); } - - /* (non-Javadoc) - * @see java.util.Iterator#next() - */ + @Override public String next() { - final Entry entry = iter.next(); + final Entry entry = iter.next(); String key; @@ -176,7 +157,7 @@ public class FormatterCommandTest { final Value v = entry.getValue(); // Approximate how much space we'll need - final StringBuilder sb = new StringBuilder(key.length() + v.getSize() * 5); + final StringBuilder sb = new StringBuilder(key.length() + v.getSize() * 5); sb.append(key).append(tab); @@ -190,17 +171,10 @@ public class FormatterCommandTest { return sb.toString(); } - - /* (non-Javadoc) - * @see java.util.Iterator#remove() - */ + @Override - public void remove() { - } - - /* (non-Javadoc) - * @see org.apache.accumulo.core.util.format.Formatter#initialize(java.lang.Iterable, boolean) - */ + public void remove() {} + @Override public void initialize(final Iterable> scanner, final boolean printTimestamps) { this.iter = scanner.iterator(); Modified: accumulo/trunk/examples/simple/src/main/java/org/apache/accumulo/examples/simple/client/RowOperations.java URL: http://svn.apache.org/viewvc/accumulo/trunk/examples/simple/src/main/java/org/apache/accumulo/examples/simple/client/RowOperations.java?rev=1493250&r1=1493249&r2=1493250&view=diff ============================================================================== --- accumulo/trunk/examples/simple/src/main/java/org/apache/accumulo/examples/simple/client/RowOperations.java (original) +++ accumulo/trunk/examples/simple/src/main/java/org/apache/accumulo/examples/simple/client/RowOperations.java Fri Jun 14 21:19:23 2013 @@ -16,10 +16,8 @@ */ package org.apache.accumulo.examples.simple.client; -import java.io.IOException; import java.util.Map.Entry; -import org.apache.accumulo.core.Constants; import org.apache.accumulo.core.cli.BatchWriterOpts; import org.apache.accumulo.core.cli.ClientOpts; import org.apache.accumulo.core.cli.ScannerOpts; @@ -35,6 +33,7 @@ import org.apache.accumulo.core.data.Key import org.apache.accumulo.core.data.Mutation; import org.apache.accumulo.core.data.Range; import org.apache.accumulo.core.data.Value; +import org.apache.accumulo.core.security.Authorizations; import org.apache.hadoop.io.Text; import org.apache.log4j.Logger; @@ -166,7 +165,8 @@ public class RowOperations { /** * Deletes a row given a text object - * @param opts + * + * @param opts * * @param row * @throws TableNotFoundException @@ -209,18 +209,10 @@ public class RowOperations { /** * Gets a scanner over one row - * @param opts - * - * @param row - * @return - * @throws TableNotFoundException - * @throws AccumuloSecurityException - * @throws AccumuloException - * @throws IOException */ private static Scanner getRow(ClientOpts opts, ScannerOpts scanOpts, Text row) throws AccumuloException, AccumuloSecurityException, TableNotFoundException { // Create a scanner - Scanner scanner = connector.createScanner(table, Constants.NO_AUTHS); + Scanner scanner = connector.createScanner(table, Authorizations.EMPTY); scanner.setBatchSize(scanOpts.scanBatchSize); // Say start key is the one with key of row // and end key is the one that immediately follows the row Modified: accumulo/trunk/server/src/main/java/org/apache/accumulo/server/gc/SimpleGarbageCollector.java URL: http://svn.apache.org/viewvc/accumulo/trunk/server/src/main/java/org/apache/accumulo/server/gc/SimpleGarbageCollector.java?rev=1493250&r1=1493249&r2=1493250&view=diff ============================================================================== --- accumulo/trunk/server/src/main/java/org/apache/accumulo/server/gc/SimpleGarbageCollector.java (original) +++ accumulo/trunk/server/src/main/java/org/apache/accumulo/server/gc/SimpleGarbageCollector.java Fri Jun 14 21:19:23 2013 @@ -62,6 +62,7 @@ import org.apache.accumulo.core.gc.thrif import org.apache.accumulo.core.gc.thrift.GCStatus; import org.apache.accumulo.core.gc.thrift.GcCycleStats; import org.apache.accumulo.core.master.state.tables.TableState; +import org.apache.accumulo.core.security.Authorizations; import org.apache.accumulo.core.security.CredentialHelper; import org.apache.accumulo.core.security.SecurityUtil; import org.apache.accumulo.core.security.thrift.TCredentials; @@ -476,7 +477,7 @@ public class SimpleGarbageCollector impl } Scanner scanner = instance.getConnector(credentials.getPrincipal(), CredentialHelper.extractToken(credentials)).createScanner( - Constants.METADATA_TABLE_NAME, Constants.NO_AUTHS); + Constants.METADATA_TABLE_NAME, Authorizations.EMPTY); scanner.setRange(range); List result = new ArrayList(); // find candidates for deletion; chop off the prefix @@ -516,7 +517,7 @@ public class SimpleGarbageCollector impl } else { try { scanner = new IsolatedScanner(instance.getConnector(credentials.getPrincipal(), CredentialHelper.extractToken(credentials)).createScanner( - Constants.METADATA_TABLE_NAME, Constants.NO_AUTHS)); + Constants.METADATA_TABLE_NAME, Authorizations.EMPTY)); } catch (AccumuloSecurityException ex) { throw new AccumuloException(ex); } catch (TableNotFoundException ex) { Modified: accumulo/trunk/server/src/main/java/org/apache/accumulo/server/master/Master.java URL: http://svn.apache.org/viewvc/accumulo/trunk/server/src/main/java/org/apache/accumulo/server/master/Master.java?rev=1493250&r1=1493249&r2=1493250&view=diff ============================================================================== --- accumulo/trunk/server/src/main/java/org/apache/accumulo/server/master/Master.java (original) +++ accumulo/trunk/server/src/main/java/org/apache/accumulo/server/master/Master.java Fri Jun 14 21:19:23 2013 @@ -79,6 +79,7 @@ import org.apache.accumulo.core.master.t import org.apache.accumulo.core.master.thrift.TabletLoadState; import org.apache.accumulo.core.master.thrift.TabletServerStatus; import org.apache.accumulo.core.master.thrift.TabletSplit; +import org.apache.accumulo.core.security.Authorizations; import org.apache.accumulo.core.security.SecurityUtil; import org.apache.accumulo.core.security.thrift.TCredentials; import org.apache.accumulo.core.tabletserver.thrift.NotServingTabletException; @@ -542,7 +543,7 @@ public class Master implements LiveTServ try { Connector conn = getConnector(); - Scanner scanner = new IsolatedScanner(conn.createScanner(Constants.METADATA_TABLE_NAME, Constants.NO_AUTHS)); + Scanner scanner = new IsolatedScanner(conn.createScanner(Constants.METADATA_TABLE_NAME, Authorizations.EMPTY)); Constants.METADATA_FLUSH_COLUMN.fetch(scanner); Constants.METADATA_DIRECTORY_COLUMN.fetch(scanner); scanner.fetchColumnFamily(Constants.METADATA_CURRENT_LOCATION_COLUMN_FAMILY); @@ -1566,7 +1567,7 @@ public class Master implements LiveTServ log.debug("Making file deletion entries for " + range); Range deleteRange = new Range(KeyExtent.getMetadataEntry(range.getTableId(), start), false, KeyExtent.getMetadataEntry(range.getTableId(), range.getEndRow()), true); - Scanner scanner = conn.createScanner(Constants.METADATA_TABLE_NAME, Constants.NO_AUTHS); + Scanner scanner = conn.createScanner(Constants.METADATA_TABLE_NAME, Authorizations.EMPTY); scanner.setRange(deleteRange); Constants.METADATA_DIRECTORY_COLUMN.fetch(scanner); Constants.METADATA_TIME_COLUMN.fetch(scanner); @@ -1645,7 +1646,7 @@ public class Master implements LiveTServ Connector conn = getConnector(); // Make file entries in highest tablet bw = conn.createBatchWriter(Constants.METADATA_TABLE_NAME, new BatchWriterConfig()); - Scanner scanner = conn.createScanner(Constants.METADATA_TABLE_NAME, Constants.NO_AUTHS); + Scanner scanner = conn.createScanner(Constants.METADATA_TABLE_NAME, Authorizations.EMPTY); scanner.setRange(scanRange); Constants.METADATA_PREV_ROW_COLUMN.fetch(scanner); Constants.METADATA_TIME_COLUMN.fetch(scanner); @@ -1672,7 +1673,7 @@ public class Master implements LiveTServ // read the logical time from the last tablet in the merge range, it is not included in // the loop above - scanner = conn.createScanner(Constants.METADATA_TABLE_NAME, Constants.NO_AUTHS); + scanner = conn.createScanner(Constants.METADATA_TABLE_NAME, Authorizations.EMPTY); Range last = new Range(stopRow); if (range.isMeta()) last = last.clip(Constants.METADATA_ROOT_TABLET_KEYSPACE); @@ -1733,7 +1734,7 @@ public class Master implements LiveTServ // group all deletes into tablet into one mutation, this makes tablets // either disappear entirely or not all.. this is important for the case // where the process terminates in the loop below... - scanner = conn.createScanner(Constants.METADATA_TABLE_NAME, Constants.NO_AUTHS); + scanner = conn.createScanner(Constants.METADATA_TABLE_NAME, Authorizations.EMPTY); log.debug("Deleting range " + scanRange); scanner.setRange(scanRange); RowIterator rowIter = new RowIterator(scanner); @@ -1759,7 +1760,7 @@ public class Master implements LiveTServ private KeyExtent getHighTablet(KeyExtent range) throws AccumuloException { try { Connector conn = getConnector(); - Scanner scanner = conn.createScanner(Constants.METADATA_TABLE_NAME, Constants.NO_AUTHS); + Scanner scanner = conn.createScanner(Constants.METADATA_TABLE_NAME, Authorizations.EMPTY); Constants.METADATA_PREV_ROW_COLUMN.fetch(scanner); KeyExtent start = new KeyExtent(range.getTableId(), range.getEndRow(), null); scanner.setRange(new Range(start.getMetadataEntry(), null)); @@ -1844,7 +1845,7 @@ public class Master implements LiveTServ // remove any migrating tablets that no longer exist. private void cleanupMutations() throws AccumuloException, AccumuloSecurityException, TableNotFoundException { Connector connector = getConnector(); - Scanner scanner = connector.createScanner(Constants.METADATA_TABLE_NAME, Constants.NO_AUTHS); + Scanner scanner = connector.createScanner(Constants.METADATA_TABLE_NAME, Authorizations.EMPTY); Constants.METADATA_PREV_ROW_COLUMN.fetch(scanner); Set found = new HashSet(); for (Entry entry : scanner) { Modified: accumulo/trunk/server/src/main/java/org/apache/accumulo/server/master/balancer/ChaoticLoadBalancer.java URL: http://svn.apache.org/viewvc/accumulo/trunk/server/src/main/java/org/apache/accumulo/server/master/balancer/ChaoticLoadBalancer.java?rev=1493250&r1=1493249&r2=1493250&view=diff ============================================================================== --- accumulo/trunk/server/src/main/java/org/apache/accumulo/server/master/balancer/ChaoticLoadBalancer.java (original) +++ accumulo/trunk/server/src/main/java/org/apache/accumulo/server/master/balancer/ChaoticLoadBalancer.java Fri Jun 14 21:19:23 2013 @@ -135,11 +135,6 @@ public class ChaoticLoadBalancer extends return 100; } - /* - * (non-Javadoc) - * - * @see org.apache.accumulo.server.master.balancer.TabletBalancer#init(org.apache.accumulo.server.conf.ServerConfiguration) - */ @Override public void init(ServerConfiguration conf) {} Modified: accumulo/trunk/server/src/main/java/org/apache/accumulo/server/master/state/MergeStats.java URL: http://svn.apache.org/viewvc/accumulo/trunk/server/src/main/java/org/apache/accumulo/server/master/state/MergeStats.java?rev=1493250&r1=1493249&r2=1493250&view=diff ============================================================================== --- accumulo/trunk/server/src/main/java/org/apache/accumulo/server/master/state/MergeStats.java (original) +++ accumulo/trunk/server/src/main/java/org/apache/accumulo/server/master/state/MergeStats.java Fri Jun 14 21:19:23 2013 @@ -29,6 +29,7 @@ import org.apache.accumulo.core.data.Key import org.apache.accumulo.core.data.PartialKey; import org.apache.accumulo.core.data.Range; import org.apache.accumulo.core.data.Value; +import org.apache.accumulo.core.security.Authorizations; import org.apache.accumulo.core.zookeeper.ZooUtil; import org.apache.accumulo.server.cli.ClientOpts; import org.apache.accumulo.server.master.state.TabletLocationState.BadLocationStateException; @@ -170,7 +171,7 @@ public class MergeStats { private boolean verifyMergeConsistency(Connector connector, CurrentState master) throws TableNotFoundException, IOException { MergeStats verify = new MergeStats(info); - Scanner scanner = connector.createScanner(Constants.METADATA_TABLE_NAME, Constants.NO_AUTHS); + Scanner scanner = connector.createScanner(Constants.METADATA_TABLE_NAME, Authorizations.EMPTY); MetaDataTableScanner.configureScanner(scanner, master); KeyExtent extent = info.getRange(); Text start = extent.getPrevEndRow();