accumulo-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From e..@apache.org
Subject svn commit: r1332780 - in /accumulo/trunk: core/src/main/java/org/apache/accumulo/core/client/admin/ core/src/main/java/org/apache/accumulo/core/client/mock/ core/src/main/java/org/apache/accumulo/core/util/shell/commands/ core/src/test/java/org/apache...
Date Tue, 01 May 2012 19:06:47 GMT
Author: ecn
Date: Tue May  1 19:06:46 2012
New Revision: 1332780

URL: http://svn.apache.org/viewvc?rev=1332780&view=rev
Log:
ACCUMULO-555 remove deprecated apis for compactTable and aggregators

Modified:
    accumulo/trunk/core/src/main/java/org/apache/accumulo/core/client/admin/TableOperations.java
    accumulo/trunk/core/src/main/java/org/apache/accumulo/core/client/admin/TableOperationsImpl.java
    accumulo/trunk/core/src/main/java/org/apache/accumulo/core/client/mock/MockTableOperations.java
    accumulo/trunk/core/src/main/java/org/apache/accumulo/core/util/shell/commands/CreateTableCommand.java
    accumulo/trunk/core/src/test/java/org/apache/accumulo/core/client/admin/TableOperationsHelperTest.java
    accumulo/trunk/core/src/test/java/org/apache/accumulo/core/client/mock/MockTableOperationsTest.java
    accumulo/trunk/test/system/auto/simple/shell.py

Modified: accumulo/trunk/core/src/main/java/org/apache/accumulo/core/client/admin/TableOperations.java
URL: http://svn.apache.org/viewvc/accumulo/trunk/core/src/main/java/org/apache/accumulo/core/client/admin/TableOperations.java?rev=1332780&r1=1332779&r2=1332780&view=diff
==============================================================================
--- accumulo/trunk/core/src/main/java/org/apache/accumulo/core/client/admin/TableOperations.java
(original)
+++ accumulo/trunk/core/src/main/java/org/apache/accumulo/core/client/admin/TableOperations.java
Tue May  1 19:06:46 2012
@@ -19,7 +19,6 @@ package org.apache.accumulo.core.client.
 import java.io.IOException;
 import java.util.Collection;
 import java.util.EnumSet;
-import java.util.List;
 import java.util.Map;
 import java.util.Map.Entry;
 import java.util.Set;
@@ -32,9 +31,7 @@ import org.apache.accumulo.core.client.T
 import org.apache.accumulo.core.client.TableNotFoundException;
 import org.apache.accumulo.core.data.Range;
 import org.apache.accumulo.core.iterators.IteratorUtil.IteratorScope;
-import org.apache.accumulo.core.iterators.conf.PerColumnIteratorConfig;
 import org.apache.accumulo.core.security.Authorizations;
