svn commit: r1435416 - in /accumulo/trunk/core/src/main/java/org/apache/accumulo/core: client/admin/ client/mock/ util/shell/ util/shell/commands/
Author: kturner Date: Fri Jan 18 23:38:08 2013 New Revision: 1435416 URL: http://svn.apache.org/viewvc?rev=1435416&view=rev Log: ACCUMULO-513 Added API and shell command for pinging tablet servers. Added: accumulo/trunk/core/src/main/java/org/apache/accumulo/core/util/shell/commands/PingCommand.java accumulo/trunk/core/src/main/java/org/apache/accumulo/core/util/shell/commands/PingIterator.java Modified: accumulo/trunk/core/src/main/java/org/apache/accumulo/core/client/admin/InstanceOperations.java accumulo/trunk/core/src/main/java/org/apache/accumulo/core/client/admin/InstanceOperationsImpl.java accumulo/trunk/core/src/main/java/org/apache/accumulo/core/client/mock/MockInstanceOperations.java accumulo/trunk/core/src/main/java/org/apache/accumulo/core/util/shell/Shell.java Modified: accumulo/trunk/core/src/main/java/org/apache/accumulo/core/client/admin/InstanceOperations.java URL: http://svn.apache.org/viewvc/accumulo/trunk/core/src/main/java/org/apache/accumulo/core/client/admin/InstanceOperations.java?rev=1435416&r1=1435415&r2=1435416&view=diff == --- accumulo/trunk/core/src/main/java/org/apache/accumulo/core/client/admin/InstanceOperations.java (original) +++ accumulo/trunk/core/src/main/java/org/apache/accumulo/core/client/admin/InstanceOperations.java Fri Jan 18 23:38:08 2013 @@ -90,6 +90,15 @@ public interface InstanceOperations { public List getActiveCompactions(String tserver) throws AccumuloException, AccumuloSecurityException; /** + * Throws an exception if a tablet server can not be contacted. + * + * @param tserver + * The tablet server address should be of the form : + * @throws AccumuloException + */ + public void ping(String tserver) throws AccumuloException; + + /** * Test to see if the instance can load the given class as the given type. * * @param className Modified: accumulo/trunk/core/src/main/java/org/apache/accumulo/core/client/admin/InstanceOperationsImpl.java URL: http://svn.apache.org/viewvc/accumulo/trunk/core/src/main/java/org/apache/accumulo/core/client/admin/InstanceOperationsImpl.java?rev=1435416&r1=1435415&r2=1435416&view=diff == --- accumulo/trunk/core/src/main/java/org/apache/accumulo/core/client/admin/InstanceOperationsImpl.java (original) +++ accumulo/trunk/core/src/main/java/org/apache/accumulo/core/client/admin/InstanceOperationsImpl.java Fri Jan 18 23:38:08 2013 @@ -35,11 +35,15 @@ import org.apache.accumulo.core.client.i import org.apache.accumulo.core.client.impl.thrift.ConfigurationType; import org.apache.accumulo.core.master.thrift.MasterClientService; import org.apache.accumulo.core.security.thrift.AuthInfo; +import org.apache.accumulo.core.security.thrift.ThriftSecurityException; import org.apache.accumulo.core.tabletserver.thrift.TabletClientService; +import org.apache.accumulo.core.tabletserver.thrift.TabletClientService.Client; import org.apache.accumulo.core.util.ArgumentChecker; import org.apache.accumulo.core.util.ThriftUtil; import org.apache.accumulo.core.zookeeper.ZooUtil; import org.apache.accumulo.fate.zookeeper.ZooCache; +import org.apache.thrift.TException; +import org.apache.thrift.transport.TTransportException; /** * Provides a class for administering the accumulo instance @@ -194,4 +198,28 @@ public class InstanceOperationsImpl impl } return as; } + + /* + * (non-Javadoc) + * + * @see org.apache.accumulo.core.client.admin.InstanceOperations#ping(java.lang.String) + */ + @Override + public void ping(String tserver) throws AccumuloException { +Client client = null; +try { + client = ThriftUtil.getTServerClient(tserver, instance.getConfiguration()); + client.getTabletServerStatus(Tracer.traceInfo(), credentials); +} catch (TTransportException e) { + throw new AccumuloException(e); +} catch (ThriftSecurityException e) { + throw new AccumuloException(e); +} catch (TException e) { + throw new AccumuloException(e); +} finally { + if (client != null) { +ThriftUtil.returnClient(client); + } +} + } } Modified: accumulo/trunk/core/src/main/java/org/apache/accumulo/core/client/mock/MockInstanceOperations.java URL: http://svn.apache.org/viewvc/accumulo/trunk/core/src/main/java/org/apache/accumulo/core/client/mock/MockInstanceOperations.java?rev=1435416&r1=1435415&r2=1435416&view=diff == --- accumulo/trunk/core/src/main/java/org/apache/accumulo/core/client/mock/MockInstanceOperations.java (original) +++ accumulo/trunk/core/src/main/java/org/apache/accumulo/core/client/mock/MockInstanceOperations.java Fri Jan 18 23:38:08 2013 @@ -125,4 +125,15 @@ public class MockInstanceOperations impl public List getActiveCompactions(S
svn commit: r847233 - in /websites/production/accumulo/content: ./ 1.4/apidocs/
Author: billie Date: Fri Jan 18 23:01:09 2013 New Revision: 847233 Log: Publishing svnmucc operation to accumulo site by billie Added: websites/production/accumulo/content/ - copied from r847232, websites/staging/accumulo/trunk/content/ websites/production/accumulo/content/1.4/apidocs/ - copied from r847232, websites/production/accumulo/content/1.4/apidocs/
svn commit: r847232 - in /websites/staging/accumulo/trunk/content: ./ people.html
Author: buildbot Date: Fri Jan 18 23:00:08 2013 New Revision: 847232 Log: Staging update by buildbot for accumulo Modified: websites/staging/accumulo/trunk/content/ (props changed) websites/staging/accumulo/trunk/content/people.html Propchange: websites/staging/accumulo/trunk/content/ -- --- cms:source-revision (original) +++ cms:source-revision Fri Jan 18 23:00:08 2013 @@ -1 +1 @@ -1435402 +1435405 Modified: websites/staging/accumulo/trunk/content/people.html == --- websites/staging/accumulo/trunk/content/people.html (original) +++ websites/staging/accumulo/trunk/content/people.html Fri Jan 18 23:00:08 2013 @@ -149,11 +149,12 @@ tr.even { Luke Brassardhttp://sqrrl.com/>sqrrlET (http://www.timeanddate.com/library/abbreviations/timezones/na/est.html>-5 / http://www.timeanddate.com/library/abbreviations/timezones/na/edt.html>-4) Matthew Kirkley Michael Wall - Phil Eberhardthttp://sqrrl.com/>sqrrlET (http://www.timeanddate.com/library/abbreviations/timezones/na/est.html>-5 / http://www.timeanddate.com/library/abbreviations/timezones/na/edt.html>-4) - Sapah Shah - Scott Kuehn - Tim Halloran - Travis Pinney + Oren Falkowitzhttp://sqrrl.com/>sqrrlET (http://www.timeanddate.com/library/abbreviations/timezones/na/est.html>-5 / http://www.timeanddate.com/library/abbreviations/timezones/na/edt.html>-4) + Phil Eberhardthttp://sqrrl.com/>sqrrlET (http://www.timeanddate.com/library/abbreviations/timezones/na/est.html>-5 / http://www.timeanddate.com/library/abbreviations/timezones/na/edt.html>-4) + Sapah Shah + Scott Kuehn + Tim Halloran + Travis Pinney
svn commit: r1435405 - /accumulo/site/trunk/content/people.mdtext
Author: billie Date: Fri Jan 18 23:00:04 2013 New Revision: 1435405 URL: http://svn.apache.org/viewvc?rev=1435405&view=rev Log: added contributor Modified: accumulo/site/trunk/content/people.mdtext Modified: accumulo/site/trunk/content/people.mdtext URL: http://svn.apache.org/viewvc/accumulo/site/trunk/content/people.mdtext?rev=1435405&r1=1435404&r2=1435405&view=diff == --- accumulo/site/trunk/content/people.mdtext (original) +++ accumulo/site/trunk/content/people.mdtext Fri Jan 18 23:00:04 2013 @@ -81,9 +81,10 @@ Contributors Luke Brassardhttp://sqrrl.com/>sqrrlET (http://www.timeanddate.com/library/abbreviations/timezones/na/est.html>-5 / http://www.timeanddate.com/library/abbreviations/timezones/na/edt.html>-4) Matthew Kirkley Michael Wall - Phil Eberhardthttp://sqrrl.com/>sqrrlET (http://www.timeanddate.com/library/abbreviations/timezones/na/est.html>-5 / http://www.timeanddate.com/library/abbreviations/timezones/na/edt.html>-4) - Sapah Shah - Scott Kuehn - Tim Halloran - Travis Pinney + Oren Falkowitzhttp://sqrrl.com/>sqrrlET (http://www.timeanddate.com/library/abbreviations/timezones/na/est.html>-5 / http://www.timeanddate.com/library/abbreviations/timezones/na/edt.html>-4) + Phil Eberhardthttp://sqrrl.com/>sqrrlET (http://www.timeanddate.com/library/abbreviations/timezones/na/est.html>-5 / http://www.timeanddate.com/library/abbreviations/timezones/na/edt.html>-4) + Sapah Shah + Scott Kuehn + Tim Halloran + Travis Pinney \ No newline at end of file
svn commit: r847231 - in /websites/production/accumulo/content: ./ 1.4/apidocs/
Author: kturner Date: Fri Jan 18 22:50:48 2013 New Revision: 847231 Log: Publishing svnmucc operation to accumulo site by kturner Added: websites/production/accumulo/content/ - copied from r847230, websites/staging/accumulo/trunk/content/ websites/production/accumulo/content/1.4/apidocs/ - copied from r847230, websites/production/accumulo/content/1.4/apidocs/
svn commit: r847230 - in /websites/staging/accumulo/trunk/content: ./ people.html
Author: buildbot Date: Fri Jan 18 22:50:30 2013 New Revision: 847230 Log: Staging update by buildbot for accumulo Modified: websites/staging/accumulo/trunk/content/ (props changed) websites/staging/accumulo/trunk/content/people.html Propchange: websites/staging/accumulo/trunk/content/ -- --- cms:source-revision (original) +++ cms:source-revision Fri Jan 18 22:50:30 2013 @@ -1 +1 @@ -1431573 +1435402 Modified: websites/staging/accumulo/trunk/content/people.html == --- websites/staging/accumulo/trunk/content/people.html (original) +++ websites/staging/accumulo/trunk/content/people.html Fri Jan 18 22:50:30 2013 @@ -134,25 +134,26 @@ tr.even { Contributors usernamenameorganizationtimezone - Chris Bennight - Chris McCubbinhttp://sqrrl.com/>sqrrlET (http://www.timeanddate.com/library/abbreviations/timezones/na/est.html>-5 / http://www.timeanddate.com/library/abbreviations/timezones/na/edt.html>-4) - Christian Rohling - Dennis Patronehttp://www.jhuapl.edu/>The Johns Hopkins UniversityApplied Physics LaboratoryET (http://www.timeanddate.com/library/abbreviations/timezones/na/est.html>-5 / http://www.timeanddate.com/library/abbreviations/timezones/na/edt.html>-4) - Ed Kohlweyhttp://www.boozallen.com/>Booz Allen Hamilton - edwardyoonEdward Yoon - Jay Shipper - Jesse Yates - Jim Klucar - Joe Skora - Laura Peaslee - Luke Brassardhttp://sqrrl.com/>sqrrlET (http://www.timeanddate.com/library/abbreviations/timezones/na/est.html>-5 / http://www.timeanddate.com/library/abbreviations/timezones/na/edt.html>-4) - Matthew Kirkley - Michael Wall - Phil Eberhardthttp://sqrrl.com/>sqrrlET (http://www.timeanddate.com/library/abbreviations/timezones/na/est.html>-5 / http://www.timeanddate.com/library/abbreviations/timezones/na/edt.html>-4) - Sapah Shah - Scott Kuehn - Tim Halloran - Travis Pinney + Brian Loss + Chris Bennight + Chris McCubbinhttp://sqrrl.com/>sqrrlET (http://www.timeanddate.com/library/abbreviations/timezones/na/est.html>-5 / http://www.timeanddate.com/library/abbreviations/timezones/na/edt.html>-4) + Christian Rohling + Dennis Patronehttp://www.jhuapl.edu/>The Johns Hopkins UniversityApplied Physics LaboratoryET (http://www.timeanddate.com/library/abbreviations/timezones/na/est.html>-5 / http://www.timeanddate.com/library/abbreviations/timezones/na/edt.html>-4) + Ed Kohlweyhttp://www.boozallen.com/>Booz Allen Hamilton + edwardyoonEdward Yoon + Jay Shipper + Jesse Yates + Jim Klucar + Joe Skora + Laura Peaslee + Luke Brassardhttp://sqrrl.com/>sqrrlET (http://www.timeanddate.com/library/abbreviations/timezones/na/est.html>-5 / http://www.timeanddate.com/library/abbreviations/timezones/na/edt.html>-4) + Matthew Kirkley + Michael Wall + Phil Eberhardthttp://sqrrl.com/>sqrrlET (http://www.timeanddate.com/library/abbreviations/timezones/na/est.html>-5 / http://www.timeanddate.com/library/abbreviations/timezones/na/edt.html>-4) + Sapah Shah + Scott Kuehn + Tim Halloran + Travis Pinney
svn commit: r1435402 - /accumulo/site/trunk/content/people.mdtext
Author: kturner Date: Fri Jan 18 22:50:25 2013 New Revision: 1435402 URL: http://svn.apache.org/viewvc?rev=1435402&view=rev Log: CMS commit to accumulo by kturner Modified: accumulo/site/trunk/content/people.mdtext Modified: accumulo/site/trunk/content/people.mdtext URL: http://svn.apache.org/viewvc/accumulo/site/trunk/content/people.mdtext?rev=1435402&r1=1435401&r2=1435402&view=diff == --- accumulo/site/trunk/content/people.mdtext (original) +++ accumulo/site/trunk/content/people.mdtext Fri Jan 18 22:50:25 2013 @@ -66,23 +66,24 @@ Contributors usernamenameorganizationtimezone - Chris Bennight - Chris McCubbinhttp://sqrrl.com/>sqrrlET (http://www.timeanddate.com/library/abbreviations/timezones/na/est.html>-5 / http://www.timeanddate.com/library/abbreviations/timezones/na/edt.html>-4) - Christian Rohling - Dennis Patronehttp://www.jhuapl.edu/>The Johns Hopkins UniversityApplied Physics LaboratoryET (http://www.timeanddate.com/library/abbreviations/timezones/na/est.html>-5 / http://www.timeanddate.com/library/abbreviations/timezones/na/edt.html>-4) - Ed Kohlweyhttp://www.boozallen.com/>Booz Allen Hamilton - edwardyoonEdward Yoon - Jay Shipper - Jesse Yates - Jim Klucar - Joe Skora - Laura Peaslee - Luke Brassardhttp://sqrrl.com/>sqrrlET (http://www.timeanddate.com/library/abbreviations/timezones/na/est.html>-5 / http://www.timeanddate.com/library/abbreviations/timezones/na/edt.html>-4) - Matthew Kirkley - Michael Wall - Phil Eberhardthttp://sqrrl.com/>sqrrlET (http://www.timeanddate.com/library/abbreviations/timezones/na/est.html>-5 / http://www.timeanddate.com/library/abbreviations/timezones/na/edt.html>-4) - Sapah Shah - Scott Kuehn - Tim Halloran - Travis Pinney + Brian Loss + Chris Bennight + Chris McCubbinhttp://sqrrl.com/>sqrrlET (http://www.timeanddate.com/library/abbreviations/timezones/na/est.html>-5 / http://www.timeanddate.com/library/abbreviations/timezones/na/edt.html>-4) + Christian Rohling + Dennis Patronehttp://www.jhuapl.edu/>The Johns Hopkins UniversityApplied Physics LaboratoryET (http://www.timeanddate.com/library/abbreviations/timezones/na/est.html>-5 / http://www.timeanddate.com/library/abbreviations/timezones/na/edt.html>-4) + Ed Kohlweyhttp://www.boozallen.com/>Booz Allen Hamilton + edwardyoonEdward Yoon + Jay Shipper + Jesse Yates + Jim Klucar + Joe Skora + Laura Peaslee + Luke Brassardhttp://sqrrl.com/>sqrrlET (http://www.timeanddate.com/library/abbreviations/timezones/na/est.html>-5 / http://www.timeanddate.com/library/abbreviations/timezones/na/edt.html>-4) + Matthew Kirkley + Michael Wall + Phil Eberhardthttp://sqrrl.com/>sqrrlET (http://www.timeanddate.com/library/abbreviations/timezones/na/est.html>-5 / http://www.timeanddate.com/library/abbreviations/timezones/na/edt.html>-4) + Sapah Shah + Scott Kuehn + Tim Halloran + Travis Pinney \ No newline at end of file
svn commit: r1435383 - /accumulo/trunk/core/src/main/java/org/apache/accumulo/core/iterators/user/TransformingIterator.java
Author: kturner Date: Fri Jan 18 22:38:20 2013 New Revision: 1435383 URL: http://svn.apache.org/viewvc?rev=1435383&view=rev Log: ACCUMULO-956 applied patch from Brian Loss Modified: accumulo/trunk/core/src/main/java/org/apache/accumulo/core/iterators/user/TransformingIterator.java Modified: accumulo/trunk/core/src/main/java/org/apache/accumulo/core/iterators/user/TransformingIterator.java URL: http://svn.apache.org/viewvc/accumulo/trunk/core/src/main/java/org/apache/accumulo/core/iterators/user/TransformingIterator.java?rev=1435383&r1=1435382&r2=1435383&view=diff == --- accumulo/trunk/core/src/main/java/org/apache/accumulo/core/iterators/user/TransformingIterator.java (original) +++ accumulo/trunk/core/src/main/java/org/apache/accumulo/core/iterators/user/TransformingIterator.java Fri Jan 18 22:38:20 2013 @@ -21,6 +21,7 @@ import java.util.ArrayList; import java.util.Collection; import java.util.Collections; import java.util.Comparator; +import java.util.HashMap; import java.util.HashSet; import java.util.Map; import java.util.NoSuchElementException; @@ -125,10 +126,16 @@ abstract public class TransformingIterat @Override public IteratorOptions describeOptions() { -String desc = "This iterator allows keys to be transformed."; +String desc = "This iterator allows ranges of key to be transformed (with the exception of row transformations)."; String authDesc = "Comma-separated list of user's scan authorizations. " + "If excluded or empty, then no visibility check is performed on transformed keys."; -return new IteratorOptions(getClass().getSimpleName(), desc, Collections.singletonMap(AUTH_OPT, authDesc), null); +String bufferDesc = "Maximum buffer size (in accumulo memory spec) to use for buffering keys before throwing a BufferOverflowException. " + + "Users should keep this limit in mind when deciding what to transform. That is, if transforming the column family for example, then all " + + "keys sharing the same row and column family must fit within this limit (along with their associated values)"; +HashMap namedOptions = new HashMap(); +namedOptions.put(AUTH_OPT, authDesc); +namedOptions.put(MAX_BUFFER_SIZE_OPT, bufferDesc); +return new IteratorOptions(getClass().getSimpleName(), desc, namedOptions, null); } @Override @@ -166,6 +173,8 @@ abstract public class TransformingIterat copy.parsedVisibilitiesCache.putAll(parsedVisibilitiesCache); } +copy.maxBufferSize = maxBufferSize; + return copy; } @@ -223,15 +232,17 @@ abstract public class TransformingIterat } } - private class RangeIterator implements SortedKeyValueIterator { + private static class RangeIterator implements SortedKeyValueIterator { private SortedKeyValueIterator source; private Key prefixKey; +private PartialKey keyPrefix; private boolean hasTop = false; -RangeIterator(SortedKeyValueIterator source, Key prefixKey) { +RangeIterator(SortedKeyValueIterator source, Key prefixKey, PartialKey keyPrefix) { this.source = source; this.prefixKey = prefixKey; + this.keyPrefix = keyPrefix; } @Override @@ -242,7 +253,7 @@ abstract public class TransformingIterat @Override public boolean hasTop() { // only have a top if the prefix matches - return hasTop = source.hasTop() && source.getTopKey().equals(prefixKey, getKeyPrefix()); + return hasTop = source.hasTop() && source.getTopKey().equals(prefixKey, keyPrefix); } @Override @@ -285,7 +296,7 @@ abstract public class TransformingIterat keys.clear(); final Key prefixKey = super.hasTop() ? new Key(super.getTopKey()) : null; -transformRange(new RangeIterator(getSource(), prefixKey), new KVBuffer() { +transformRange(new RangeIterator(getSource(), prefixKey, getKeyPrefix()), new KVBuffer() { long appened = 0; @@ -608,7 +619,7 @@ abstract public class TransformingIterat } /** - * Transforms {@code originalKey}. This method must not change the row part of the key, and must only change the parts of the key after the return value of + * Transforms {@code input}. This method must not change the row part of the key, and must only change the parts of the key after the return value of * {@link #getKeyPrefix()}. Implementors must also remember to copy the delete flag from {@code originalKey} onto the new key. Or, implementors should use one * of the helper methods to produce the new key. See any of the replaceKeyParts methods. * @@ -624,7 +635,6 @@ abstract public class TransformingIterat * @see #replaceKeyParts(Key, Text, Text) * @see #replaceKeyParts(Key, Text, Text, Text) */ - abstract protected void transformRange(SortedKeyValueIterator input, KVBuffer output) throws I
svn commit: r1435371 [3/3] - 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/accumu
Modified: accumulo/trunk/core/src/main/java/org/apache/accumulo/core/util/shell/Shell.java URL: http://svn.apache.org/viewvc/accumulo/trunk/core/src/main/java/org/apache/accumulo/core/util/shell/Shell.java?rev=1435371&r1=1435370&r2=1435371&view=diff == --- accumulo/trunk/core/src/main/java/org/apache/accumulo/core/util/shell/Shell.java (original) +++ accumulo/trunk/core/src/main/java/org/apache/accumulo/core/util/shell/Shell.java Fri Jan 18 22:06:44 2013 @@ -104,6 +104,7 @@ import org.apache.accumulo.core.util.she import org.apache.accumulo.core.util.shell.commands.InfoCommand; import org.apache.accumulo.core.util.shell.commands.InsertCommand; import org.apache.accumulo.core.util.shell.commands.InterpreterCommand; +import org.apache.accumulo.core.util.shell.commands.ListCompactionsCommand; import org.apache.accumulo.core.util.shell.commands.ListIterCommand; import org.apache.accumulo.core.util.shell.commands.ListScansCommand; import org.apache.accumulo.core.util.shell.commands.MaxRowCommand; @@ -293,7 +294,7 @@ public class Shell extends ShellOptions Command[] dataCommands = {new DeleteCommand(), new DeleteManyCommand(), new DeleteRowsCommand(), new EGrepCommand(), new FormatterCommand(), new InterpreterCommand(), new GrepCommand(), new ImportDirectoryCommand(), new InsertCommand(), new MaxRowCommand(), new ScanCommand()}; -Command[] debuggingCommands = {new ClasspathCommand(), new DebugCommand(), new ListScansCommand(), new TraceCommand()}; +Command[] debuggingCommands = {new ClasspathCommand(), new DebugCommand(), new ListScansCommand(), new ListCompactionsCommand(), new TraceCommand()}; Command[] execCommands = {new ExecfileCommand(), new HistoryCommand()}; Command[] exitCommands = {new ByeCommand(), new ExitCommand(), new QuitCommand()}; Command[] helpCommands = {new AboutCommand(), new HelpCommand(), new InfoCommand(), new QuestionCommand()}; Added: accumulo/trunk/core/src/main/java/org/apache/accumulo/core/util/shell/commands/ActiveCompactionIterator.java URL: http://svn.apache.org/viewvc/accumulo/trunk/core/src/main/java/org/apache/accumulo/core/util/shell/commands/ActiveCompactionIterator.java?rev=1435371&view=auto == --- accumulo/trunk/core/src/main/java/org/apache/accumulo/core/util/shell/commands/ActiveCompactionIterator.java (added) +++ accumulo/trunk/core/src/main/java/org/apache/accumulo/core/util/shell/commands/ActiveCompactionIterator.java Fri Jan 18 22:06:44 2013 @@ -0,0 +1,138 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.accumulo.core.util.shell.commands; + +import java.util.ArrayList; +import java.util.Collections; +import java.util.Comparator; +import java.util.HashMap; +import java.util.Iterator; +import java.util.List; +import java.util.Map; + +import org.apache.accumulo.core.client.IteratorSetting; +import org.apache.accumulo.core.client.admin.ActiveCompaction; +import org.apache.accumulo.core.client.admin.InstanceOperations; +import org.apache.accumulo.core.util.Duration; + +class ActiveCompactionIterator implements Iterator { + + private InstanceOperations instanceOps; + private Iterator tsIter; + private Iterator compactionIter; + + private static String maxDecimal(double count) { +if (count < 9.995) + return String.format("%.2f", count); +if (count < 99.95) + return String.format("%.1f", count); +return String.format("%.0f", count); + } + + private static String shortenCount(long count) { +if (count < 1000) + return count + ""; +if (count < 100) + return maxDecimal(count / 1000.0) + "K"; +if (count < 10) + return maxDecimal(count / 100.0) + "M"; +return maxDecimal(count / 10.0) + "B"; + } + + private void readNext() { +final List compactions = new ArrayList(); + +while (tsIter.hasNext()) { + + final String tserver = tsIter.next(); + try { +List acl = instanceOps.getActiveCompactions(tserver); + +acl = new ArrayList(acl); + +Col
svn commit: r1435288 - /accumulo/branches/1.4/src/server/src/main/java/org/apache/accumulo/server/gc/SimpleGarbageCollector.java
Author: drew Date: Fri Jan 18 18:33:01 2013 New Revision: 1435288 URL: http://svn.apache.org/viewvc?rev=1435288&view=rev Log: ACCUMULO-919 backported to 1.4 branch Modified: accumulo/branches/1.4/src/server/src/main/java/org/apache/accumulo/server/gc/SimpleGarbageCollector.java Modified: accumulo/branches/1.4/src/server/src/main/java/org/apache/accumulo/server/gc/SimpleGarbageCollector.java URL: http://svn.apache.org/viewvc/accumulo/branches/1.4/src/server/src/main/java/org/apache/accumulo/server/gc/SimpleGarbageCollector.java?rev=1435288&r1=1435287&r2=1435288&view=diff == --- accumulo/branches/1.4/src/server/src/main/java/org/apache/accumulo/server/gc/SimpleGarbageCollector.java (original) +++ accumulo/branches/1.4/src/server/src/main/java/org/apache/accumulo/server/gc/SimpleGarbageCollector.java Fri Jan 18 18:33:01 2013 @@ -16,6 +16,7 @@ */ package org.apache.accumulo.server.gc; +import java.io.FileNotFoundException; import java.io.IOException; import java.net.InetSocketAddress; import java.net.UnknownHostException; @@ -92,6 +93,7 @@ import org.apache.commons.cli.ParseExcep import org.apache.hadoop.fs.FileStatus; import org.apache.hadoop.fs.FileSystem; import org.apache.hadoop.fs.Path; +import org.apache.hadoop.fs.Trash; import org.apache.hadoop.io.Text; import org.apache.log4j.Logger; import org.apache.zookeeper.KeeperException; @@ -111,8 +113,9 @@ public class SimpleGarbageCollector impl private long gcStartDelay; private boolean checkForBulkProcessingFiles; private FileSystem fs; - private Option optSafeMode, optOffline, optVerboseMode, optAddress; - private boolean safemode, offline, verbose; + private Option optSafeMode, optOffline, optVerboseMode, optAddress, optNoTrash; + private Trash trash = null; + private boolean safemode, offline, verbose, noTrash; private String address; private CommandLine commandLine; private ZooLock lock; @@ -148,10 +151,12 @@ public class SimpleGarbageCollector impl optOffline = new Option("o", "offline", false, "offline mode will run once and check data files directly; this is dangerous if accumulo is running or not shut down properly"); optAddress = new Option("a", "address", true, "specify our local address"); +optNoTrash = new Option("t", "no-trash", false, "do not use hdfs trash if it is enabled"); opts.addOption(optVerboseMode); opts.addOption(optSafeMode); opts.addOption(optOffline); opts.addOption(optAddress); +opts.addOption(optNoTrash); try { commandLine = new BasicParser().parse(opts, args); @@ -162,6 +167,7 @@ public class SimpleGarbageCollector impl offline = commandLine.hasOption(optOffline.getOpt()); verbose = commandLine.hasOption(optVerboseMode.getOpt()); address = commandLine.getOptionValue(optAddress.getOpt()); + noTrash = commandLine.hasOption(optNoTrash.getOpt()); } catch (ParseException e) { String str = "Can't parse the command line options"; log.fatal(str, e); @@ -169,7 +175,7 @@ public class SimpleGarbageCollector impl } } - public void init(FileSystem fs, Instance instance, AuthInfo credentials, AccumuloConfiguration conf) { + public void init(FileSystem fs, Instance instance, AuthInfo credentials, AccumuloConfiguration conf) throws IOException { this.fs = fs; this.instance = instance; this.credentials = credentials; @@ -182,8 +188,12 @@ public class SimpleGarbageCollector impl log.info("safemode: " + safemode); log.info("offline: " + offline); log.info("verbose: " + verbose); +log.info("trash enabled: " + !noTrash); log.info("memory threshold: " + CANDIDATE_MEMORY_PERCENTAGE + " of " + Runtime.getRuntime().maxMemory() + " bytes"); log.info("delete threads: " + numDeleteThreads); +if (!noTrash) { + this.trash = new Trash(fs, fs.getConf()); +} } private void run() { @@ -303,6 +313,16 @@ public class SimpleGarbageCollector impl } } + private boolean moveToTrash(Path path) throws IOException { +if (trash == null) + return false; +try { + return trash.moveToTrash(path); +} catch (FileNotFoundException ex) { + return false; +} + } + /* * this method removes deleted table dirs that are empty */ @@ -333,8 +353,11 @@ public class SimpleGarbageCollector impl if (tabletDirs == null) continue; - if (tabletDirs.length == 0) -fs.delete(new Path(ServerConstants.getTablesDir() + "/" + delTableId), false); + if (tabletDirs.length == 0) { +Path p = new Path(ServerConstants.getTablesDir() + "/" + delTableId); +if (!moveToTrash(p)) + fs.delete(p, false); + } } } @@ -583,7 +606,7 @@ public class SimpleGarbageCollector impl Path p = new Path(ServerConstants.getTablesDir() + delete
svn commit: r1435230 - in /accumulo/trunk: core/src/main/java/org/apache/accumulo/core/client/mapreduce/InputFormatBase.java proxy/pom.xml
Author: ctubbsii Date: Fri Jan 18 16:25:53 2013 New Revision: 1435230 URL: http://svn.apache.org/viewvc?rev=1435230&view=rev Log: ACCUMULO-769 Fix Hadoop 2.0 breakage by removing methods marked as deprecated that didn't exist in prior version. ACCUMULO-975 Fix proxy pom.xml to support Hadoop 2.0 Modified: accumulo/trunk/core/src/main/java/org/apache/accumulo/core/client/mapreduce/InputFormatBase.java accumulo/trunk/proxy/pom.xml Modified: accumulo/trunk/core/src/main/java/org/apache/accumulo/core/client/mapreduce/InputFormatBase.java URL: http://svn.apache.org/viewvc/accumulo/trunk/core/src/main/java/org/apache/accumulo/core/client/mapreduce/InputFormatBase.java?rev=1435230&r1=1435229&r2=1435230&view=diff == --- accumulo/trunk/core/src/main/java/org/apache/accumulo/core/client/mapreduce/InputFormatBase.java (original) +++ accumulo/trunk/core/src/main/java/org/apache/accumulo/core/client/mapreduce/InputFormatBase.java Fri Jan 18 16:25:53 2013 @@ -85,7 +85,6 @@ import org.apache.hadoop.mapreduce.Job; import org.apache.hadoop.mapreduce.JobContext; import org.apache.hadoop.mapreduce.RecordReader; import org.apache.hadoop.mapreduce.TaskAttemptContext; -import org.apache.hadoop.mapreduce.TaskAttemptID; import org.apache.log4j.Level; import org.apache.log4j.Logger; @@ -862,16 +861,6 @@ public abstract class InputFormatBase - * This class is written for the Hadoop MapReduce framework, and is not guaranteed to function in other frameworks. Other frameworks using this - * class are expected to wrap their objects to conform to the supported framework. - */ -@Deprecated -public void initialize(InputSplit inSplit, Configuration conf) throws IOException { - initialize(inSplit, new TaskAttemptContext(conf, new TaskAttemptID())); -} - @Override public void close() {} @@ -1093,14 +1082,6 @@ public abstract class InputFormatBase getSplits(Configuration conf) throws IOException { -return getSplits(new TaskAttemptContext(conf, new TaskAttemptID())); - } - - /** * The Class RangeInputSplit. Encapsulates an Accumulo range for use in Map Reduce jobs. */ public static class RangeInputSplit extends InputSplit implements Writable { Modified: accumulo/trunk/proxy/pom.xml URL: http://svn.apache.org/viewvc/accumulo/trunk/proxy/pom.xml?rev=1435230&r1=1435229&r2=1435230&view=diff == --- accumulo/trunk/proxy/pom.xml (original) +++ accumulo/trunk/proxy/pom.xml Fri Jan 18 16:25:53 2013 @@ -15,92 +15,125 @@ See the License for the specific language governing permissions and limitations under the License. --> -http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"; - xmlns="http://maven.apache.org/POM/4.0.0"; xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";> - 4.0.0 - - accumulo - org.apache.accumulo - 1.5.0-SNAPSHOT - - accumulo-proxy - accumulo-proxy - http://maven.apache.org - - UTF-8 - - - - - - maven-jar-plugin - - ../lib - - - - - - - org.codehaus.mojo - exec-maven-plugin - - - generate-core-thrift - generate-sources - - exec - - - ${basedir}/src/main/scripts/generate-thrift.sh - - - - - - - - - org.apache.accumulo - accumulo-core - compile - - - org.apache.hadoop - hadoop-core - compile - - - org.apache.zookeeper - zookeeper - compile - - - junit - junit - test - -
svn commit: r1435198 - in /accumulo/branches/1.4/src: core/src/main/java/org/apache/accumulo/core/conf/Property.java server/src/main/java/org/apache/accumulo/server/master/Master.java
Author: drew Date: Fri Jan 18 15:45:55 2013 New Revision: 1435198 URL: http://svn.apache.org/viewvc?rev=1435198&view=rev Log: ACCUMULO-778 (Configurable FATE threads in master) backport to 1.4 branch Modified: accumulo/branches/1.4/src/core/src/main/java/org/apache/accumulo/core/conf/Property.java accumulo/branches/1.4/src/server/src/main/java/org/apache/accumulo/server/master/Master.java Modified: accumulo/branches/1.4/src/core/src/main/java/org/apache/accumulo/core/conf/Property.java URL: http://svn.apache.org/viewvc/accumulo/branches/1.4/src/core/src/main/java/org/apache/accumulo/core/conf/Property.java?rev=1435198&r1=1435197&r2=1435198&view=diff == --- accumulo/branches/1.4/src/core/src/main/java/org/apache/accumulo/core/conf/Property.java (original) +++ accumulo/branches/1.4/src/core/src/main/java/org/apache/accumulo/core/conf/Property.java Fri Jan 18 15:45:55 2013 @@ -72,6 +72,7 @@ public enum Property { MASTER_BULK_TIMEOUT("master.bulk.timeout", "5m", PropertyType.TIMEDURATION, "The time to wait for a tablet server to process a bulk import request"), MASTER_MINTHREADS("master.server.threads.minimum", "20", PropertyType.COUNT, "The minimum number of threads to use to handle incoming requests."), MASTER_THREADCHECK("master.server.threadcheck.time", "1s", PropertyType.TIMEDURATION, "The time between adjustments of the server thread pool."), + MASTER_FATE_THREADPOOL_SIZE("master.fate.threadpool.size", "4", PropertyType.COUNT, "The number of threads used to run FAult-Tolerant Executions. These are primarily table operations like merge."), // properties that are specific to tablet server behavior TSERV_PREFIX("tserver.", null, PropertyType.PREFIX, "Properties in this category affect the behavior of the tablet servers"), Modified: accumulo/branches/1.4/src/server/src/main/java/org/apache/accumulo/server/master/Master.java URL: http://svn.apache.org/viewvc/accumulo/branches/1.4/src/server/src/main/java/org/apache/accumulo/server/master/Master.java?rev=1435198&r1=1435197&r2=1435198&view=diff == --- accumulo/branches/1.4/src/server/src/main/java/org/apache/accumulo/server/master/Master.java (original) +++ accumulo/branches/1.4/src/server/src/main/java/org/apache/accumulo/server/master/Master.java Fri Jan 18 15:45:55 2013 @@ -220,6 +220,7 @@ public class Master implements LiveTServ private MasterState state = MasterState.INITIAL; private Fate fate; + private int fateThreadCount; volatile private SortedMap tserverStatus = Collections .unmodifiableSortedMap(new TreeMap()); @@ -537,6 +538,7 @@ public class Master implements LiveTServ log.info("Instance " + instance.getInstanceID()); ThriftTransportPool.getInstance().setIdleTime(ServerConfiguration.getSiteConfiguration().getTimeInMillis(Property.GENERAL_RPC_TIMEOUT)); +fateThreadCount = ServerConfiguration.getSiteConfiguration().getCount(Property.MASTER_FATE_THREADPOOL_SIZE); hostname = Accumulo.getLocalAddress(args).getHostName(); fs = TraceFileSystem.wrap(FileUtil.getFileSystem(CachedConfiguration.getInstance(), ServerConfiguration.getSiteConfiguration())); @@ -2096,7 +2098,7 @@ public class Master implements LiveTServ // TODO: add shutdown for fate object try { fate = new Fate(this, new org.apache.accumulo.server.fate.ZooStore(ZooUtil.getRoot(instance) + Constants.ZFATE, - ZooReaderWriter.getRetryingInstance()), 4); + ZooReaderWriter.getRetryingInstance()), fateThreadCount); } catch (KeeperException e) { throw new IOException(e); } catch (InterruptedException e) {