accumulo-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ctubb...@apache.org
Subject svn commit: r1491946 - in /accumulo/branches/ACCUMULO-1496: ./ assemble/ bin/ core/ core/src/main/java/org/apache/accumulo/core/client/mock/ core/src/main/java/org/apache/accumulo/core/iterators/user/ core/src/test/java/org/apache/accumulo/core/client/...
Date Tue, 11 Jun 2013 20:30:55 GMT
Author: ctubbsii
Date: Tue Jun 11 20:30:54 2013
New Revision: 1491946

URL: http://svn.apache.org/r1491946
Log:
ACCUMULO-1496 merge latest trunk to feature branch; remove unnecessary classpath items from
bin/accumulo

Added:
    accumulo/branches/ACCUMULO-1496/core/src/main/java/org/apache/accumulo/core/iterators/user/BigDecimalCombiner.java
      - copied unchanged from r1491923, accumulo/trunk/core/src/main/java/org/apache/accumulo/core/iterators/user/BigDecimalCombiner.java
    accumulo/branches/ACCUMULO-1496/core/src/test/java/org/apache/accumulo/core/iterators/user/BigDecimalCombinerTest.java
      - copied unchanged from r1491923, accumulo/trunk/core/src/test/java/org/apache/accumulo/core/iterators/user/BigDecimalCombinerTest.java
Modified:
    accumulo/branches/ACCUMULO-1496/   (props changed)
    accumulo/branches/ACCUMULO-1496/assemble/   (props changed)
    accumulo/branches/ACCUMULO-1496/bin/accumulo
    accumulo/branches/ACCUMULO-1496/core/   (props changed)
    accumulo/branches/ACCUMULO-1496/core/src/main/java/org/apache/accumulo/core/client/mock/MockBatchWriter.java
    accumulo/branches/ACCUMULO-1496/core/src/main/java/org/apache/accumulo/core/client/mock/MockTable.java
    accumulo/branches/ACCUMULO-1496/core/src/test/java/org/apache/accumulo/core/client/mock/MockConnectorTest.java
    accumulo/branches/ACCUMULO-1496/examples/   (props changed)
    accumulo/branches/ACCUMULO-1496/fate/src/main/java/org/apache/accumulo/fate/ZooStore.java
  (props changed)
    accumulo/branches/ACCUMULO-1496/fate/src/main/java/org/apache/accumulo/fate/zookeeper/ZooSession.java
  (props changed)
    accumulo/branches/ACCUMULO-1496/pom.xml   (props changed)
    accumulo/branches/ACCUMULO-1496/proxy/README   (props changed)
    accumulo/branches/ACCUMULO-1496/server/   (props changed)
    accumulo/branches/ACCUMULO-1496/src/   (props changed)

Propchange: accumulo/branches/ACCUMULO-1496/
------------------------------------------------------------------------------
  Reverse-merged /accumulo/trunk:r1478775
  Merged /accumulo/trunk:r1491603-1491923
  Merged /accumulo/branches/1.5:r1491911

Propchange: accumulo/branches/ACCUMULO-1496/assemble/
------------------------------------------------------------------------------
  Merged /accumulo/trunk/assemble:r1491603-1491923

Modified: accumulo/branches/ACCUMULO-1496/bin/accumulo
URL: http://svn.apache.org/viewvc/accumulo/branches/ACCUMULO-1496/bin/accumulo?rev=1491946&r1=1491945&r2=1491946&view=diff
==============================================================================
--- accumulo/branches/ACCUMULO-1496/bin/accumulo (original)
+++ accumulo/branches/ACCUMULO-1496/bin/accumulo Tue Jun 11 20:30:54 2013
@@ -29,7 +29,6 @@ script=$( basename "$SOURCE" )
 . "$bin"/config.sh
 
 START_JAR=$ACCUMULO_HOME/lib/accumulo-start.jar
-SCANNOTATION_JARS=$ACCUMULO_HOME/lib/scannotation.jar:$ACCUMULO_HOME/lib/javassist.jar
 
 #
 # Resolve a program to its installation directory
@@ -82,7 +81,7 @@ esac
 
 XML_FILES=${ACCUMULO_HOME}/conf
 LOG4J_JAR=$(find $HADOOP_PREFIX/lib $HADOOP_PREFIX/share/hadoop/common/lib -name 'log4j*.jar'
-print 2>/dev/null | head -1)
-CLASSPATH=${XML_FILES}:${SCANNOTATION_JARS}:${START_JAR}:${LOG4J_JAR}
+CLASSPATH=${XML_FILES}:${START_JAR}:${LOG4J_JAR}
 
 if [ -z "$JAVA_HOME" -o ! -d "$JAVA_HOME" ]; then
    echo "JAVA_HOME is not set or is not a directory.  Please make sure it's set globally
or in conf/accumulo-env.sh"

Propchange: accumulo/branches/ACCUMULO-1496/core/
------------------------------------------------------------------------------
  Reverse-merged /accumulo/trunk/core:r1478775
  Merged /accumulo/trunk/core:r1491603-1491923
  Merged /accumulo/branches/1.5/core:r1491911
  Merged /accumulo/branches/1.4/src/core:r1491900

Modified: accumulo/branches/ACCUMULO-1496/core/src/main/java/org/apache/accumulo/core/client/mock/MockBatchWriter.java
URL: http://svn.apache.org/viewvc/accumulo/branches/ACCUMULO-1496/core/src/main/java/org/apache/accumulo/core/client/mock/MockBatchWriter.java?rev=1491946&r1=1491945&r2=1491946&view=diff
==============================================================================
--- accumulo/branches/ACCUMULO-1496/core/src/main/java/org/apache/accumulo/core/client/mock/MockBatchWriter.java
(original)
+++ accumulo/branches/ACCUMULO-1496/core/src/main/java/org/apache/accumulo/core/client/mock/MockBatchWriter.java
Tue Jun 11 20:30:54 2013
@@ -19,6 +19,7 @@ package org.apache.accumulo.core.client.
 import org.apache.accumulo.core.client.BatchWriter;
 import org.apache.accumulo.core.client.MutationsRejectedException;
 import org.apache.accumulo.core.data.Mutation;
