You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@accumulo.apache.org by ec...@apache.org on 2012/01/24 23:09:33 UTC
svn commit: r1235525 - in /incubator/accumulo/trunk: ./ src/core/
src/core/src/main/java/org/apache/accumulo/core/client/
src/core/src/main/java/org/apache/accumulo/core/client/admin/
src/core/src/main/java/org/apache/accumulo/core/iterators/ src/core/...
Author: ecn
Date: Tue Jan 24 22:09:32 2012
New Revision: 1235525
URL: http://svn.apache.org/viewvc?rev=1235525&view=rev
Log:
ACCUMULO-345 merge to trunk
Added:
incubator/accumulo/trunk/src/server/src/main/java/org/apache/accumulo/server/test/functional/DeleteRowsSplitTest.java
- copied unchanged from r1235524, incubator/accumulo/branches/1.4/src/server/src/main/java/org/apache/accumulo/server/test/functional/DeleteRowsSplitTest.java
Modified:
incubator/accumulo/trunk/ (props changed)
incubator/accumulo/trunk/src/core/ (props changed)
incubator/accumulo/trunk/src/core/src/main/java/org/apache/accumulo/core/client/IteratorSetting.java
incubator/accumulo/trunk/src/core/src/main/java/org/apache/accumulo/core/client/admin/TableOperations.java
incubator/accumulo/trunk/src/core/src/main/java/org/apache/accumulo/core/client/admin/TableOperationsHelper.java
incubator/accumulo/trunk/src/core/src/main/java/org/apache/accumulo/core/iterators/IteratorUtil.java
incubator/accumulo/trunk/src/core/src/main/java/org/apache/accumulo/core/util/shell/commands/SetIterCommand.java
incubator/accumulo/trunk/src/core/src/test/java/org/apache/accumulo/core/client/admin/TableOperationsHelperTest.java
incubator/accumulo/trunk/src/core/src/test/java/org/apache/accumulo/core/client/mock/MockTableOperationsTest.java
incubator/accumulo/trunk/src/examples/wikisearch/query/src/test/java/org/apache/accumulo/examples/wikisearch/logic/TestQueryLogic.java
incubator/accumulo/trunk/src/server/ (props changed)
incubator/accumulo/trunk/src/server/src/main/java/org/apache/accumulo/server/tabletserver/Tablet.java
incubator/accumulo/trunk/src/server/src/main/java/org/apache/accumulo/server/test/randomwalk/bulk/BulkPlusOne.java
incubator/accumulo/trunk/src/server/src/main/java/org/apache/accumulo/server/test/randomwalk/bulk/ConsistencyCheck.java
incubator/accumulo/trunk/src/server/src/main/java/org/apache/accumulo/server/test/randomwalk/bulk/Setup.java
incubator/accumulo/trunk/src/server/src/main/java/org/apache/accumulo/server/test/randomwalk/bulk/Verify.java
incubator/accumulo/trunk/test/system/auto/simple/deleterows.py
incubator/accumulo/trunk/test/system/randomwalk/README
incubator/accumulo/trunk/test/system/randomwalk/bin/copy-config.sh
incubator/accumulo/trunk/test/system/randomwalk/bin/kill-all.sh
incubator/accumulo/trunk/test/system/randomwalk/bin/reset-cluster.sh
incubator/accumulo/trunk/test/system/randomwalk/bin/start-all.sh
incubator/accumulo/trunk/test/system/randomwalk/bin/start-local.sh
incubator/accumulo/trunk/test/system/randomwalk/conf/ (props changed)
Propchange: incubator/accumulo/trunk/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Tue Jan 24 22:09:32 2012
@@ -1,3 +1,3 @@
/incubator/accumulo/branches/1.3:1190280,1190413,1190420,1190427,1190500,1195622,1195625,1195629,1195635,1196044,1196054,1196057,1196071-1196072,1196106,1197066,1198935,1199383,1203683,1204625,1205547,1205880,1206169,1208031,1209124,1209526,1209532,1209539,1209541,1209587,1209657,1210518,1210571,1210596,1210598,1213424,1214320,1225006,1227215,1227231,1227611,1228195,1230180,1230736,1231043
/incubator/accumulo/branches/1.3.5rc:1209938
-/incubator/accumulo/branches/1.4:1201902-1235463
+/incubator/accumulo/branches/1.4:1201902-1235524
Propchange: incubator/accumulo/trunk/src/core/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Tue Jan 24 22:09:32 2012
@@ -1,3 +1,3 @@
-/incubator/accumulo/branches/1.3.5rc/src/core:1209938
/incubator/accumulo/branches/1.3/src/core:1190280,1190413,1190420,1190427,1190500,1195622,1195625,1195629,1195635,1196044,1196054,1196057,1196071-1196072,1196106,1197066,1198935,1199383,1203683,1204625,1205547,1205880,1206169,1208031,1209124,1209526,1209532,1209539,1209541,1209587,1209657,1210518,1210571,1210596,1210598,1213424,1214320,1225006,1227215
-/incubator/accumulo/branches/1.4/src/core:1201902-1235463
+/incubator/accumulo/branches/1.3.5rc/src/core:1209938
+/incubator/accumulo/branches/1.4/src/core:1201902-1235524
Modified: incubator/accumulo/trunk/src/core/src/main/java/org/apache/accumulo/core/client/IteratorSetting.java
URL: http://svn.apache.org/viewvc/incubator/accumulo/trunk/src/core/src/main/java/org/apache/accumulo/core/client/IteratorSetting.java?rev=1235525&r1=1235524&r2=1235525&view=diff
==============================================================================
--- incubator/accumulo/trunk/src/core/src/main/java/org/apache/accumulo/core/client/IteratorSetting.java (original)
+++ incubator/accumulo/trunk/src/core/src/main/java/org/apache/accumulo/core/client/IteratorSetting.java Tue Jan 24 22:09:32 2012
@@ -47,7 +47,6 @@ public class IteratorSetting {
private int priority;
private String name;
private String iteratorClass;
- private EnumSet<IteratorScope> scopes;
private Map<String,String> properties;
/**
@@ -111,28 +110,6 @@ public class IteratorSetting {
}
/**
- * Get the scopes under which this iterator will be configured.
- *
- * @return the scopes
- */
- public EnumSet<IteratorScope> getScopes() {
- return scopes;
- }
-
- /**
- * Set the scopes under which this iterator will be configured.
- *
- * @param scopes
- * the scopes to set
- */
- public void setScopes(EnumSet<IteratorScope> scopes) {
- ArgumentChecker.notNull(scopes);
- if (scopes.isEmpty())
- throw new IllegalArgumentException("empty scopes");
- this.scopes = scopes;
- }
-
- /**
* Get the configuration parameters for this iterator.
*
* @return the properties
@@ -170,7 +147,7 @@ public class IteratorSetting {
* the fully qualified class name for the iterator
*/
public IteratorSetting(int priority, String name, String iteratorClass) {
- this(priority, name, iteratorClass, EnumSet.of(IteratorScope.scan), new HashMap<String,String>());
+ this(priority, name, iteratorClass, new HashMap<String,String>());
}
/**
@@ -187,11 +164,10 @@ public class IteratorSetting {
* @param properties
* any properties for the iterator
*/
- public IteratorSetting(int priority, String name, String iteratorClass, EnumSet<IteratorScope> scopes, Map<String,String> properties) {
+ public IteratorSetting(int priority, String name, String iteratorClass, Map<String,String> properties) {
setPriority(priority);
setName(name);
setIteratorClass(iteratorClass);
- setScopes(scopes);
this.properties = new HashMap<String,String>();
setProperties(properties);
}
@@ -222,9 +198,9 @@ public class IteratorSetting {
* @param properties
* any properties for the iterator
*/
- public IteratorSetting(int priority, Class<? extends SortedKeyValueIterator<Key,Value>> iteratorClass, EnumSet<IteratorScope> scopes,
+ public IteratorSetting(int priority, Class<? extends SortedKeyValueIterator<Key,Value>> iteratorClass,
Map<String,String> properties) {
- this(priority, iteratorClass.getSimpleName(), iteratorClass.getName(), scopes, properties);
+ this(priority, iteratorClass.getSimpleName(), iteratorClass.getName(), properties);
}
/**
@@ -257,7 +233,7 @@ public class IteratorSetting {
*/
public IteratorSetting(int priority, String name, Class<? extends SortedKeyValueIterator<Key,Value>> iteratorClass, EnumSet<IteratorScope> scopes,
Map<String,String> properties) {
- this(priority, name, iteratorClass.getName(), scopes, properties);
+ this(priority, name, iteratorClass.getName(), properties);
}
/**
@@ -328,8 +304,6 @@ public class IteratorSetting {
sb.append(Integer.toString(priority));
sb.append(", class:");
sb.append(iteratorClass);
- sb.append(", scopes:");
- sb.append(scopes);
sb.append(", properties:");
sb.append(properties);
return sb.toString();
@@ -356,5 +330,13 @@ public class IteratorSetting {
super(new Text(columnFamily), null);
}
+ public Text getColumnFamily() {
+ return getFirst();
+ }
+
+ public Text getColumnQualifierf() {
+ return getSecond();
+ }
+
}
}
Modified: incubator/accumulo/trunk/src/core/src/main/java/org/apache/accumulo/core/client/admin/TableOperations.java
URL: http://svn.apache.org/viewvc/incubator/accumulo/trunk/src/core/src/main/java/org/apache/accumulo/core/client/admin/TableOperations.java?rev=1235525&r1=1235524&r2=1235525&view=diff
==============================================================================
--- incubator/accumulo/trunk/src/core/src/main/java/org/apache/accumulo/core/client/admin/TableOperations.java (original)
+++ incubator/accumulo/trunk/src/core/src/main/java/org/apache/accumulo/core/client/admin/TableOperations.java Tue Jan 24 22:09:32 2012
@@ -459,7 +459,7 @@ public interface TableOperations {
public Map<String,String> tableIdMap();
/**
- * Add an iterator to a table.
+ * Add an iterator to a table on all scopes.
*
* @param tableName
* the name of the table
@@ -476,6 +476,24 @@ public interface TableOperations {
public void attachIterator(String tableName, IteratorSetting setting) throws AccumuloSecurityException, AccumuloException, TableNotFoundException;
/**
+ * Add an iterator to a table on the given scopes.
+ *
+ * @param tableName
+ * the name of the table
+ * @param setting
+ * object specifying the properties of the iterator
+ * @throws AccumuloSecurityException
+ * thrown if the user does not have the ability to set properties on the table
+ * @throws AccumuloException
+ * @throws TableNotFoundException
+ * throw if the table no longer exists
+ * @throws IllegalArgumentException
+ * if the setting conflicts with any existing iterators
+ */
+ public void attachIterator(String tableName, IteratorSetting setting, EnumSet<IteratorScope> scopes) throws AccumuloSecurityException, AccumuloException,
+ TableNotFoundException;
+
+ /**
* Remove an iterator from a table by name.
*
* @param tableName
@@ -537,5 +555,5 @@ public interface TableOperations {
* @throws IllegalStateException
* if the setting conflicts with any existing iterators
*/
- public void checkIteratorConflicts(String tableName, IteratorSetting setting) throws AccumuloException, TableNotFoundException;
+ public void checkIteratorConflicts(String tableName, IteratorSetting setting, EnumSet<IteratorScope> scopes) throws AccumuloException, TableNotFoundException;
}
Modified: incubator/accumulo/trunk/src/core/src/main/java/org/apache/accumulo/core/client/admin/TableOperationsHelper.java
URL: http://svn.apache.org/viewvc/incubator/accumulo/trunk/src/core/src/main/java/org/apache/accumulo/core/client/admin/TableOperationsHelper.java?rev=1235525&r1=1235524&r2=1235525&view=diff
==============================================================================
--- incubator/accumulo/trunk/src/core/src/main/java/org/apache/accumulo/core/client/admin/TableOperationsHelper.java (original)
+++ incubator/accumulo/trunk/src/core/src/main/java/org/apache/accumulo/core/client/admin/TableOperationsHelper.java Tue Jan 24 22:09:32 2012
@@ -30,11 +30,17 @@ import org.apache.accumulo.core.conf.Pro
import org.apache.accumulo.core.iterators.IteratorUtil.IteratorScope;
public abstract class TableOperationsHelper implements TableOperations {
-
+
@Override
public void attachIterator(String tableName, IteratorSetting setting) throws AccumuloSecurityException, AccumuloException, TableNotFoundException {
- checkIteratorConflicts(tableName, setting);
- for (IteratorScope scope : setting.getScopes()) {
+ attachIterator(tableName, setting, EnumSet.allOf(IteratorScope.class));
+ }
+
+ @Override
+ public void attachIterator(String tableName, IteratorSetting setting, EnumSet<IteratorScope> scopes) throws AccumuloSecurityException, AccumuloException,
+ TableNotFoundException {
+ checkIteratorConflicts(tableName, setting, scopes);
+ for (IteratorScope scope : scopes) {
String root = String.format("%s%s.%s", Property.TABLE_ITERATOR_PREFIX, scope.name().toLowerCase(), setting.getName());
for (Entry<String,String> prop : setting.getProperties().entrySet()) {
this.setProperty(tableName, root + ".opt." + prop.getKey(), prop.getValue());
@@ -87,7 +93,7 @@ public abstract class TableOperationsHel
if (priority <= 0 || classname == null) {
return null;
}
- return new IteratorSetting(priority, name, classname, EnumSet.of(scope), settings);
+ return new IteratorSetting(priority, name, classname, settings);
}
@Override
@@ -111,10 +117,10 @@ public abstract class TableOperationsHel
}
@Override
- public void checkIteratorConflicts(String tableName, IteratorSetting setting) throws AccumuloException, TableNotFoundException {
+ public void checkIteratorConflicts(String tableName, IteratorSetting setting, EnumSet<IteratorScope> scopes) throws AccumuloException, TableNotFoundException {
if (!exists(tableName))
throw new TableNotFoundException(null, tableName, null);
- for (IteratorScope scope : setting.getScopes()) {
+ for (IteratorScope scope : scopes) {
String scopeStr = String.format("%s%s", Property.TABLE_ITERATOR_PREFIX, scope.name().toLowerCase());
String nameStr = String.format("%s.%s", scopeStr, setting.getName());
String optStr = String.format("%s.opt.", nameStr);
Modified: incubator/accumulo/trunk/src/core/src/main/java/org/apache/accumulo/core/iterators/IteratorUtil.java
URL: http://svn.apache.org/viewvc/incubator/accumulo/trunk/src/core/src/main/java/org/apache/accumulo/core/iterators/IteratorUtil.java?rev=1235525&r1=1235524&r2=1235525&view=diff
==============================================================================
--- incubator/accumulo/trunk/src/core/src/main/java/org/apache/accumulo/core/iterators/IteratorUtil.java (original)
+++ incubator/accumulo/trunk/src/core/src/main/java/org/apache/accumulo/core/iterators/IteratorUtil.java Tue Jan 24 22:09:32 2012
@@ -208,8 +208,10 @@ public class IteratorUtil {
Collection<IterInfo> iters, Map<String,Map<String,String>> iterOpts, IteratorEnvironment env) throws IOException {
SortedKeyValueIterator<K,V> prev = source;
+ log.debug("Iterator options: " + iterOpts);
try {
for (IterInfo iterInfo : iters) {
+ log.debug("Loading " + iterInfo.className + " " + iterInfo.iterName + " " + iterInfo.priority);
@SuppressWarnings("unchecked")
Class<? extends SortedKeyValueIterator<K,V>> clazz = (Class<? extends SortedKeyValueIterator<K,V>>) AccumuloClassLoader.loadClass(iterInfo.className,
SortedKeyValueIterator.class);
Modified: incubator/accumulo/trunk/src/core/src/main/java/org/apache/accumulo/core/util/shell/commands/SetIterCommand.java
URL: http://svn.apache.org/viewvc/incubator/accumulo/trunk/src/core/src/main/java/org/apache/accumulo/core/util/shell/commands/SetIterCommand.java?rev=1235525&r1=1235524&r2=1235525&view=diff
==============================================================================
--- incubator/accumulo/trunk/src/core/src/main/java/org/apache/accumulo/core/util/shell/commands/SetIterCommand.java (original)
+++ incubator/accumulo/trunk/src/core/src/main/java/org/apache/accumulo/core/util/shell/commands/SetIterCommand.java Tue Jan 24 22:09:32 2012
@@ -36,8 +36,8 @@ import org.apache.accumulo.core.iterator
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.ReqVisFilter;
import org.apache.accumulo.core.iterators.user.RegExFilter;
+import org.apache.accumulo.core.iterators.user.ReqVisFilter;
import org.apache.accumulo.core.iterators.user.VersioningIterator;
import org.apache.accumulo.core.util.shell.Shell;
import org.apache.accumulo.core.util.shell.Shell.Command;
@@ -120,8 +120,8 @@ public class SetIterCommand extends Comm
if (scopes.isEmpty())
throw new IllegalArgumentException("You must select at least one scope to configure");
- IteratorSetting setting = new IteratorSetting(priority, name, classname, scopes, options);
- shellState.getConnector().tableOperations().attachIterator(tableName, setting);
+ IteratorSetting setting = new IteratorSetting(priority, name, classname, options);
+ shellState.getConnector().tableOperations().attachIterator(tableName, setting, scopes);
}
private static String setUpOptions(ConsoleReader reader, String className, Map<String,String> options) throws IOException, ShellCommandException {
Modified: incubator/accumulo/trunk/src/core/src/test/java/org/apache/accumulo/core/client/admin/TableOperationsHelperTest.java
URL: http://svn.apache.org/viewvc/incubator/accumulo/trunk/src/core/src/test/java/org/apache/accumulo/core/client/admin/TableOperationsHelperTest.java?rev=1235525&r1=1235524&r2=1235525&view=diff
==============================================================================
--- incubator/accumulo/trunk/src/core/src/test/java/org/apache/accumulo/core/client/admin/TableOperationsHelperTest.java (original)
+++ incubator/accumulo/trunk/src/core/src/test/java/org/apache/accumulo/core/client/admin/TableOperationsHelperTest.java Tue Jan 24 22:09:32 2012
@@ -199,27 +199,25 @@ public class TableOperationsHelperTest {
public void testAttachIterator() throws Exception {
Tester t = new Tester();
Map<String,String> empty = Collections.emptyMap();
- t.attachIterator("table", new IteratorSetting(10, "someName", "foo.bar", EnumSet.of(IteratorScope.scan), empty));
+ t.attachIterator("table", new IteratorSetting(10, "someName", "foo.bar", empty), EnumSet.of(IteratorScope.scan));
t.check("table", new String[] {"table.iterator.scan.someName=10,foo.bar",});
t.removeIterator("table", "someName", EnumSet.of(IteratorScope.scan));
t.check("table", new String[] {});
IteratorSetting setting = new IteratorSetting(10, "someName", "foo.bar");
- setting.setScopes(EnumSet.of(IteratorScope.majc));
setting.addOptions(Collections.singletonMap("key", "value"));
- t.attachIterator("table", setting);
+ t.attachIterator("table", setting, EnumSet.of(IteratorScope.majc));
setting = new IteratorSetting(10, "someName", "foo.bar");
- t.attachIterator("table", setting);
+ t.attachIterator("table", setting, EnumSet.of(IteratorScope.scan));
t.check("table", new String[] {"table.iterator.majc.someName=10,foo.bar", "table.iterator.majc.someName.opt.key=value",
"table.iterator.scan.someName=10,foo.bar",});
t.removeIterator("table", "someName", EnumSet.of(IteratorScope.scan));
setting = new IteratorSetting(20, "otherName", "some.classname");
- setting.setScopes(EnumSet.of(IteratorScope.majc));
setting.addOptions(Collections.singletonMap("key", "value"));
- t.attachIterator("table", setting);
+ t.attachIterator("table", setting, EnumSet.of(IteratorScope.majc));
setting = new IteratorSetting(20, "otherName", "some.classname");
- t.attachIterator("table", setting);
+ t.attachIterator("table", setting, EnumSet.of(IteratorScope.scan));
Map<String,EnumSet<IteratorScope>> two = t.listIterators("table");
Assert.assertEquals(2, two.size());
Assert.assertTrue(two.containsKey("otherName"));
@@ -242,8 +240,7 @@ public class TableOperationsHelperTest {
Assert.assertEquals("some.classname", setting.getIteratorClass());
Assert.assertTrue(setting.hasProperties());
Assert.assertEquals(Collections.singletonMap("key", "value"), setting.getProperties());
- setting.setScopes(EnumSet.of(IteratorScope.minc));
- t.attachIterator("table", setting);
+ t.attachIterator("table", setting, EnumSet.of(IteratorScope.minc));
t.check("table", new String[] {"table.iterator.majc.otherName=20,some.classname", "table.iterator.majc.otherName.opt.key=value",
"table.iterator.minc.otherName=20,some.classname", "table.iterator.minc.otherName.opt.key=value", "table.iterator.scan.otherName=20,some.classname",});
Modified: incubator/accumulo/trunk/src/core/src/test/java/org/apache/accumulo/core/client/mock/MockTableOperationsTest.java
URL: http://svn.apache.org/viewvc/incubator/accumulo/trunk/src/core/src/test/java/org/apache/accumulo/core/client/mock/MockTableOperationsTest.java?rev=1235525&r1=1235524&r2=1235525&view=diff
==============================================================================
--- incubator/accumulo/trunk/src/core/src/test/java/org/apache/accumulo/core/client/mock/MockTableOperationsTest.java (original)
+++ incubator/accumulo/trunk/src/core/src/test/java/org/apache/accumulo/core/client/mock/MockTableOperationsTest.java Tue Jan 24 22:09:32 2012
@@ -16,12 +16,15 @@
*/
package org.apache.accumulo.core.client.mock;
+import java.util.EnumSet;
+
import org.apache.accumulo.core.client.AccumuloException;
import org.apache.accumulo.core.client.AccumuloSecurityException;
import org.apache.accumulo.core.client.Connector;
import org.apache.accumulo.core.client.Instance;
import org.apache.accumulo.core.client.TableExistsException;
import org.apache.accumulo.core.client.TableNotFoundException;
+import org.apache.accumulo.core.iterators.IteratorUtil.IteratorScope;
import org.junit.Assert;
import org.junit.Test;
@@ -41,7 +44,7 @@ public class MockTableOperationsTest {
Assert.fail();
} catch (TableNotFoundException e) {}
try {
- conn.tableOperations().checkIteratorConflicts(t, null);
+ conn.tableOperations().checkIteratorConflicts(t, null, EnumSet.allOf(IteratorScope.class));
Assert.fail();
} catch (TableNotFoundException e) {}
try {
Modified: incubator/accumulo/trunk/src/examples/wikisearch/query/src/test/java/org/apache/accumulo/examples/wikisearch/logic/TestQueryLogic.java
URL: http://svn.apache.org/viewvc/incubator/accumulo/trunk/src/examples/wikisearch/query/src/test/java/org/apache/accumulo/examples/wikisearch/logic/TestQueryLogic.java?rev=1235525&r1=1235524&r2=1235525&view=diff
==============================================================================
--- incubator/accumulo/trunk/src/examples/wikisearch/query/src/test/java/org/apache/accumulo/examples/wikisearch/logic/TestQueryLogic.java (original)
+++ incubator/accumulo/trunk/src/examples/wikisearch/query/src/test/java/org/apache/accumulo/examples/wikisearch/logic/TestQueryLogic.java Tue Jan 24 22:09:32 2012
@@ -38,8 +38,6 @@ import org.apache.accumulo.core.data.Val
import org.apache.accumulo.core.security.Authorizations;
import org.apache.accumulo.examples.wikisearch.ingest.WikipediaConfiguration;
import org.apache.accumulo.examples.wikisearch.ingest.WikipediaMapper;
-import org.apache.accumulo.examples.wikisearch.logic.AbstractQueryLogic;
-import org.apache.accumulo.examples.wikisearch.logic.QueryLogic;
import org.apache.accumulo.examples.wikisearch.parser.RangeCalculator;
import org.apache.accumulo.examples.wikisearch.reader.AggregatingRecordReader;
import org.apache.accumulo.examples.wikisearch.sample.Document;
@@ -165,7 +163,7 @@ public class TestQueryLogic {
}
- private void debugQuery(String tableName) throws Exception {
+ void debugQuery(String tableName) throws Exception {
Scanner s = c.createScanner(tableName, new Authorizations());
Range r = new Range();
s.setRange(r);
Propchange: incubator/accumulo/trunk/src/server/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Tue Jan 24 22:09:32 2012
@@ -1,3 +1,3 @@
-/incubator/accumulo/branches/1.3.5rc/src/server:1209938
/incubator/accumulo/branches/1.3/src/server:1190280,1190413,1190420,1190427,1190500,1195622,1195625,1195629,1195635,1196044,1196054,1196057,1196071-1196072,1196106,1197066,1198935,1199383,1203683,1204625,1205547,1205880,1206169,1208031,1209124,1209526,1209532,1209539,1209541,1209587,1209657,1210518,1210571,1210596,1210598,1213424,1214320,1225006,1227215,1227231,1227611
-/incubator/accumulo/branches/1.4/src/server:1201902-1235463
+/incubator/accumulo/branches/1.3.5rc/src/server:1209938
+/incubator/accumulo/branches/1.4/src/server:1201902-1235524
Modified: incubator/accumulo/trunk/src/server/src/main/java/org/apache/accumulo/server/tabletserver/Tablet.java
URL: http://svn.apache.org/viewvc/incubator/accumulo/trunk/src/server/src/main/java/org/apache/accumulo/server/tabletserver/Tablet.java?rev=1235525&r1=1235524&r2=1235525&view=diff
==============================================================================
--- incubator/accumulo/trunk/src/server/src/main/java/org/apache/accumulo/server/tabletserver/Tablet.java (original)
+++ incubator/accumulo/trunk/src/server/src/main/java/org/apache/accumulo/server/tabletserver/Tablet.java Tue Jan 24 22:09:32 2012
@@ -3142,7 +3142,7 @@ public class Tablet {
copy.keySet().retainAll(smallestFiles);
- log.debug("Starting MajC " + extent + " " + datafileManager.abs2rel(datafileManager.string2path(copy.keySet())) + " --> "
+ log.debug("Starting MajC " + extent + " (" + reason + ") " + datafileManager.abs2rel(datafileManager.string2path(copy.keySet())) + " --> "
+ datafileManager.abs2rel(new Path(compactTmpName)));
Compactor compactor = new Compactor(conf, fs, copy, null, compactTmpName, filesToCompact.size() == 0 ? propogateDeletes : true, // always
Modified: incubator/accumulo/trunk/src/server/src/main/java/org/apache/accumulo/server/test/randomwalk/bulk/BulkPlusOne.java
URL: http://svn.apache.org/viewvc/incubator/accumulo/trunk/src/server/src/main/java/org/apache/accumulo/server/test/randomwalk/bulk/BulkPlusOne.java?rev=1235525&r1=1235524&r2=1235525&view=diff
==============================================================================
--- incubator/accumulo/trunk/src/server/src/main/java/org/apache/accumulo/server/test/randomwalk/bulk/BulkPlusOne.java (original)
+++ incubator/accumulo/trunk/src/server/src/main/java/org/apache/accumulo/server/test/randomwalk/bulk/BulkPlusOne.java Tue Jan 24 22:09:32 2012
@@ -22,8 +22,11 @@ import java.util.List;
import java.util.Random;
import java.util.TreeSet;
import java.util.UUID;
+import java.util.concurrent.atomic.AtomicLong;
+import org.apache.accumulo.core.client.IteratorSetting.Column;
import org.apache.accumulo.core.conf.AccumuloConfiguration;
+import org.apache.accumulo.core.conf.DefaultConfiguration;
import org.apache.accumulo.core.data.Key;
import org.apache.accumulo.core.data.Value;
import org.apache.accumulo.core.file.FileOperations;
@@ -33,6 +36,7 @@ import org.apache.accumulo.server.test.r
import org.apache.hadoop.fs.FileStatus;
import org.apache.hadoop.fs.FileSystem;
import org.apache.hadoop.fs.Path;
+import org.apache.hadoop.io.Text;
import org.apache.log4j.Logger;
public class BulkPlusOne extends BulkTest {
@@ -42,14 +46,24 @@ public class BulkPlusOne extends BulkTes
public static final int HEX_SIZE = (int) Math.ceil(Math.log(LOTS) / Math.log(16));
public static final String FMT = "r%0" + HEX_SIZE + "x";
static final Value one = new Value("1".getBytes());
+ public static final List<Column> COLNAMES = new ArrayList<Column>();
+ public static final Text CHECK_COLUMN_FAMILY = new Text("cf");
+ static {
+ for (int i = 0; i < COLS; i++) {
+ COLNAMES.add(new Column(CHECK_COLUMN_FAMILY, new Text(String.format("%03d", i))));
+ }
+ }
+ public static final Text MARKER_CF = new Text("marker");
+ private static final AtomicLong counter = new AtomicLong();
static void bulkLoadLots(Logger log, State state, Value value) throws Exception {
- Path dir = new Path("/tmp", "bulk_" + UUID.randomUUID().toString());
- Path fail = new Path(dir.toString() + "_fail");
- Random rand = (Random) state.get("rand");
- FileSystem fs = (FileSystem) state.get("fs");
+ final Path dir = new Path("/tmp", "bulk_" + UUID.randomUUID().toString());
+ final Path fail = new Path(dir.toString() + "_fail");
+ final DefaultConfiguration defaultConfiguration = AccumuloConfiguration.getDefaultConfiguration();
+ final Random rand = (Random) state.get("rand");
+ final FileSystem fs = (FileSystem) state.get("fs");
fs.mkdirs(fail);
- int parts = rand.nextInt(10) + 1;
+ final int parts = rand.nextInt(10) + 1;
TreeSet<Integer> startRows = new TreeSet<Integer>();
startRows.add(0);
@@ -60,26 +74,24 @@ public class BulkPlusOne extends BulkTes
for (Integer row : startRows)
printRows.add(String.format(FMT, row));
- log.debug("preparing bulk files with start rows " + printRows + " last row " + String.format(FMT, LOTS - 1));
- String cols[] = new String[COLS];
- for (int i = 0; i < cols.length; i++) {
- cols[i] = String.format("%03d", i);
- }
+ String markerColumnFamily = Long.toString(counter.incrementAndGet());
+ log.debug("preparing bulk files with start rows " + printRows + " last row " + String.format(FMT, LOTS - 1) + " marker " + markerColumnFamily);
List<Integer> rows = new ArrayList<Integer>(startRows);
rows.add(LOTS);
for (int i = 0; i < parts; i++) {
- FileSKVWriter f = FileOperations.getInstance().openWriter(dir + "/" + String.format("part_%d.", i) + RFile.EXTENSION, fs, fs.getConf(),
- AccumuloConfiguration.getDefaultConfiguration());
+ String fileName = dir + "/" + String.format("part_%d.", i) + RFile.EXTENSION;
+ FileSKVWriter f = FileOperations.getInstance().openWriter(fileName, fs, fs.getConf(), defaultConfiguration);
f.startDefaultLocalityGroup();
int start = rows.get(i);
int end = rows.get(i + 1);
for (int j = start; j < end; j++) {
- String row = String.format(FMT, j);
- for (String col : cols) {
- f.append(new Key(row, "cf", col), value);
+ Text row = new Text(String.format(FMT, j));
+ for (Column col : COLNAMES) {
+ f.append(new Key(row, col.getColumnFamily(), col.getColumnQualifierf()), value);
}
+ f.append(new Key(row, MARKER_CF, new Text(markerColumnFamily)), value);
}
f.close();
}
Modified: incubator/accumulo/trunk/src/server/src/main/java/org/apache/accumulo/server/test/randomwalk/bulk/ConsistencyCheck.java
URL: http://svn.apache.org/viewvc/incubator/accumulo/trunk/src/server/src/main/java/org/apache/accumulo/server/test/randomwalk/bulk/ConsistencyCheck.java?rev=1235525&r1=1235524&r2=1235525&view=diff
==============================================================================
--- incubator/accumulo/trunk/src/server/src/main/java/org/apache/accumulo/server/test/randomwalk/bulk/ConsistencyCheck.java (original)
+++ incubator/accumulo/trunk/src/server/src/main/java/org/apache/accumulo/server/test/randomwalk/bulk/ConsistencyCheck.java Tue Jan 24 22:09:32 2012
@@ -40,6 +40,7 @@ public class ConsistencyCheck extends Bu
Scanner scanner = state.getConnector().createScanner(Setup.getTableName(), auths);
scanner = new IsolatedScanner(scanner);
scanner.setRange(new Range(row));
+ scanner.fetchColumnFamily(BulkPlusOne.CHECK_COLUMN_FAMILY);
Value v = null;
Key first = null;
for (Entry<Key,Value> entry : scanner) {
Modified: incubator/accumulo/trunk/src/server/src/main/java/org/apache/accumulo/server/test/randomwalk/bulk/Setup.java
URL: http://svn.apache.org/viewvc/incubator/accumulo/trunk/src/server/src/main/java/org/apache/accumulo/server/test/randomwalk/bulk/Setup.java?rev=1235525&r1=1235524&r2=1235525&view=diff
==============================================================================
--- incubator/accumulo/trunk/src/server/src/main/java/org/apache/accumulo/server/test/randomwalk/bulk/Setup.java (original)
+++ incubator/accumulo/trunk/src/server/src/main/java/org/apache/accumulo/server/test/randomwalk/bulk/Setup.java Tue Jan 24 22:09:32 2012
@@ -17,8 +17,6 @@
package org.apache.accumulo.server.test.randomwalk.bulk;
import java.net.InetAddress;
-import java.util.Collections;
-import java.util.List;
import java.util.Properties;
import java.util.Random;
import java.util.concurrent.BlockingQueue;
@@ -27,15 +25,17 @@ import java.util.concurrent.ThreadFactor
import java.util.concurrent.ThreadPoolExecutor;
import java.util.concurrent.TimeUnit;
+import org.apache.accumulo.core.client.IteratorSetting;
import org.apache.accumulo.core.client.TableExistsException;
-import org.apache.accumulo.core.iterators.conf.PerColumnIteratorConfig;
+import org.apache.accumulo.core.client.admin.TableOperations;
+import org.apache.accumulo.core.iterators.LongCombiner;
+import org.apache.accumulo.core.iterators.user.SummingCombiner;
import org.apache.accumulo.core.util.CachedConfiguration;
import org.apache.accumulo.core.util.Daemon;
import org.apache.accumulo.core.util.LoggingRunnable;
import org.apache.accumulo.server.test.randomwalk.State;
import org.apache.accumulo.server.test.randomwalk.Test;
import org.apache.hadoop.fs.FileSystem;
-import org.apache.hadoop.io.Text;
public class Setup extends Test {
@@ -51,12 +51,14 @@ public class Setup extends Test {
tableName = String.format("bulk_%s_%s_%d", hostname, pid, System.currentTimeMillis());
log.info("Starting bulk test on " + tableName);
- List<PerColumnIteratorConfig> aggregators = Collections.singletonList(new PerColumnIteratorConfig(new Text("cf".getBytes()), null,
- org.apache.accumulo.core.iterators.aggregation.StringSummation.class.getName()));
+ TableOperations tableOps = state.getConnector().tableOperations();
try {
- if (!state.getConnector().tableOperations().exists(getTableName())) {
- state.getConnector().tableOperations().create(getTableName());
- state.getConnector().tableOperations().addAggregators(getTableName(), aggregators);
+ if (!tableOps.exists(getTableName())) {
+ tableOps.create(getTableName());
+ IteratorSetting is = new IteratorSetting(10, org.apache.accumulo.core.iterators.user.SummingCombiner.class);
+ SummingCombiner.setEncodingType(is, LongCombiner.Type.STRING);
+ SummingCombiner.setColumns(is, BulkPlusOne.COLNAMES);
+ tableOps.attachIterator(getTableName(), is);
}
} catch (TableExistsException ex) {
// expected if there are multiple walkers
@@ -72,7 +74,6 @@ public class Setup extends Test {
}
};
ThreadPoolExecutor e = new ThreadPoolExecutor(CORE_POOL_SIZE, MAX_POOL_SIZE, 1, TimeUnit.SECONDS, q, factory);
-
state.set("pool", e);
}
Modified: incubator/accumulo/trunk/src/server/src/main/java/org/apache/accumulo/server/test/randomwalk/bulk/Verify.java
URL: http://svn.apache.org/viewvc/incubator/accumulo/trunk/src/server/src/main/java/org/apache/accumulo/server/test/randomwalk/bulk/Verify.java?rev=1235525&r1=1235524&r2=1235525&view=diff
==============================================================================
--- incubator/accumulo/trunk/src/server/src/main/java/org/apache/accumulo/server/test/randomwalk/bulk/Verify.java (original)
+++ incubator/accumulo/trunk/src/server/src/main/java/org/apache/accumulo/server/test/randomwalk/bulk/Verify.java Tue Jan 24 22:09:32 2012
@@ -22,12 +22,18 @@ import java.util.Properties;
import java.util.concurrent.ThreadPoolExecutor;
import java.util.concurrent.TimeUnit;
+import org.apache.accumulo.core.client.Connector;
+import org.apache.accumulo.core.client.Instance;
import org.apache.accumulo.core.client.Scanner;
+import org.apache.accumulo.core.client.ZooKeeperInstance;
+import org.apache.accumulo.core.conf.DefaultConfiguration;
+import org.apache.accumulo.core.conf.Property;
import org.apache.accumulo.core.data.Key;
import org.apache.accumulo.core.data.Value;
import org.apache.accumulo.core.security.Authorizations;
import org.apache.accumulo.server.test.randomwalk.State;
import org.apache.accumulo.server.test.randomwalk.Test;
+import org.apache.hadoop.io.Text;
public class Verify extends Test {
@@ -45,13 +51,68 @@ public class Verify extends Test {
String user = state.getConnector().whoami();
Authorizations auths = state.getConnector().securityOperations().getUserAuthorizations(user);
Scanner scanner = state.getConnector().createScanner(Setup.getTableName(), auths);
+ scanner.fetchColumnFamily(BulkPlusOne.CHECK_COLUMN_FAMILY);
for (Entry<Key,Value> entry : scanner) {
byte[] value = entry.getValue().get();
- if (!Arrays.equals(value, zero))
+ if (!Arrays.equals(value, zero)) {
throw new Exception("Bad key at " + entry);
+ }
}
log.info("Test successful on table " + Setup.getTableName());
state.getConnector().tableOperations().delete(Setup.getTableName());
}
+
+ public static void main(String args[]) throws Exception {
+ int i = 0;
+ String instance = args[i++];
+ String keepers = args[i++];
+ String username = args[i++];
+ String passwd = args[i++];
+ String tablename = args[i++];
+ int timeout = (int) DefaultConfiguration.getInstance().getTimeInMillis(Property.INSTANCE_ZK_TIMEOUT);
+ Instance inst = new ZooKeeperInstance(instance, keepers, timeout);
+ Connector conn = inst.getConnector(username, passwd.getBytes());
+ Scanner scanner = conn.createScanner(tablename, conn.securityOperations().getUserAuthorizations(username));
+ scanner.fetchColumnFamily(BulkPlusOne.CHECK_COLUMN_FAMILY);
+ Text startBadRow = null;
+ Text lastBadRow = null;
+ Value currentBadValue = null;
+ for (Entry<Key,Value> entry : scanner) {
+ // System.out.println("Entry: " + entry);
+ byte[] value = entry.getValue().get();
+ if (!Arrays.equals(value, zero)) {
+ if (currentBadValue == null || entry.getValue().equals(currentBadValue)) {
+ // same value, keep skipping ahead
+ lastBadRow = new Text(entry.getKey().getRow());
+ if (startBadRow == null)
+ startBadRow = lastBadRow;
+ } else {
+ // new bad value, report
+ report(startBadRow, lastBadRow, currentBadValue);
+ startBadRow = lastBadRow = new Text(entry.getKey().getRow());
+ }
+ currentBadValue = new Value(entry.getValue());
+ } else {
+ // end of bad range, report
+ if (startBadRow != null) {
+ report(startBadRow, lastBadRow, currentBadValue);
+ }
+ startBadRow = lastBadRow = null;
+ currentBadValue = null;
+ }
+ }
+ if (startBadRow != null) {
+ report(startBadRow, lastBadRow, currentBadValue);
+ }
+ }
+
+ /**
+ * @param startBadEntry
+ * @param lastBadEntry
+ */
+ private static void report(Text startBadRow, Text lastBadRow, Value value) {
+ System.out.println("Bad value " + new String(value.get()));
+ System.out.println(" Range [" + startBadRow + " -> " + lastBadRow + "]");
+ }
}
Modified: incubator/accumulo/trunk/test/system/auto/simple/deleterows.py
URL: http://svn.apache.org/viewvc/incubator/accumulo/trunk/test/system/auto/simple/deleterows.py?rev=1235525&r1=1235524&r2=1235525&view=diff
==============================================================================
--- incubator/accumulo/trunk/test/system/auto/simple/deleterows.py (original)
+++ incubator/accumulo/trunk/test/system/auto/simple/deleterows.py Tue Jan 24 22:09:32 2012
@@ -23,7 +23,14 @@ class DeleteRowsTest(JavaTest):
order = 91
testClass="org.apache.accumulo.server.test.functional.DeleteRowsTest"
+class DeleteRowsSplitTest(JavaTest):
+ "Test Delete Rows Split"
+
+ order = 92
+ testClass="org.apache.accumulo.server.test.functional.DeleteRowsSplitTest"
+
def suite():
result = unittest.TestSuite()
result.addTest(DeleteRowsTest())
+ result.addTest(DeleteRowsSplitTest())
return result
Modified: incubator/accumulo/trunk/test/system/randomwalk/README
URL: http://svn.apache.org/viewvc/incubator/accumulo/trunk/test/system/randomwalk/README?rev=1235525&r1=1235524&r2=1235525&view=diff
==============================================================================
--- incubator/accumulo/trunk/test/system/randomwalk/README (original)
+++ incubator/accumulo/trunk/test/system/randomwalk/README Tue Jan 24 22:09:32 2012
@@ -3,7 +3,7 @@ The randomwalk framework needs to be con
doing the following steps:
1. Make sure you have both ACCUMULO_HOME and HADOOP_HOME set in your
- environment.
+ $ACCUMULO_HOME/conf/accumulo-env.sh.
2. Create 'randomwalk.conf' file in the conf directory containing settings
needed by walkers to connect to Accumulo.
Modified: incubator/accumulo/trunk/test/system/randomwalk/bin/copy-config.sh
URL: http://svn.apache.org/viewvc/incubator/accumulo/trunk/test/system/randomwalk/bin/copy-config.sh?rev=1235525&r1=1235524&r2=1235525&view=diff
==============================================================================
--- incubator/accumulo/trunk/test/system/randomwalk/bin/copy-config.sh (original)
+++ incubator/accumulo/trunk/test/system/randomwalk/bin/copy-config.sh Tue Jan 24 22:09:32 2012
@@ -31,7 +31,7 @@ RW_HOME=$ACCUMULO_HOME/test/system/rando
cd $RW_HOME
tar czf config.tgz conf
-$HADOOP_HOME/bin/hadoop fs -rmr /randomwalk
+$HADOOP_HOME/bin/hadoop fs -rmr /randomwalk 2>/dev/null
$HADOOP_HOME/bin/hadoop fs -mkdir /randomwalk
$HADOOP_HOME/bin/hadoop fs -put config.tgz /randomwalk
$HADOOP_HOME/bin/hadoop fs -setrep 3 /randomwalk/config.tgz
Modified: incubator/accumulo/trunk/test/system/randomwalk/bin/kill-all.sh
URL: http://svn.apache.org/viewvc/incubator/accumulo/trunk/test/system/randomwalk/bin/kill-all.sh?rev=1235525&r1=1235524&r2=1235525&view=diff
==============================================================================
--- incubator/accumulo/trunk/test/system/randomwalk/bin/kill-all.sh (original)
+++ incubator/accumulo/trunk/test/system/randomwalk/bin/kill-all.sh Tue Jan 24 22:09:32 2012
@@ -15,16 +15,24 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-
-bin=`dirname "$0"`
+#copied below from hadoop-config.sh
+this="$0"
+while [ -h "$this" ]; do
+ ls=`ls -ld "$this"`
+ link=`expr "$ls" : '.*-> \(.*\)$'`
+ if expr "$link" : '.*/.*' > /dev/null; then
+ this="$link"
+ else
+ this=`dirname "$this"`/"$link"
+ fi
+done
+bin=`dirname "$this"`
+script=`basename "$this"`
bin=`cd "$bin"; pwd`
+this="$bin/$script"
-. "$bin"/../../../../conf/accumulo-env.sh
-
-if [ -z $ACCUMULO_HOME ] ; then
- echo "ACCUMULO_HOME is not set. Please make sure it's set globally."
- exit 1
-fi
+ACCUMULO_HOME=`dirname "$this"`/../../../..
+export ACCUMULO_HOME=`cd $ACCUMULO_HOME; pwd`
RW_HOME=$ACCUMULO_HOME/test/system/randomwalk
Modified: incubator/accumulo/trunk/test/system/randomwalk/bin/reset-cluster.sh
URL: http://svn.apache.org/viewvc/incubator/accumulo/trunk/test/system/randomwalk/bin/reset-cluster.sh?rev=1235525&r1=1235524&r2=1235525&view=diff
==============================================================================
--- incubator/accumulo/trunk/test/system/randomwalk/bin/reset-cluster.sh (original)
+++ incubator/accumulo/trunk/test/system/randomwalk/bin/reset-cluster.sh Tue Jan 24 22:09:32 2012
@@ -15,14 +15,31 @@
# See the License for the specific language governing permissions and
# limitations under the License.
+#copied below from hadoop-config.sh
+this="$0"
+while [ -h "$this" ]; do
+ ls=`ls -ld "$this"`
+ link=`expr "$ls" : '.*-> \(.*\)$'`
+ if expr "$link" : '.*/.*' > /dev/null; then
+ this="$link"
+ else
+ this=`dirname "$this"`/"$link"
+ fi
+done
+bin=`dirname "$this"`
+script=`basename "$this"`
+bin=`cd "$bin"; pwd`
+this="$bin/$script"
-if [ -z $HADOOP_HOME ] ; then
- echo "HADOOP_HOME is not set. Please make sure it's set globally."
- exit 1
+ACCUMULO_HOME=`dirname "$this"`/../../../..
+export ACCUMULO_HOME=`cd $ACCUMULO_HOME; pwd`
+
+if [ -f $ACCUMULO_HOME/conf/accumulo-env.sh ] ; then
+. $ACCUMULO_HOME/conf/accumulo-env.sh
fi
-if [ -z $ACCUMULO_HOME ] ; then
- echo "ACCUMULO_HOME is not set. Please make sure it's set globally."
+if [ -z $HADOOP_HOME ] ; then
+ echo "HADOOP_HOME is not set. Please make sure it's set globally."
exit 1
fi
Modified: incubator/accumulo/trunk/test/system/randomwalk/bin/start-all.sh
URL: http://svn.apache.org/viewvc/incubator/accumulo/trunk/test/system/randomwalk/bin/start-all.sh?rev=1235525&r1=1235524&r2=1235525&view=diff
==============================================================================
--- incubator/accumulo/trunk/test/system/randomwalk/bin/start-all.sh (original)
+++ incubator/accumulo/trunk/test/system/randomwalk/bin/start-all.sh Tue Jan 24 22:09:32 2012
@@ -15,18 +15,32 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-bin=`dirname "$0"`
+#copied below from hadoop-config.sh
+this="$0"
+while [ -h "$this" ]; do
+ ls=`ls -ld "$this"`
+ link=`expr "$ls" : '.*-> \(.*\)$'`
+ if expr "$link" : '.*/.*' > /dev/null; then
+ this="$link"
+ else
+ this=`dirname "$this"`/"$link"
+ fi
+done
+bin=`dirname "$this"`
+script=`basename "$this"`
bin=`cd "$bin"; pwd`
+this="$bin/$script"
-. "$bin"/../../../../conf/accumulo-env.sh
+ACCUMULO_HOME=`dirname "$this"`/../../../..
+export ACCUMULO_HOME=`cd $ACCUMULO_HOME; pwd`
-if [ -z $HADOOP_HOME ] ; then
- echo "HADOOP_HOME is not set. Please make sure it's set globally."
- exit 1
+if [ -f $ACCUMULO_HOME/conf/accumulo-env.sh ] ; then
+. $ACCUMULO_HOME/conf/accumulo-env.sh
fi
-if [ -z $ACCUMULO_HOME ] ; then
- echo "ACCUMULO_HOME is not set. Please make sure it's set globally."
+
+if [ -z "$HADOOP_HOME" ] ; then
+ echo "HADOOP_HOME is not set. Please make sure it's set globally."
exit 1
fi
@@ -35,10 +49,10 @@ if [ "$1" = "" ] ; then
exit 1
fi
-RW_HOME=$ACCUMULO_HOME/test/system/randomwalk
+RW_HOME="$ACCUMULO_HOME/test/system/randomwalk"
echo 'copying randomwalk config to HDFS'
-$RW_HOME/bin/copy-config.sh
+"$RW_HOME/bin/copy-config.sh"
echo 'starting walkers'
-pssh -i -h $RW_HOME/conf/walkers "$RW_HOME/bin/start-local.sh $1" < /dev/null
+pssh -i -h "$RW_HOME/conf/walkers" "$RW_HOME/bin/start-local.sh $1" < /dev/null
Modified: incubator/accumulo/trunk/test/system/randomwalk/bin/start-local.sh
URL: http://svn.apache.org/viewvc/incubator/accumulo/trunk/test/system/randomwalk/bin/start-local.sh?rev=1235525&r1=1235524&r2=1235525&view=diff
==============================================================================
--- incubator/accumulo/trunk/test/system/randomwalk/bin/start-local.sh (original)
+++ incubator/accumulo/trunk/test/system/randomwalk/bin/start-local.sh Tue Jan 24 22:09:32 2012
@@ -15,18 +15,32 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-bin=`dirname "$0"`
+
+#copied below from hadoop-config.sh
+this="$0"
+while [ -h "$this" ]; do
+ ls=`ls -ld "$this"`
+ link=`expr "$ls" : '.*-> \(.*\)$'`
+ if expr "$link" : '.*/.*' > /dev/null; then
+ this="$link"
+ else
+ this=`dirname "$this"`/"$link"
+ fi
+done
+bin=`dirname "$this"`
+script=`basename "$this"`
bin=`cd "$bin"; pwd`
+this="$bin/$script"
-. "$bin"/../../../../conf/accumulo-env.sh
+ACCUMULO_HOME=`dirname "$this"`/../../../..
+export ACCUMULO_HOME=`cd $ACCUMULO_HOME; pwd`
-if [ -z $HADOOP_HOME ] ; then
- echo "HADOOP_HOME is not set. Please make sure it's set globally."
- exit 1
+if [ -f $ACCUMULO_HOME/conf/accumulo-env.sh ] ; then
+. $ACCUMULO_HOME/conf/accumulo-env.sh
fi
-if [ -z $ACCUMULO_HOME ] ; then
- echo "ACCUMULO_HOME is not set. Please make sure it's set globally."
+if [ -z "$HADOOP_HOME" ] ; then
+ echo "HADOOP_HOME is not set. Please make sure it's set globally."
exit 1
fi
@@ -35,12 +49,12 @@ if [ "$1" = "" ] ; then
exit 1
fi
-RW_HOME=$ACCUMULO_HOME/test/system/randomwalk
+RW_HOME="$ACCUMULO_HOME/test/system/randomwalk"
-cd $RW_HOME
+cd "$RW_HOME"
# grab config from HDFS
-$HADOOP_HOME/bin/hadoop fs -get /randomwalk/config.tgz config.tgz
+"$HADOOP_HOME/bin/hadoop" fs -get /randomwalk/config.tgz config.tgz
# extract config to a tmp directory
rm -rf tmp/
@@ -49,8 +63,12 @@ tar xzf config.tgz -C tmp/
rm config.tgz
# config the logging
-RW_LOGS=$RW_HOME/logs
+RW_LOGS="$RW_HOME/logs"
+if [ ! -d "$RW_LOGS" ]
+then
+ mkdir -p "$RW_LOGS" || ( echo "cannot create $RW_LOGS" ; exit 1 )
+fi
LOG_ID=`hostname -s`_`date +%Y%m%d_%H%M%S`
# run the local walker
-$ACCUMULO_HOME/bin/accumulo org.apache.accumulo.server.test.randomwalk.Framework $RW_HOME/tmp/conf/ $RW_LOGS $LOG_ID $1 >$RW_LOGS/$LOG_ID.out 2>$RW_LOGS/$LOG_ID.err &
+"$ACCUMULO_HOME/bin/accumulo" org.apache.accumulo.server.test.randomwalk.Framework "$RW_HOME/tmp/conf/" "$RW_LOGS" "$LOG_ID" "$1" >"$RW_LOGS/$LOG_ID.out" 2>"$RW_LOGS/$LOG_ID.err" &
Propchange: incubator/accumulo/trunk/test/system/randomwalk/conf/
------------------------------------------------------------------------------
--- svn:ignore (added)
+++ svn:ignore Tue Jan 24 22:09:32 2012
@@ -0,0 +1,11 @@
+logger.xml
+
+tracers
+
+randomwalk.conf
+
+masters
+
+slaves
+
+walkers