-import org.apache.accumulo.core.util.BulkImportHelper.AssignmentStats;
 import org.apache.hadoop.io.Text;
 
 /**
@@ -102,23 +99,6 @@ public interface TableOperations {
   /**
    * @param tableName
    *          the name of the table
-   * @param aggregators
-   *          List of aggregators to add
-   * @throws AccumuloSecurityException
-   *           if insufficient permissions to do action
-   * @throws TableNotFoundException
-   *           if table does not exist
-   * @throws AccumuloException
-   *           if a general error occurs
-   * 
-   * @deprecated since 1.4 {@link #attachIterator(String, IteratorSetting)}
-   */
-  public void addAggregators(String tableName, List<? extends PerColumnIteratorConfig>
aggregators) throws AccumuloSecurityException, TableNotFoundException,
-      AccumuloException;
-  
-  /**
-   * @param tableName
-   *          the name of the table
    * @param partitionKeys
    *          a sorted set of row key values to pre-split the table on
    * @throws AccumuloException
@@ -411,12 +391,6 @@ public interface TableOperations {
       AccumuloSecurityException;
   
   /**
-   * @deprecated Since 1.4 use {@link #importDirectory(String, String, String, boolean)}
-   */
-  public AssignmentStats importDirectory(String tableName, String dir, String failureDir,
int numThreads, int numAssignThreads, boolean disableGC)
-      throws IOException, AccumuloException, AccumuloSecurityException;
-  
-  /**
    * 
    * @param tableName
    *          the table to take offline

Modified: accumulo/trunk/core/src/main/java/org/apache/accumulo/core/client/admin/TableOperationsImpl.java
URL: http://svn.apache.org/viewvc/accumulo/trunk/core/src/main/java/org/apache/accumulo/core/client/admin/TableOperationsImpl.java?rev=1332780&r1=1332779&r2=1332780&view=diff
==============================================================================
--- accumulo/trunk/core/src/main/java/org/apache/accumulo/core/client/admin/TableOperationsImpl.java
(original)
+++ accumulo/trunk/core/src/main/java/org/apache/accumulo/core/client/admin/TableOperationsImpl.java
Tue May  1 19:06:46 2012
@@ -37,7 +37,6 @@ import org.apache.accumulo.core.Constant
 import org.apache.accumulo.core.client.AccumuloException;
 import org.apache.accumulo.core.client.AccumuloSecurityException;
 import org.apache.accumulo.core.client.Instance;
-import org.apache.accumulo.core.client.IteratorSetting;
 import org.apache.accumulo.core.client.Scanner;
 import org.apache.accumulo.core.client.TableDeletedException;
 import org.apache.accumulo.core.client.TableExistsException;
@@ -69,7 +68,6 @@ import org.apache.accumulo.core.security
 import org.apache.accumulo.core.tabletserver.thrift.NotServingTabletException;
 import org.apache.accumulo.core.tabletserver.thrift.TabletClientService;
 import org.apache.accumulo.core.util.ArgumentChecker;
-import org.apache.accumulo.core.util.BulkImportHelper.AssignmentStats;
 import org.apache.accumulo.core.util.CachedConfiguration;
 import org.apache.accumulo.core.util.LocalityGroupUtil;
 import org.apache.accumulo.core.util.MetadataTable;
@@ -896,31 +894,6 @@ public class TableOperationsImpl extends
     return ranges;
   }
   
-  /**
-   * @deprecated since 1.4 {@link #importDirectory(String, String, String, boolean)}
-   */
-  @Override
-  public AssignmentStats importDirectory(String tableName, String dir, String failureDir,
int numThreads, int numAssignThreads, boolean disableGC)
-      throws IOException, AccumuloException, AccumuloSecurityException {
-    FileSystem fs = FileSystem.get(CachedConfiguration.getInstance());
-    Path failPath = new Path(failureDir);
-    FileStatus[] listStatus = fs.listStatus(failPath);
-    if (fs.exists(failPath) && listStatus != null && listStatus.length !=
0)
-      throw new AccumuloException("Failure directory exists, and is not empty");
-    if (!fs.exists(failPath))
-      fs.mkdirs(failPath);
-    
-    try {
-      importDirectory(tableName, dir, failureDir, false);
-    } catch (TableNotFoundException ex) {
-      throw new RuntimeException(ex);
-    }
-    // Fake this for backwards compatibility
-    return new AssignmentStats();
-    // return new BulkImportHelper(instance, credentials, tableName).importDirectory(new
Path(dir), new Path(failureDir), numThreads, numAssignThreads,
-    // disableGC);
-  }
-  
   @Override
   public void importDirectory(String tableName, String dir, String failureDir, boolean setTime)
throws IOException, AccumuloSecurityException,
       TableNotFoundException, AccumuloException {
@@ -1029,47 +1002,4 @@ public class TableOperationsImpl extends
     Scanner scanner = instance.getConnector(credentials).createScanner(tableName, auths);
     return FindMax.findMax(scanner, startRow, startInclusive, endRow, endInclusive);
   }
-  
-  /**
-   * @param tableName
-   *          the name of the table
-   * @param aggregators
-   *          List of aggregators to add
-   * @throws AccumuloSecurityException
-   *           if insufficient permissions to do action
-   * @throws TableNotFoundException
-   *           if table does not exist
-   * @throws AccumuloException
-   *           if a general error occurs
-   * 
-   * @deprecated since 1.4 {@link #attachIterator(String, IteratorSetting)}
-   */
-  @Override
-  public void addAggregators(String tableName, List<? extends org.apache.accumulo.core.iterators.conf.PerColumnIteratorConfig>
aggregators)
-      throws AccumuloSecurityException, TableNotFoundException,
-      AccumuloException {
-    ArgumentChecker.notNull(tableName, aggregators);
-    MasterClientService.Iface client = null;
-    try {
-      client = MasterClient.getConnectionWithRetry(instance);
-      for (Entry<String,String> entry : IteratorUtil.generateAggTableProperties(aggregators).entrySet())
{
-        client.setTableProperty(null, credentials, tableName, entry.getKey(), entry.getValue());
-      }
-    } catch (ThriftSecurityException e) {
-      throw new AccumuloSecurityException(e.user, e.code, e);
-    } catch (ThriftTableOperationException e) {
-      switch (e.getType()) {
-        case EXISTS:
-          throw new TableNotFoundException(e);
-        case OTHER:
-        default:
-          throw new AccumuloException(e.getMessage(), e);
-      }
-    } catch (Exception e) {
-      throw new AccumuloException(e.getMessage(), e);
-    } finally {
-      MasterClient.close(client);
-    }
-  }
-  
 }

