accumulo-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From e..@apache.org
Subject svn commit: r1333025 - in /accumulo/trunk: core/src/main/java/org/apache/accumulo/core/client/impl/ core/src/main/java/org/apache/accumulo/core/client/mock/ core/src/main/java/org/apache/accumulo/core/iterators/ core/src/main/java/org/apache/accumulo/c...
Date Wed, 02 May 2012 13:06:27 GMT
Author: ecn
Date: Wed May  2 13:06:26 2012
New Revision: 1333025

URL: http://svn.apache.org/viewvc?rev=1333025&view=rev
Log:
ACCUMULO-555 remove even more deprecated methods, clean up warnings about deprecated apis

Modified:
    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/mock/MockAccumulo.java
    accumulo/trunk/core/src/main/java/org/apache/accumulo/core/client/mock/MockTable.java
    accumulo/trunk/core/src/main/java/org/apache/accumulo/core/iterators/IteratorUtil.java
    accumulo/trunk/core/src/main/java/org/apache/accumulo/core/iterators/system/ColumnFamilySkippingIterator.java
    accumulo/trunk/core/src/main/java/org/apache/accumulo/core/util/shell/commands/SetIterCommand.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/iterators/user/CombinerTest.java
    accumulo/trunk/server/src/main/java/org/apache/accumulo/server/monitor/servlets/DefaultServlet.java

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=1333025&r1=1333024&r2=1333025&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
Wed May  2 13:06:26 2012
@@ -110,7 +110,6 @@ class OfflineIterator implements Iterato
   private KeyExtent currentExtent;
   private Connector conn;
   private String tableId;
-  private AuthInfo credentials;
   private Authorizations authorizations;
   private Instance instance;
   private ScannerOptions options;
@@ -134,7 +133,6 @@ class OfflineIterator implements Iterato
 
     this.tableId = table.toString();
     this.authorizations = authorizations;