+import org.apache.accumulo.core.util.ArgumentChecker;
 
 public class MockBatchWriter implements BatchWriter {
   
@@ -32,11 +33,13 @@ public class MockBatchWriter implements 
   
   @Override
   public void addMutation(Mutation m) throws MutationsRejectedException {
+    ArgumentChecker.notNull(m);
     acu.addMutation(tablename, m);
   }
   
   @Override
   public void addMutations(Iterable<Mutation> iterable) throws MutationsRejectedException
{
+    ArgumentChecker.notNull(iterable);
     for (Mutation m : iterable) {
       acu.addMutation(tablename, m);
     }

Modified: accumulo/branches/ACCUMULO-1496/core/src/main/java/org/apache/accumulo/core/client/mock/MockTable.java
URL: http://svn.apache.org/viewvc/accumulo/branches/ACCUMULO-1496/core/src/main/java/org/apache/accumulo/core/client/mock/MockTable.java?rev=1491946&r1=1491945&r2=1491946&view=diff
==============================================================================
--- accumulo/branches/ACCUMULO-1496/core/src/main/java/org/apache/accumulo/core/client/mock/MockTable.java
(original)
+++ accumulo/branches/ACCUMULO-1496/core/src/main/java/org/apache/accumulo/core/client/mock/MockTable.java
Tue Jun 11 20:30:54 2013
@@ -101,6 +101,8 @@ public class MockTable {
   }
   
   synchronized void addMutation(Mutation m) {
+    if (m.size() == 0)
+      throw new IllegalArgumentException("Can not add empty mutations");
     long now = System.currentTimeMillis();
     mutationCount++;
     for (ColumnUpdate u : m.getUpdates()) {

Modified: accumulo/branches/ACCUMULO-1496/core/src/test/java/org/apache/accumulo/core/client/mock/MockConnectorTest.java
URL: http://svn.apache.org/viewvc/accumulo/branches/ACCUMULO-1496/core/src/test/java/org/apache/accumulo/core/client/mock/MockConnectorTest.java?rev=1491946&r1=1491945&r2=1491946&view=diff
==============================================================================
--- accumulo/branches/ACCUMULO-1496/core/src/test/java/org/apache/accumulo/core/client/mock/MockConnectorTest.java
(original)
+++ accumulo/branches/ACCUMULO-1496/core/src/test/java/org/apache/accumulo/core/client/mock/MockConnectorTest.java
Tue Jun 11 20:30:54 2013
@@ -20,9 +20,12 @@ import static org.junit.Assert.assertEqu
 import static org.junit.Assert.assertFalse;
 import static org.junit.Assert.assertTrue;
 
+import java.util.ArrayList;
 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 org.apache.accumulo.core.Constants;
@@ -46,6 +49,7 @@ import org.apache.accumulo.core.iterator
 import org.apache.accumulo.core.iterators.user.SummingCombiner;
 import org.apache.accumulo.core.security.Authorizations;
 import org.apache.hadoop.io.Text;
+import org.junit.Assert;
 import org.junit.Test;
 
 public class MockConnectorTest {
@@ -94,6 +98,43 @@ public class MockConnectorTest {
   }
   
   @Test
+  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));
+
+    try {
+      bw.addMutation(null);
+      Assert.fail("addMutation should throw IAE for null mutation");
+    } catch (IllegalArgumentException iae) {}
+    try {
+      bw.addMutations(null);
+      Assert.fail("addMutations should throw IAE for null iterable");
+    } catch (IllegalArgumentException iae) {}
+
+    bw.addMutations(Collections.<Mutation>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<Mutation> mutations = new ArrayList<Mutation>();
+    mutations.add(good);
+    mutations.add(bad);
+    try {
+      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();
     Connector c = mockInstance.getConnector("root", new PasswordToken(""));

Propchange: accumulo/branches/ACCUMULO-1496/examples/
------------------------------------------------------------------------------
  Merged /accumulo/trunk/examples:r1491603-1491923

Propchange: accumulo/branches/ACCUMULO-1496/fate/src/main/java/org/apache/accumulo/fate/ZooStore.java
------------------------------------------------------------------------------
  Merged /accumulo/trunk/fate/src/main/java/org/apache/accumulo/fate/ZooStore.java:r1491603-1491923

Propchange: accumulo/branches/ACCUMULO-1496/fate/src/main/java/org/apache/accumulo/fate/zookeeper/ZooSession.java
------------------------------------------------------------------------------
  Merged /accumulo/trunk/fate/src/main/java/org/apache/accumulo/fate/zookeeper/ZooSession.java:r1491603-1491923

Propchange: accumulo/branches/ACCUMULO-1496/pom.xml
------------------------------------------------------------------------------
  Merged /accumulo/trunk/pom.xml:r1491603-1491923

Propchange: accumulo/branches/ACCUMULO-1496/proxy/README
------------------------------------------------------------------------------
  Merged /accumulo/trunk/proxy/README:r1491603-1491923

Propchange: accumulo/branches/ACCUMULO-1496/server/
------------------------------------------------------------------------------
  Merged /accumulo/trunk/server:r1491603-1491923

Propchange: accumulo/branches/ACCUMULO-1496/src/
------------------------------------------------------------------------------
  Merged /accumulo/trunk/src:r1491603-1491923



Mime
View raw message