Modified: accumulo/trunk/core/src/main/java/org/apache/accumulo/core/client/mock/MockTableOperations.java
URL: http://svn.apache.org/viewvc/accumulo/trunk/core/src/main/java/org/apache/accumulo/core/client/mock/MockTableOperations.java?rev=1332780&r1=1332779&r2=1332780&view=diff
==============================================================================
--- accumulo/trunk/core/src/main/java/org/apache/accumulo/core/client/mock/MockTableOperations.java
(original)
+++ accumulo/trunk/core/src/main/java/org/apache/accumulo/core/client/mock/MockTableOperations.java
Tue May  1 19:06:46 2012
@@ -20,7 +20,6 @@ import java.io.IOException;
 import java.util.Collection;
 import java.util.Collections;
 import java.util.HashMap;
-import java.util.List;
 import java.util.Map;
 import java.util.Map.Entry;
 import java.util.Set;
@@ -30,16 +29,13 @@ import java.util.TreeSet;
 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;
 import org.apache.accumulo.core.client.TableExistsException;
 import org.apache.accumulo.core.client.TableNotFoundException;
 import org.apache.accumulo.core.client.admin.FindMax;
 import org.apache.accumulo.core.client.admin.TableOperationsHelper;
 import org.apache.accumulo.core.client.admin.TimeType;
 import org.apache.accumulo.core.data.Range;
-import org.apache.accumulo.core.iterators.conf.PerColumnIteratorConfig;
 import org.apache.accumulo.core.security.Authorizations;
-import org.apache.accumulo.core.util.BulkImportHelper.AssignmentStats;
 import org.apache.commons.lang.NotImplementedException;
 import org.apache.hadoop.io.Text;
 
@@ -86,17 +82,6 @@ public class MockTableOperations extends
     acu.createTable(username, tableName, versioningIter, timeType);
   }
   
-  /**
-   * @deprecated since 1.4 {@link #attachIterator(String, IteratorSetting)}
-   */
-  @Override
-  public void addAggregators(String tableName, List<? extends PerColumnIteratorConfig>
aggregators) throws AccumuloSecurityException, TableNotFoundException,
-      AccumuloException {
-    if (!exists(tableName))
-      throw new TableNotFoundException(tableName, tableName, "");
-    acu.addAggregators(tableName, aggregators);
-  }
-  
   @Override
   public void addSplits(String tableName, SortedSet<Text> partitionKeys) throws TableNotFoundException,
AccumuloException, AccumuloSecurityException {
     throw new NotImplementedException();
@@ -169,12 +154,6 @@ public class MockTableOperations extends
   }
   
   @Override
-  public AssignmentStats importDirectory(String tableName, String dir, String failureDir,
int numThreads, int numAssignThreads, boolean disableGC)
-      throws IOException, AccumuloException, AccumuloSecurityException {
-    throw new NotImplementedException();
-  }
-  
-  @Override
   public void importDirectory(String tableName, String dir, String failureDir, boolean setTime)