-    this.credentials = credentials;
     this.readers = new ArrayList<SortedKeyValueIterator<Key,Value>>();
     
     try {
@@ -232,7 +230,7 @@ class OfflineIterator implements Iterato
     if (currentExtent != null && !extent.isPreviousExtent(currentExtent))
       throw new AccumuloException(" " + currentExtent + " is not previous extent " + extent);
     
-    String tablesDir = Constants.getTablesDir(AccumuloConfiguration.getSiteConfiguration());
+    String tablesDir = Constants.getTablesDir(instance.getConfiguration());
     List<String> absFiles = new ArrayList<String>();
     for (String relPath : relFiles) {
       if (relPath.startsWith(".."))
@@ -294,7 +292,7 @@ class OfflineIterator implements Iterato
     
     Configuration conf = CachedConfiguration.getInstance();
     
-    FileSystem fs = FileUtil.getFileSystem(conf, AccumuloConfiguration.getSiteConfiguration());
+    FileSystem fs = FileUtil.getFileSystem(conf, instance.getConfiguration());
     
     for (SortedKeyValueIterator<Key,Value> reader : readers) {
       ((FileSKVIterator) reader).close();

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=1333025&r1=1333024&r2=1333025&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
Wed May  2 13:06:26 2012
@@ -18,14 +18,12 @@ package org.apache.accumulo.core.client.
 
 import java.util.EnumSet;
 import java.util.HashMap;
-import java.util.List;
 import java.util.Map;
 
 import org.apache.accumulo.core.Constants;
 import org.apache.accumulo.core.client.BatchScanner;
 import org.apache.accumulo.core.client.admin.TimeType;
 import org.apache.accumulo.core.data.Mutation;
-import org.apache.accumulo.core.iterators.conf.PerColumnIteratorConfig;
 import org.apache.accumulo.core.security.Authorizations;
 import org.apache.accumulo.core.security.SystemPermission;
 import org.apache.accumulo.core.security.TablePermission;
@@ -62,14 +60,7 @@ public class MockAccumulo {
   public BatchScanner createBatchScanner(String tableName, Authorizations authorizations)
{
     return new MockBatchScanner(tables.get(tableName), authorizations);
   }
-  
-  /**
-   * @deprecated since 1.4
-   */
-  public void addAggregators(String tableName, List<? extends PerColumnIteratorConfig>
aggregators) {
-    tables.get(tableName).addAggregators(aggregators);
-  }
-  
+
   public void createTable(String username, String tableName, boolean useVersions, TimeType
timeType) {
     MockTable t = new MockTable(useVersions, timeType);
     t.userPermissions.put(username, EnumSet.allOf(TablePermission.class));

Modified: accumulo/trunk/core/src/main/java/org/apache/accumulo/core/client/mock/MockTable.java
URL: http://svn.apache.org/viewvc/accumulo/trunk/core/src/main/java/org/apache/accumulo/core/client/mock/MockTable.java?rev=1333025&r1=1333024&r2=1333025&view=diff
==============================================================================
--- accumulo/trunk/core/src/main/java/org/apache/accumulo/core/client/mock/MockTable.java
(original)
+++ accumulo/trunk/core/src/main/java/org/apache/accumulo/core/client/mock/MockTable.java
Wed May  2 13:06:26 2012
@@ -18,14 +18,11 @@ package org.apache.accumulo.core.client.
 
 import java.util.EnumSet;
 import java.util.HashMap;
-import java.util.List;
 import java.util.Map;
 import java.util.Map.Entry;
 import java.util.SortedMap;
 import java.util.concurrent.ConcurrentSkipListMap;
 
-import org.apache.accumulo.core.client.IteratorSetting;
-import org.apache.accumulo.core.client.admin.TableOperations;
 import org.apache.accumulo.core.client.admin.TimeType;
 import org.apache.accumulo.core.conf.AccumuloConfiguration;
 import org.apache.accumulo.core.conf.Property;
@@ -113,15 +110,4 @@ public class MockTable {
       table.put(new MockMemKey(key, mutationCount), new Value(u.getValue()));
     }
   }
-  
-  /**
-   * @deprecated since 1.4, use {@link TableOperations#attachIterator(String tableName, IteratorSetting
setting)}
-   */
-  public void addAggregators(List<? extends org.apache.accumulo.core.iterators.conf.PerColumnIteratorConfig>
aggregators) {
-    for (Entry<String,String> entry : IteratorUtil.generateAggTableProperties(aggregators).entrySet())
{
-      String key = entry.getKey();
-      if (key.startsWith(Property.TABLE_PREFIX.getKey()))
-        settings.put(key, entry.getValue());
-    }
-  }
 }

Modified: accumulo/trunk/core/src/main/java/org/apache/accumulo/core/iterators/IteratorUtil.java
URL: http://svn.apache.org/viewvc/accumulo/trunk/core/src/main/java/org/apache/accumulo/core/iterators/IteratorUtil.java?rev=1333025&r1=1333024&r2=1333025&view=diff
==============================================================================
--- accumulo/trunk/core/src/main/java/org/apache/accumulo/core/iterators/IteratorUtil.java
(original)
+++ accumulo/trunk/core/src/main/java/org/apache/accumulo/core/iterators/IteratorUtil.java
Wed May  2 13:06:26 2012
@@ -27,15 +27,12 @@ import java.util.Map;
 import java.util.Map.Entry;
 import java.util.TreeMap;
 
-import org.apache.accumulo.core.client.IteratorSetting;
-import org.apache.accumulo.core.client.admin.TableOperations;
 import org.apache.accumulo.core.conf.AccumuloConfiguration;
 import org.apache.accumulo.core.conf.Property;
 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.thrift.IterInfo;
-import org.apache.accumulo.core.iterators.conf.PerColumnIteratorConfig;
 import org.apache.accumulo.core.iterators.system.SynchronizedIterator;
 import org.apache.accumulo.core.iterators.user.VersioningIterator;
 import org.apache.accumulo.start.classloader.AccumuloClassLoader;
@@ -59,32 +56,6 @@ public class IteratorUtil {
     
   }
   
-  /**
-   * @deprecated since 1.4
-   * @param aggregators
-   * @return A map of Aggregator Table Properties.
-   * 
-   * @see TableOperations#attachIterator(String, IteratorSetting)
-   */
-  public static Map<String,String> generateAggTableProperties(List<? extends PerColumnIteratorConfig>
aggregators) {
-    
-    Map<String,String> props = new TreeMap<String,String>();
-    
-    for (IteratorScope iterScope : IteratorScope.values()) {
-      if (aggregators.size() > 0) {
-        props.put(Property.TABLE_ITERATOR_PREFIX + iterScope.name() + ".agg", "10," + AggregatingIterator.class.getName());
-      }
-    }
-    
-    for (PerColumnIteratorConfig ac : aggregators) {
-      for (IteratorScope iterScope : IteratorScope.values()) {
-        props.put(Property.TABLE_ITERATOR_PREFIX + iterScope.name() + ".agg.opt." + ac.encodeColumns(),
ac.getClassName());
-      }
-    }
-    
-    return props;
-  }
-  
   public static Map<String,String> generateInitialTableProperties() {
     TreeMap<String,String> props = new TreeMap<String,String>();
     

Modified: accumulo/trunk/core/src/main/java/org/apache/accumulo/core/iterators/system/ColumnFamilySkippingIterator.java
URL: http://svn.apache.org/viewvc/accumulo/trunk/core/src/main/java/org/apache/accumulo/core/iterators/system/ColumnFamilySkippingIterator.java?rev=1333025&r1=1333024&r2=1333025&view=diff
==============================================================================
--- accumulo/trunk/core/src/main/java/org/apache/accumulo/core/iterators/system/ColumnFamilySkippingIterator.java
(original)
+++ accumulo/trunk/core/src/main/java/org/apache/accumulo/core/iterators/system/ColumnFamilySkippingIterator.java
Wed May  2 13:06:26 2012
@@ -18,7 +18,6 @@ package org.apache.accumulo.core.iterato
 
 import java.io.IOException;
 import java.util.Collection;
-import java.util.Collections;
 import java.util.HashSet;
 import java.util.Set;
 import java.util.TreeSet;
@@ -35,7 +34,6 @@ import org.apache.accumulo.core.iterator
 
 public class ColumnFamilySkippingIterator extends SkippingIterator implements InterruptibleIterator
{
   
-  private static final Collection<ByteSequence> EMPTY_SET = Collections.emptySet();
   protected Set<ByteSequence> colFamSet = null;
   protected TreeSet<ByteSequence> sortedColFams = null;
   

Modified: accumulo/trunk/core/src/main/java/org/apache/accumulo/core/util/shell/commands/SetIterCommand.java
URL: http://svn.apache.org/viewvc/accumulo/trunk/core/src/main/java/org/apache/accumulo/core/util/shell/commands/SetIterCommand.java?rev=1333025&r1=1333024&r2=1333025&view=diff
==============================================================================
--- accumulo/trunk/core/src/main/java/org/apache/accumulo/core/util/shell/commands/SetIterCommand.java
(original)
+++ accumulo/trunk/core/src/main/java/org/apache/accumulo/core/util/shell/commands/SetIterCommand.java
Wed May  2 13:06:26 2012
@@ -29,12 +29,10 @@ import org.apache.accumulo.core.client.A
 import org.apache.accumulo.core.client.AccumuloSecurityException;
 import org.apache.accumulo.core.client.IteratorSetting;
 import org.apache.accumulo.core.client.TableNotFoundException;
-import org.apache.accumulo.core.iterators.AggregatingIterator;
 import org.apache.accumulo.core.iterators.IteratorUtil.IteratorScope;
 import org.apache.accumulo.core.iterators.OptionDescriber;
 import org.apache.accumulo.core.iterators.OptionDescriber.IteratorOptions;
 import org.apache.accumulo.core.iterators.SortedKeyValueIterator;
-import org.apache.accumulo.core.iterators.aggregation.Aggregator;
 import org.apache.accumulo.core.iterators.user.AgeOffFilter;
 import org.apache.accumulo.core.iterators.user.RegExFilter;
 import org.apache.accumulo.core.iterators.user.ReqVisFilter;
@@ -52,7 +50,7 @@ import org.apache.commons.cli.Options;
 public class SetIterCommand extends Command {
   
   private Option tableOpt, mincScopeOpt, majcScopeOpt, scanScopeOpt, nameOpt, priorityOpt;
-  private Option aggTypeOpt, ageoffTypeOpt, regexTypeOpt, versionTypeOpt, reqvisTypeOpt,
classnameTypeOpt;
+  private Option ageoffTypeOpt, regexTypeOpt, versionTypeOpt, reqvisTypeOpt, classnameTypeOpt;
   
   public int execute(String fullCommand, CommandLine cl, Shell shellState) throws AccumuloException,
AccumuloSecurityException, TableNotFoundException,
       IOException, ShellCommandException {
@@ -74,10 +72,7 @@ public class SetIterCommand extends Comm
     
     Map<String,String> options = new HashMap<String,String>();
     String classname = cl.getOptionValue(classnameTypeOpt.getOpt());
-    if (cl.hasOption(aggTypeOpt.getOpt())) {
-      Shell.log.warn("aggregators are deprecated");
-      classname = AggregatingIterator.class.getName();
-    } else if (cl.hasOption(regexTypeOpt.getOpt()))
+    if (cl.hasOption(regexTypeOpt.getOpt()))
       classname = RegExFilter.class.getName();
     else if (cl.hasOption(ageoffTypeOpt.getOpt()))
       classname = AgeOffFilter.class.getName();
@@ -92,11 +87,6 @@ public class SetIterCommand extends Comm
     
     String name = cl.getOptionValue(nameOpt.getOpt(), setUpOptions(shellState.getReader(),
classname, options));
     
-    String aggregatorClass = options.get("aggregatorClass");
-    if (aggregatorClass != null && !shellState.getConnector().instanceOperations().testClassLoad(aggregatorClass,
Aggregator.class.getName()))
-      throw new ShellCommandException(ErrorCode.INITIALIZATION_FAILURE, "Servers are unable
to load " + aggregatorClass + " as type "
-          + Aggregator.class.getName());
-    
     setTableProperties(cl, shellState, tableName, priority, options, classname, name);
     
     return 0;
@@ -232,14 +222,12 @@ public class SetIterCommand extends Comm
     OptionGroup typeGroup = new OptionGroup();
     classnameTypeOpt = new Option("class", "class-name", true, "a java class type");
     classnameTypeOpt.setArgName("name");
-    aggTypeOpt = new Option("agg", "aggregator", false, "an aggregating type");
     regexTypeOpt = new Option("regex", "regular-expression", false, "a regex matching type");
     versionTypeOpt = new Option("vers", "version", false, "a versioning type");
     reqvisTypeOpt = new Option("reqvis", "require-visibility", false, "a type that omits
entries with empty visibilities");
     ageoffTypeOpt = new Option("ageoff", "ageoff", false, "an aging off type");
     
     typeGroup.addOption(classnameTypeOpt);
-    typeGroup.addOption(aggTypeOpt);
     typeGroup.addOption(regexTypeOpt);
     typeGroup.addOption(versionTypeOpt);
     typeGroup.addOption(reqvisTypeOpt);

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=1333025&r1=1333024&r2=1333025&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
Wed May  2 13:06:26 2012
@@ -29,7 +29,6 @@ import org.junit.Assert;
 import org.junit.Test;
 
 public class MockTableOperationsTest {
-  @SuppressWarnings("deprecation")
   @Test
   public void testTableNotFound() throws AccumuloException, AccumuloSecurityException, TableExistsException,
TableNotFoundException {
     Instance instance = new MockInstance("topstest");

Modified: accumulo/trunk/core/src/test/java/org/apache/accumulo/core/iterators/user/CombinerTest.java
URL: http://svn.apache.org/viewvc/accumulo/trunk/core/src/test/java/org/apache/accumulo/core/iterators/user/CombinerTest.java?rev=1333025&r1=1333024&r2=1333025&view=diff
==============================================================================
--- accumulo/trunk/core/src/test/java/org/apache/accumulo/core/iterators/user/CombinerTest.java
(original)
+++ accumulo/trunk/core/src/test/java/org/apache/accumulo/core/iterators/user/CombinerTest.java
Wed May  2 13:06:26 2012
@@ -44,9 +44,6 @@ import org.apache.accumulo.core.iterator
 import org.apache.accumulo.core.iterators.SortedMapIterator;
 import org.apache.accumulo.core.iterators.TypedValueCombiner;
 import org.apache.accumulo.core.iterators.TypedValueCombiner.Encoder;
-import org.apache.accumulo.core.iterators.aggregation.LongSummation;
-import org.apache.accumulo.core.iterators.aggregation.NumArraySummation;
-import org.apache.accumulo.core.iterators.aggregation.NumSummation;
 import org.apache.accumulo.core.iterators.system.MultiIterator;
 import org.apache.hadoop.io.Text;
 import org.junit.Assert;
@@ -755,33 +752,4 @@ public class CombinerTest {
     assertEquals(LongCombiner.safeAdd(Long.MAX_VALUE - 5, 5), Long.MAX_VALUE);
   }
   
-  /**
-   * @throws IOException
-   * @deprecated since 1.4
-   */
-  public void testCombinerCompatibility() throws IOException {
-    long[] la = {1l, 2l, 3l};
-    List<Long> ll = new ArrayList<Long>(Arrays.asList((Long) 1l, (Long) 2l, (Long)
3l));
-    assertEquals(ll, SummingArrayCombiner.VAR_LONG_ARRAY_ENCODER.decode(NumArraySummation.longArrayToBytes(la)));
-    assertEquals(la, NumArraySummation.bytesToLongArray(SummingArrayCombiner.VAR_LONG_ARRAY_ENCODER.encode(ll)));
-    testLongEncoding(42l);
-    testLongEncoding(Long.MAX_VALUE);
-    testLongEncoding(Long.MIN_VALUE);
-    testLongEncoding(0l);
-  }
-  
-  /**
-   * @throws IOException
-   * @deprecated since 1.4
-   */
-  public void testLongEncoding(long l) throws IOException {
-    assertEquals((Long) l, SummingCombiner.FIXED_LEN_ENCODER.decode(LongSummation.longToBytes(l)));
-    assertEquals(l, LongSummation.bytesToLong(SummingCombiner.FIXED_LEN_ENCODER.encode(l)));
-    
-    assertEquals((Long) l, SummingCombiner.VAR_LEN_ENCODER.decode(NumSummation.longToBytes(l)));
-    assertEquals(l, NumSummation.bytesToLong(SummingCombiner.VAR_LEN_ENCODER.encode(l)));
-    
-    assertEquals((Long) l, SummingCombiner.STRING_ENCODER.decode(Long.toString(l).getBytes()));
-    assertEquals(l, Long.parseLong(new String(SummingCombiner.STRING_ENCODER.encode(l))));
-  }
 }

Modified: accumulo/trunk/server/src/main/java/org/apache/accumulo/server/monitor/servlets/DefaultServlet.java
URL: http://svn.apache.org/viewvc/accumulo/trunk/server/src/main/java/org/apache/accumulo/server/monitor/servlets/DefaultServlet.java?rev=1333025&r1=1333024&r2=1333025&view=diff
==============================================================================
--- accumulo/trunk/server/src/main/java/org/apache/accumulo/server/monitor/servlets/DefaultServlet.java
(original)
+++ accumulo/trunk/server/src/main/java/org/apache/accumulo/server/monitor/servlets/DefaultServlet.java
Wed May  2 13:06:26 2012
@@ -151,12 +151,12 @@ public class DefaultServlet extends Basi
   public static final int GRAPH_WIDTH = 450;
   public static final int GRAPH_HEIGHT = 150;
   
-  @SuppressWarnings("unchecked")
   private static void plotData(StringBuilder sb, String title, @SuppressWarnings("rawtypes")
List data, boolean points) {
     plotData(sb, title, points, new ArrayList<String>(), data);
   }
   
-  private static void plotData(StringBuilder sb, String title, boolean points, List<String>
labels, @SuppressWarnings("rawtypes") List... series) {
+  @SuppressWarnings("rawtypes")
+  private static void plotData(StringBuilder sb, String title, boolean points, List<String>
labels, List... series) {
     sb.append("<div class=\"plotHeading\">");
     sb.append(title);
     sb.append("</div>");
@@ -169,6 +169,7 @@ public class DefaultServlet extends Basi
     
     for (int i = 0; i < series.length; i++) {
       
+      @SuppressWarnings("unchecked")
       List<Pair<Long,? extends Number>> data = series[i];
       sb.append("    var d" + i + " = [");
       



Mime
View raw message