throws IOException, AccumuloException,
       AccumuloSecurityException, TableNotFoundException {
     throw new NotImplementedException();

Modified: accumulo/trunk/core/src/main/java/org/apache/accumulo/core/util/shell/commands/CreateTableCommand.java
URL: http://svn.apache.org/viewvc/accumulo/trunk/core/src/main/java/org/apache/accumulo/core/util/shell/commands/CreateTableCommand.java?rev=1332780&r1=1332779&r2=1332780&view=diff
==============================================================================
--- accumulo/trunk/core/src/main/java/org/apache/accumulo/core/util/shell/commands/CreateTableCommand.java
(original)
+++ accumulo/trunk/core/src/main/java/org/apache/accumulo/core/util/shell/commands/CreateTableCommand.java
Tue May  1 19:06:46 2012
@@ -18,9 +18,6 @@ package org.apache.accumulo.core.util.sh
 
 import java.io.File;
 import java.io.IOException;
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
 import java.util.Map.Entry;
 import java.util.SortedSet;
 import java.util.TreeSet;
@@ -33,9 +30,7 @@ import org.apache.accumulo.core.client.T
 import org.apache.accumulo.core.client.admin.TimeType;
 import org.apache.accumulo.core.conf.Property;
 import org.apache.accumulo.core.iterators.IteratorUtil;
-import org.apache.accumulo.core.iterators.conf.PerColumnIteratorConfig;
 import org.apache.accumulo.core.security.VisibilityConstraint;
-import org.apache.accumulo.core.util.BadArgumentException;
 import org.apache.accumulo.core.util.shell.Shell;
 import org.apache.accumulo.core.util.shell.Shell.Command;
 import org.apache.commons.cli.CommandLine;
@@ -49,7 +44,6 @@ public class CreateTableCommand extends 
   private Option createTableOptCopySplits;
   private Option createTableOptCopyConfig;
   private Option createTableOptSplit;
-  private Option createTableOptAgg;
   private Option createTableOptTimeLogical;
   private Option createTableOptTimeMillis;
   private Option createTableNoDefaultIters;
@@ -73,35 +67,8 @@ public class CreateTableCommand extends 
       throw new TableExistsException(null, tableName, null);
     
     SortedSet<Text> partitions = new TreeSet<Text>();
-    List<PerColumnIteratorConfig> aggregators = new ArrayList<PerColumnIteratorConfig>();
     boolean decode = cl.hasOption(base64Opt.getOpt());
     
-    if (cl.hasOption(createTableOptAgg.getOpt())) {
-      Shell.log.warn("aggregators are deprecated");
-      String agg = cl.getOptionValue(createTableOptAgg.getOpt());
-      
-      EscapeTokenizer st = new EscapeTokenizer(agg, "=,");
-      if (st.count() % 2 != 0) {
-        printHelp();
-        return 0;
-      }
-      Iterator<String> iter = st.iterator();
-      while (iter.hasNext()) {
-        String col = iter.next();
-        String className = iter.next();
-        
-        EscapeTokenizer colToks = new EscapeTokenizer(col, ":");
-        Iterator<String> tokIter = colToks.iterator();
-        Text cf = null, cq = null;
-        if (colToks.count() < 1 || colToks.count() > 2)
-          throw new BadArgumentException("column must be in the format cf[:cq]", fullCommand,
fullCommand.indexOf(col));
-        cf = new Text(tokIter.next());
-        if (colToks.count() == 2)
-          cq = new Text(tokIter.next());
-        
-        aggregators.add(new PerColumnIteratorConfig(cf, cq, className));
-      }
-    }
     if (cl.hasOption(createTableOptSplit.getOpt())) {
       String f = cl.getOptionValue(createTableOptSplit.getOpt());
       
@@ -133,8 +100,6 @@ public class CreateTableCommand extends 
     shellState.getConnector().tableOperations().create(tableName, true, timeType);
     if (partitions.size() > 0)
       shellState.getConnector().tableOperations().addSplits(tableName, partitions);
-    if (aggregators.size() > 0)
-      shellState.getConnector().tableOperations().addAggregators(tableName, aggregators);
     
     shellState.setTableName(tableName); // switch shell to new table
     // context
@@ -204,7 +169,6 @@ public class CreateTableCommand extends 
     createTableOptCopyConfig = new Option("cc", "copy-config", true, "table to copy configuration
from");
     createTableOptCopySplits = new Option("cs", "copy-splits", true, "table to copy current
splits from");
     createTableOptSplit = new Option("sf", "splits-file", true, "file with newline separated
list of rows to create a pre-split table");
-    createTableOptAgg = new Option("a", "aggregator", true, "comma separated column=aggregator");
     createTableOptTimeLogical = new Option("tl", "time-logical", false, "use logical time");
     createTableOptTimeMillis = new Option("tm", "time-millis", false, "use time in milliseconds");
     createTableNoDefaultIters = new Option("ndi", "no-default-iterators", false, "prevents
creation of the normal default iterator set");
@@ -215,7 +179,6 @@ public class CreateTableCommand extends 
     createTableOptCopyConfig.setArgName("table");
     createTableOptCopySplits.setArgName("table");
     createTableOptSplit.setArgName("filename");
-    createTableOptAgg.setArgName("{<columnfamily>[:<columnqualifier>]=<aggregation
class>}");
     createTableOptFormatter.setArgName("className");
     
     // Splits and CopySplits are put in an optionsgroup to make them
@@ -234,7 +197,6 @@ public class CreateTableCommand extends 
     o.addOptionGroup(splitOrCopySplit);
     o.addOptionGroup(timeGroup);
     o.addOption(createTableOptSplit);
-    o.addOption(createTableOptAgg);
     o.addOption(createTableOptCopyConfig);
     o.addOption(createTableNoDefaultIters);
     o.addOption(createTableOptEVC);

Modified: accumulo/trunk/core/src/test/java/org/apache/accumulo/core/client/admin/TableOperationsHelperTest.java
URL: http://svn.apache.org/viewvc/accumulo/trunk/core/src/test/java/org/apache/accumulo/core/client/admin/TableOperationsHelperTest.java?rev=1332780&r1=1332779&r2=1332780&view=diff
==============================================================================
--- accumulo/trunk/core/src/test/java/org/apache/accumulo/core/client/admin/TableOperationsHelperTest.java
(original)
+++ accumulo/trunk/core/src/test/java/org/apache/accumulo/core/client/admin/TableOperationsHelperTest.java
Tue May  1 19:06:46 2012
@@ -21,7 +21,6 @@ import java.util.Collection;
 import java.util.Collections;
 import java.util.EnumSet;
 import java.util.HashMap;
-import java.util.List;
 import java.util.Map;
 import java.util.Map.Entry;
 import java.util.Set;
@@ -35,9 +34,7 @@ import org.apache.accumulo.core.client.T
 import org.apache.accumulo.core.client.TableNotFoundException;
 import org.apache.accumulo.core.data.Range;
 import org.apache.accumulo.core.iterators.IteratorUtil.IteratorScope;
-import org.apache.accumulo.core.iterators.conf.PerColumnIteratorConfig;
 import org.apache.accumulo.core.security.Authorizations;
-import org.apache.accumulo.core.util.BulkImportHelper.AssignmentStats;
 import org.apache.hadoop.io.Text;
 import org.junit.Assert;
 import org.junit.Test;
@@ -157,12 +154,6 @@ public class TableOperationsHelperTest {
         AccumuloException, AccumuloSecurityException {}
     
     @Override
-    public AssignmentStats importDirectory(String tableName, String dir, String failureDir,
int numThreads, int numAssignThreads, boolean disableGC)
-        throws IOException, AccumuloException, AccumuloSecurityException {
-      return null;
-    }
-    
-    @Override
     public void offline(String tableName) throws AccumuloSecurityException, AccumuloException,
TableNotFoundException {
       
     }
@@ -187,12 +178,6 @@ public class TableOperationsHelperTest {
       Assert.assertEquals(expected, settings.get(tablename));
     }
     
-    /**
-     * @deprecated since 1.4 {@link #attachIterator(String, IteratorSetting)}
-     */
-    @Override
-    public void addAggregators(String tableName, List<? extends PerColumnIteratorConfig>
aggregators) throws AccumuloSecurityException, TableNotFoundException,
-        AccumuloException {}
   }
   
   @Test

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=1332780&r1=1332779&r2=1332780&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
Tue May  1 19:06:46 2012
@@ -36,10 +36,6 @@ public class MockTableOperationsTest {
     Connector conn = instance.getConnector("user", "pass");
     String t = "tableName";
     try {
-      conn.tableOperations().addAggregators(t, null);
-      Assert.fail();
-    } catch (TableNotFoundException e) {}
-    try {
       conn.tableOperations().attachIterator(t, null);
       Assert.fail();
     } catch (TableNotFoundException e) {}

Modified: accumulo/trunk/test/system/auto/simple/shell.py
URL: http://svn.apache.org/viewvc/accumulo/trunk/test/system/auto/simple/shell.py?rev=1332780&r1=1332779&r2=1332780&view=diff
==============================================================================
--- accumulo/trunk/test/system/auto/simple/shell.py (original)
+++ accumulo/trunk/test/system/auto/simple/shell.py Tue May  1 19:06:46 2012
@@ -38,7 +38,6 @@ class ShellTest(TestUtilsMixin,unittest.
     def runTest(self):
         self.setIterTest()
         self.setScanIterTest()
-        self.aggTest()
         self.iteratorsTest()
         self.createtableTestSplits()
         self.createtableTestCopyConfig()
@@ -119,16 +118,6 @@ class ShellTest(TestUtilsMixin,unittest.
         self.failUnless(out.find("IllegalArgumentException") >= 0,
                         "Was able to configure same priority twice")
         
-    def aggTest(self):
-        input = 'createtable aggtest\nsetiter -t aggtest -n myagg -scan -p 10 -class org.apache.accumulo.core.iterators.user.SummingCombiner\n\ns\n\nSTRING\n\nquit\n'
-        out,err,code = self.rootShell(self.masterHost(),input)
-        self.processResult(out, err, code)
-        input = 'table aggtest\ninsert row1 s c 10\ninsert row1 s c 30\nscan -np\n'
-        out,err,code = self.rootShell(self.masterHost(),input)
-        self.processResult(out, err, code)
-        self.failIf(out.find("row1 s:c []    40") == -1, 
-                        "Config Failed:  aggregation failed")
-        
     def classpathTest(self):
         input = 'classpath\n'
         out,err,code = self.rootShell(self.masterHost(),input)



Mime
View raw message