accumulo git commit: ACCUMULO-2232 Added options to Combiner for handling deletes

2015-10-02 Thread kturner
Repository: accumulo
Updated Branches:
  refs/heads/1.6 e24bd3672 -> 7a1d6d921


ACCUMULO-2232 Added options to Combiner for handling deletes


Project: http://git-wip-us.apache.org/repos/asf/accumulo/repo
Commit: http://git-wip-us.apache.org/repos/asf/accumulo/commit/7a1d6d92
Tree: http://git-wip-us.apache.org/repos/asf/accumulo/tree/7a1d6d92
Diff: http://git-wip-us.apache.org/repos/asf/accumulo/diff/7a1d6d92

Branch: refs/heads/1.6
Commit: 7a1d6d921ba81c7f92eab8d3b20aae461a46066a
Parents: e24bd36
Author: Keith Turner 
Authored: Fri Oct 2 10:19:37 2015 -0400
Committer: Keith Turner 
Committed: Fri Oct 2 11:10:00 2015 -0400

--
 .../accumulo/core/iterators/Combiner.java   |  93 +-
 .../core/iterators/CombinerTestUtil.java|  23 +++
 .../iterators/user/BigDecimalCombinerTest.java  |   6 +-
 .../core/iterators/user/CombinerTest.java   | 175 ---
 4 files changed, 270 insertions(+), 27 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/accumulo/blob/7a1d6d92/core/src/main/java/org/apache/accumulo/core/iterators/Combiner.java
--
diff --git 
a/core/src/main/java/org/apache/accumulo/core/iterators/Combiner.java 
b/core/src/main/java/org/apache/accumulo/core/iterators/Combiner.java
index 97d0ce3..091803b 100644
--- a/core/src/main/java/org/apache/accumulo/core/iterators/Combiner.java
+++ b/core/src/main/java/org/apache/accumulo/core/iterators/Combiner.java
@@ -22,6 +22,9 @@ import java.util.Iterator;
 import java.util.List;
 import java.util.Map;
 import java.util.NoSuchElementException;
+import java.util.concurrent.Callable;
+import java.util.concurrent.ExecutionException;
+import java.util.concurrent.TimeUnit;
 
 import org.apache.accumulo.core.client.IteratorSetting;
 import org.apache.accumulo.core.client.IteratorSetting.Column;
@@ -31,11 +34,15 @@ import org.apache.accumulo.core.data.Key;
 import org.apache.accumulo.core.data.PartialKey;
 import org.apache.accumulo.core.data.Range;
 import org.apache.accumulo.core.data.Value;
+import org.apache.accumulo.core.iterators.IteratorUtil.IteratorScope;
 import org.apache.accumulo.core.iterators.conf.ColumnSet;
 import org.apache.hadoop.io.Text;
 import org.apache.log4j.Logger;
 
+import com.google.common.annotations.VisibleForTesting;
 import com.google.common.base.Splitter;
+import com.google.common.cache.Cache;
+import com.google.common.cache.CacheBuilder;
 import com.google.common.collect.Lists;
 
 /**
@@ -45,18 +52,28 @@ import com.google.common.collect.Lists;
  * will combine all Keys in column family and qualifier individually. 
Combination is only ever performed on multiple versions and not across column 
qualifiers
  * or column visibilities.
  *
+ * 
  * Implementations must provide a reduce method: {@code public Value 
reduce(Key key, Iterator iter)}.
  *
+ * 
  * This reduce method will be passed the most recent Key and an iterator over 
the Values for all non-deleted versions of that Key. A combiner will not combine
  * keys that differ by more than the timestamp.
  *
+ * 
  * This class and its implementations do not automatically filter out unwanted 
columns from those being combined, thus it is generally recommended to use a
  * {@link Combiner} implementation with the {@link 
ScannerBase#fetchColumnFamily(Text)} or {@link ScannerBase#fetchColumn(Text, 
Text)} methods.
+ *
+ * 
+ * WARNING : Using deletes with Combiners may not work as intended. See {@link 
#setReduceOnFullCompactionOnly(IteratorSetting, boolean)}
  */
 public abstract class Combiner extends WrappingIterator implements 
OptionDescriber {
-  static final Logger log = Logger.getLogger(Combiner.class);
+  static final Logger sawDeleteLog = 
Logger.getLogger(Combiner.class.getName()+".SawDelete");
   protected static final String COLUMNS_OPTION = "columns";
   protected static final String ALL_OPTION = "all";
+  protected static final String REDUCE_ON_FULL_COMPACTION_ONLY_OPTION = 
"reduceOnFullCompactionOnly";
+
+  private boolean isMajorCompaction;
+  private boolean reduceOnFullCompactionOnly;
 
   /**
* A Java Iterator that iterates over the Values for a given Key from a 
source SortedKeyValueIterator.
@@ -149,6 +166,27 @@ public abstract class Combiner extends WrappingIterator 
implements OptionDescrib
 
   private Key workKey = new Key();
 
+  @VisibleForTesting
+  static final Cache loggedMsgCache = 
CacheBuilder.newBuilder().expireAfterWrite(1, 
TimeUnit.HOURS).maximumSize(1).build();
+
+  private void sawDelete() {
+if (isMajorCompaction && !reduceOnFullCompactionOnly) {
+  try {
+loggedMsgCache.get(this.getClass().getName(), new Callable() {
+  @Override
+  public Boolean call() throws Exception {
+sawDeleteLog.error("Combiner 

[2/2] accumulo git commit: Merge branch '1.6' into 1.7

2015-10-02 Thread kturner
Merge branch '1.6' into 1.7

Conflicts:
core/src/main/java/org/apache/accumulo/core/iterators/Combiner.java


Project: http://git-wip-us.apache.org/repos/asf/accumulo/repo
Commit: http://git-wip-us.apache.org/repos/asf/accumulo/commit/f50db38f
Tree: http://git-wip-us.apache.org/repos/asf/accumulo/tree/f50db38f
Diff: http://git-wip-us.apache.org/repos/asf/accumulo/diff/f50db38f

Branch: refs/heads/1.7
Commit: f50db38f7ad71cb22480c457b7c42ab233c41b21
Parents: 38f36e2 7a1d6d9
Author: Keith Turner 
Authored: Fri Oct 2 11:46:54 2015 -0400
Committer: Keith Turner 
Committed: Fri Oct 2 11:46:54 2015 -0400

--
 .../accumulo/core/iterators/Combiner.java   |  97 ++-
 .../core/iterators/CombinerTestUtil.java|  23 +++
 .../iterators/user/BigDecimalCombinerTest.java  |   6 +-
 .../core/iterators/user/CombinerTest.java   | 170 ---
 4 files changed, 272 insertions(+), 24 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/accumulo/blob/f50db38f/core/src/main/java/org/apache/accumulo/core/iterators/Combiner.java
--
diff --cc core/src/main/java/org/apache/accumulo/core/iterators/Combiner.java
index 1c2d8b5,091803b..b3cd93b
--- a/core/src/main/java/org/apache/accumulo/core/iterators/Combiner.java
+++ b/core/src/main/java/org/apache/accumulo/core/iterators/Combiner.java
@@@ -31,10 -34,15 +34,16 @@@ import org.apache.accumulo.core.data.Ke
  import org.apache.accumulo.core.data.PartialKey;
  import org.apache.accumulo.core.data.Range;
  import org.apache.accumulo.core.data.Value;
+ import org.apache.accumulo.core.iterators.IteratorUtil.IteratorScope;
  import org.apache.accumulo.core.iterators.conf.ColumnSet;
  import org.apache.hadoop.io.Text;
 -import org.apache.log4j.Logger;
++import org.slf4j.Logger;
++import org.slf4j.LoggerFactory;
  
+ import com.google.common.annotations.VisibleForTesting;
  import com.google.common.base.Splitter;
+ import com.google.common.cache.Cache;
+ import com.google.common.cache.CacheBuilder;
  import com.google.common.collect.Lists;
  
  /**
@@@ -49,12 -59,21 +60,23 @@@
   * This reduce method will be passed the most recent Key and an iterator over 
the Values for all non-deleted versions of that Key. A combiner will not combine
   * keys that differ by more than the timestamp.
   *
+  * 
   * This class and its implementations do not automatically filter out 
unwanted columns from those being combined, thus it is generally recommended to 
use a
   * {@link Combiner} implementation with the {@link 
ScannerBase#fetchColumnFamily(Text)} or {@link ScannerBase#fetchColumn(Text, 
Text)} methods.
+  *
+  * 
+  * WARNING : Using deletes with Combiners may not work as intended. See 
{@link #setReduceOnFullCompactionOnly(IteratorSetting, boolean)}
   */
  public abstract class Combiner extends WrappingIterator implements 
OptionDescriber {
 -  static final Logger sawDeleteLog = 
Logger.getLogger(Combiner.class.getName()+".SawDelete");
++
++  static final Logger sawDeleteLog = 
LoggerFactory.getLogger(Combiner.class.getName() + ".SawDelete");
++
protected static final String COLUMNS_OPTION = "columns";
protected static final String ALL_OPTION = "all";
+   protected static final String REDUCE_ON_FULL_COMPACTION_ONLY_OPTION = 
"reduceOnFullCompactionOnly";
+ 
+   private boolean isMajorCompaction;
+   private boolean reduceOnFullCompactionOnly;
  
/**
 * A Java Iterator that iterates over the Values for a given Key from a 
source SortedKeyValueIterator.
@@@ -147,6 -166,27 +169,28 @@@
  
private Key workKey = new Key();
  
+   @VisibleForTesting
+   static final Cache loggedMsgCache = 
CacheBuilder.newBuilder().expireAfterWrite(1, 
TimeUnit.HOURS).maximumSize(1).build();
+ 
+   private void sawDelete() {
+ if (isMajorCompaction && !reduceOnFullCompactionOnly) {
+   try {
+ loggedMsgCache.get(this.getClass().getName(), new Callable() 
{
+   @Override
+   public Boolean call() throws Exception {
 -sawDeleteLog.error("Combiner of type " + 
Combiner.this.getClass().getSimpleName()
 -+ " saw a delete during a partial compaction.  This could 
cause undesired results.  See ACCUMULO-2232.  Will not log subsequent 
occurences for at least 1 hour.");
++sawDeleteLog.error(
++"Combiner of type {} saw a delete during a partial 
compaction.  This could cause undesired results.  See ACCUMULO-2232.  Will not 
log subsequent "
+++ "occurences for at least 1 hour.", 
Combiner.this.getClass().getSimpleName());
+ // the value is not used and does not matter
+ return Boolean.TRUE;
+   }
+ });
+   } catch (ExecutionException e) {
+ throw 

[1/2] accumulo git commit: ACCUMULO-2232 Added options to Combiner for handling deletes

2015-10-02 Thread kturner
Repository: accumulo
Updated Branches:
  refs/heads/1.7 38f36e26e -> f50db38f7


ACCUMULO-2232 Added options to Combiner for handling deletes


Project: http://git-wip-us.apache.org/repos/asf/accumulo/repo
Commit: http://git-wip-us.apache.org/repos/asf/accumulo/commit/7a1d6d92
Tree: http://git-wip-us.apache.org/repos/asf/accumulo/tree/7a1d6d92
Diff: http://git-wip-us.apache.org/repos/asf/accumulo/diff/7a1d6d92

Branch: refs/heads/1.7
Commit: 7a1d6d921ba81c7f92eab8d3b20aae461a46066a
Parents: e24bd36
Author: Keith Turner 
Authored: Fri Oct 2 10:19:37 2015 -0400
Committer: Keith Turner 
Committed: Fri Oct 2 11:10:00 2015 -0400

--
 .../accumulo/core/iterators/Combiner.java   |  93 +-
 .../core/iterators/CombinerTestUtil.java|  23 +++
 .../iterators/user/BigDecimalCombinerTest.java  |   6 +-
 .../core/iterators/user/CombinerTest.java   | 175 ---
 4 files changed, 270 insertions(+), 27 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/accumulo/blob/7a1d6d92/core/src/main/java/org/apache/accumulo/core/iterators/Combiner.java
--
diff --git 
a/core/src/main/java/org/apache/accumulo/core/iterators/Combiner.java 
b/core/src/main/java/org/apache/accumulo/core/iterators/Combiner.java
index 97d0ce3..091803b 100644
--- a/core/src/main/java/org/apache/accumulo/core/iterators/Combiner.java
+++ b/core/src/main/java/org/apache/accumulo/core/iterators/Combiner.java
@@ -22,6 +22,9 @@ import java.util.Iterator;
 import java.util.List;
 import java.util.Map;
 import java.util.NoSuchElementException;
+import java.util.concurrent.Callable;
+import java.util.concurrent.ExecutionException;
+import java.util.concurrent.TimeUnit;
 
 import org.apache.accumulo.core.client.IteratorSetting;
 import org.apache.accumulo.core.client.IteratorSetting.Column;
@@ -31,11 +34,15 @@ import org.apache.accumulo.core.data.Key;
 import org.apache.accumulo.core.data.PartialKey;
 import org.apache.accumulo.core.data.Range;
 import org.apache.accumulo.core.data.Value;
+import org.apache.accumulo.core.iterators.IteratorUtil.IteratorScope;
 import org.apache.accumulo.core.iterators.conf.ColumnSet;
 import org.apache.hadoop.io.Text;
 import org.apache.log4j.Logger;
 
+import com.google.common.annotations.VisibleForTesting;
 import com.google.common.base.Splitter;
+import com.google.common.cache.Cache;
+import com.google.common.cache.CacheBuilder;
 import com.google.common.collect.Lists;
 
 /**
@@ -45,18 +52,28 @@ import com.google.common.collect.Lists;
  * will combine all Keys in column family and qualifier individually. 
Combination is only ever performed on multiple versions and not across column 
qualifiers
  * or column visibilities.
  *
+ * 
  * Implementations must provide a reduce method: {@code public Value 
reduce(Key key, Iterator iter)}.
  *
+ * 
  * This reduce method will be passed the most recent Key and an iterator over 
the Values for all non-deleted versions of that Key. A combiner will not combine
  * keys that differ by more than the timestamp.
  *
+ * 
  * This class and its implementations do not automatically filter out unwanted 
columns from those being combined, thus it is generally recommended to use a
  * {@link Combiner} implementation with the {@link 
ScannerBase#fetchColumnFamily(Text)} or {@link ScannerBase#fetchColumn(Text, 
Text)} methods.
+ *
+ * 
+ * WARNING : Using deletes with Combiners may not work as intended. See {@link 
#setReduceOnFullCompactionOnly(IteratorSetting, boolean)}
  */
 public abstract class Combiner extends WrappingIterator implements 
OptionDescriber {
-  static final Logger log = Logger.getLogger(Combiner.class);
+  static final Logger sawDeleteLog = 
Logger.getLogger(Combiner.class.getName()+".SawDelete");
   protected static final String COLUMNS_OPTION = "columns";
   protected static final String ALL_OPTION = "all";
+  protected static final String REDUCE_ON_FULL_COMPACTION_ONLY_OPTION = 
"reduceOnFullCompactionOnly";
+
+  private boolean isMajorCompaction;
+  private boolean reduceOnFullCompactionOnly;
 
   /**
* A Java Iterator that iterates over the Values for a given Key from a 
source SortedKeyValueIterator.
@@ -149,6 +166,27 @@ public abstract class Combiner extends WrappingIterator 
implements OptionDescrib
 
   private Key workKey = new Key();
 
+  @VisibleForTesting
+  static final Cache loggedMsgCache = 
CacheBuilder.newBuilder().expireAfterWrite(1, 
TimeUnit.HOURS).maximumSize(1).build();
+
+  private void sawDelete() {
+if (isMajorCompaction && !reduceOnFullCompactionOnly) {
+  try {
+loggedMsgCache.get(this.getClass().getName(), new Callable() {
+  @Override
+  public Boolean call() throws Exception {
+sawDeleteLog.error("Combiner 

[3/7] accumulo git commit: Merge branch '1.6' of https://git-wip-us.apache.org/repos/asf/accumulo into 1.6

2015-10-02 Thread ecn
Merge branch '1.6' of https://git-wip-us.apache.org/repos/asf/accumulo into 1.6


Project: http://git-wip-us.apache.org/repos/asf/accumulo/repo
Commit: http://git-wip-us.apache.org/repos/asf/accumulo/commit/a922ed79
Tree: http://git-wip-us.apache.org/repos/asf/accumulo/tree/a922ed79
Diff: http://git-wip-us.apache.org/repos/asf/accumulo/diff/a922ed79

Branch: refs/heads/master
Commit: a922ed791acbda208529230c4c161bab285cbb91
Parents: fbb082d 4b5ea53
Author: Eric C. Newton 
Authored: Fri Oct 2 14:22:04 2015 -0400
Committer: Eric C. Newton 
Committed: Fri Oct 2 14:22:04 2015 -0400

--

--




[1/7] accumulo git commit: ACCUMULO-4016 use object reference equality to remove the minimum object queued

2015-10-02 Thread ecn
Repository: accumulo
Updated Branches:
  refs/heads/master 8f6ab6d3e -> 49b44e4eb


ACCUMULO-4016 use object reference equality to remove the minimum object queued


Project: http://git-wip-us.apache.org/repos/asf/accumulo/repo
Commit: http://git-wip-us.apache.org/repos/asf/accumulo/commit/fbb082d9
Tree: http://git-wip-us.apache.org/repos/asf/accumulo/tree/fbb082d9
Diff: http://git-wip-us.apache.org/repos/asf/accumulo/diff/fbb082d9

Branch: refs/heads/master
Commit: fbb082d962aa472240ffccce753c5b4309fd5a46
Parents: 7a1d6d9
Author: Eric C. Newton 
Authored: Fri Oct 2 13:09:57 2015 -0400
Committer: Eric C. Newton 
Committed: Fri Oct 2 14:20:32 2015 -0400

--
 .../java/org/apache/accumulo/tserver/CompactionQueue.java | 10 --
 1 file changed, 8 insertions(+), 2 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/accumulo/blob/fbb082d9/server/tserver/src/main/java/org/apache/accumulo/tserver/CompactionQueue.java
--
diff --git 
a/server/tserver/src/main/java/org/apache/accumulo/tserver/CompactionQueue.java 
b/server/tserver/src/main/java/org/apache/accumulo/tserver/CompactionQueue.java
index 0cb04a7..1e7c086 100644
--- 
a/server/tserver/src/main/java/org/apache/accumulo/tserver/CompactionQueue.java
+++ 
b/server/tserver/src/main/java/org/apache/accumulo/tserver/CompactionQueue.java
@@ -36,8 +36,14 @@ public class CompactionQueue extends AbstractQueue 
implements Blocking
   return null;
 
 Comparable min = Collections.min(task);
-task.remove(min);
-return (Runnable) min;
+Iterator iterator = task.iterator();
+while (iterator.hasNext()) {
+  if (iterator.next() == min) {
+iterator.remove();
+return (Runnable) min;
+  }
+}
+throw new IllegalStateException("Minimum object found, but not there when 
removing");
   }
 
   @Override



[1/2] accumulo git commit: Merge branch '1.7'

2015-10-02 Thread ecn
Repository: accumulo
Updated Branches:
  refs/heads/master 17ae2f919 -> 8f6ab6d3e


Merge branch '1.7'


Project: http://git-wip-us.apache.org/repos/asf/accumulo/repo
Commit: http://git-wip-us.apache.org/repos/asf/accumulo/commit/32907df8
Tree: http://git-wip-us.apache.org/repos/asf/accumulo/tree/32907df8
Diff: http://git-wip-us.apache.org/repos/asf/accumulo/diff/32907df8

Branch: refs/heads/master
Commit: 32907df8fd14cbf2e34400c46bdabb9a634fa0c2
Parents: 18e834e 0013e46
Author: Eric C. Newton 
Authored: Fri Oct 2 13:15:30 2015 -0400
Committer: Eric C. Newton 
Committed: Fri Oct 2 14:21:40 2015 -0400

--
 .../accumulo/core/iterators/Combiner.java   |  97 ++-
 .../core/iterators/CombinerTestUtil.java|  23 +++
 .../iterators/user/BigDecimalCombinerTest.java  |   6 +-
 .../core/iterators/user/CombinerTest.java   | 170 ---
 .../accumulo/tserver/CompactionQueue.java   |  10 +-
 5 files changed, 280 insertions(+), 26 deletions(-)
--




[1/2] accumulo git commit: ACCUMULO-4016 use object reference equality to remove the minimum object queued

2015-10-02 Thread ecn
Repository: accumulo
Updated Branches:
  refs/heads/1.6 4b5ea5355 -> a922ed791


ACCUMULO-4016 use object reference equality to remove the minimum object queued


Project: http://git-wip-us.apache.org/repos/asf/accumulo/repo
Commit: http://git-wip-us.apache.org/repos/asf/accumulo/commit/fbb082d9
Tree: http://git-wip-us.apache.org/repos/asf/accumulo/tree/fbb082d9
Diff: http://git-wip-us.apache.org/repos/asf/accumulo/diff/fbb082d9

Branch: refs/heads/1.6
Commit: fbb082d962aa472240ffccce753c5b4309fd5a46
Parents: 7a1d6d9
Author: Eric C. Newton 
Authored: Fri Oct 2 13:09:57 2015 -0400
Committer: Eric C. Newton 
Committed: Fri Oct 2 14:20:32 2015 -0400

--
 .../java/org/apache/accumulo/tserver/CompactionQueue.java | 10 --
 1 file changed, 8 insertions(+), 2 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/accumulo/blob/fbb082d9/server/tserver/src/main/java/org/apache/accumulo/tserver/CompactionQueue.java
--
diff --git 
a/server/tserver/src/main/java/org/apache/accumulo/tserver/CompactionQueue.java 
b/server/tserver/src/main/java/org/apache/accumulo/tserver/CompactionQueue.java
index 0cb04a7..1e7c086 100644
--- 
a/server/tserver/src/main/java/org/apache/accumulo/tserver/CompactionQueue.java
+++ 
b/server/tserver/src/main/java/org/apache/accumulo/tserver/CompactionQueue.java
@@ -36,8 +36,14 @@ public class CompactionQueue extends AbstractQueue 
implements Blocking
   return null;
 
 Comparable min = Collections.min(task);
-task.remove(min);
-return (Runnable) min;
+Iterator iterator = task.iterator();
+while (iterator.hasNext()) {
+  if (iterator.next() == min) {
+iterator.remove();
+return (Runnable) min;
+  }
+}
+throw new IllegalStateException("Minimum object found, but not there when 
removing");
   }
 
   @Override



[2/2] accumulo git commit: Merge branch 'master' of https://git-wip-us.apache.org/repos/asf/accumulo

2015-10-02 Thread ecn
Merge branch 'master' of https://git-wip-us.apache.org/repos/asf/accumulo


Project: http://git-wip-us.apache.org/repos/asf/accumulo/repo
Commit: http://git-wip-us.apache.org/repos/asf/accumulo/commit/8f6ab6d3
Tree: http://git-wip-us.apache.org/repos/asf/accumulo/tree/8f6ab6d3
Diff: http://git-wip-us.apache.org/repos/asf/accumulo/diff/8f6ab6d3

Branch: refs/heads/master
Commit: 8f6ab6d3e9d63dcc3b8447cf3a7ac0c6e7e80a94
Parents: 32907df 17ae2f9
Author: Eric C. Newton 
Authored: Fri Oct 2 14:22:23 2015 -0400
Committer: Eric C. Newton 
Committed: Fri Oct 2 14:22:23 2015 -0400

--

--




[1/2] accumulo git commit: ACCUMULO-3462 use object reference equality to remove the minimum object queued

2015-10-02 Thread ecn
Repository: accumulo
Updated Branches:
  refs/heads/1.7 f50db38f7 -> 0013e46e6


ACCUMULO-3462 use object reference equality to remove the minimum object queued


Project: http://git-wip-us.apache.org/repos/asf/accumulo/repo
Commit: http://git-wip-us.apache.org/repos/asf/accumulo/commit/4b5ea535
Tree: http://git-wip-us.apache.org/repos/asf/accumulo/tree/4b5ea535
Diff: http://git-wip-us.apache.org/repos/asf/accumulo/diff/4b5ea535

Branch: refs/heads/1.7
Commit: 4b5ea535516d98ac482e33e210a6c48fb8f12c43
Parents: 7a1d6d9
Author: Eric C. Newton 
Authored: Fri Oct 2 13:09:57 2015 -0400
Committer: Eric C. Newton 
Committed: Fri Oct 2 13:09:57 2015 -0400

--
 .../java/org/apache/accumulo/tserver/CompactionQueue.java | 10 --
 1 file changed, 8 insertions(+), 2 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/accumulo/blob/4b5ea535/server/tserver/src/main/java/org/apache/accumulo/tserver/CompactionQueue.java
--
diff --git 
a/server/tserver/src/main/java/org/apache/accumulo/tserver/CompactionQueue.java 
b/server/tserver/src/main/java/org/apache/accumulo/tserver/CompactionQueue.java
index 0cb04a7..1e7c086 100644
--- 
a/server/tserver/src/main/java/org/apache/accumulo/tserver/CompactionQueue.java
+++ 
b/server/tserver/src/main/java/org/apache/accumulo/tserver/CompactionQueue.java
@@ -36,8 +36,14 @@ public class CompactionQueue extends AbstractQueue 
implements Blocking
   return null;
 
 Comparable min = Collections.min(task);
-task.remove(min);
-return (Runnable) min;
+Iterator iterator = task.iterator();
+while (iterator.hasNext()) {
+  if (iterator.next() == min) {
+iterator.remove();
+return (Runnable) min;
+  }
+}
+throw new IllegalStateException("Minimum object found, but not there when 
removing");
   }
 
   @Override



[5/5] accumulo git commit: Merge branch '1.7'

2015-10-02 Thread ecn
Merge branch '1.7'


Project: http://git-wip-us.apache.org/repos/asf/accumulo/repo
Commit: http://git-wip-us.apache.org/repos/asf/accumulo/commit/17ae2f91
Tree: http://git-wip-us.apache.org/repos/asf/accumulo/tree/17ae2f91
Diff: http://git-wip-us.apache.org/repos/asf/accumulo/diff/17ae2f91

Branch: refs/heads/master
Commit: 17ae2f919024daef4a6b4dff7ac92aefd8805de2
Parents: 18e834e 0013e46
Author: Eric C. Newton 
Authored: Fri Oct 2 13:15:30 2015 -0400
Committer: Eric C. Newton 
Committed: Fri Oct 2 13:15:30 2015 -0400

--
 .../accumulo/core/iterators/Combiner.java   |  97 ++-
 .../core/iterators/CombinerTestUtil.java|  23 +++
 .../iterators/user/BigDecimalCombinerTest.java  |   6 +-
 .../core/iterators/user/CombinerTest.java   | 170 ---
 .../accumulo/tserver/CompactionQueue.java   |  10 +-
 5 files changed, 280 insertions(+), 26 deletions(-)
--




[1/5] accumulo git commit: ACCUMULO-2232 Added options to Combiner for handling deletes

2015-10-02 Thread ecn
Repository: accumulo
Updated Branches:
  refs/heads/master 18e834ec2 -> 17ae2f919


ACCUMULO-2232 Added options to Combiner for handling deletes


Project: http://git-wip-us.apache.org/repos/asf/accumulo/repo
Commit: http://git-wip-us.apache.org/repos/asf/accumulo/commit/7a1d6d92
Tree: http://git-wip-us.apache.org/repos/asf/accumulo/tree/7a1d6d92
Diff: http://git-wip-us.apache.org/repos/asf/accumulo/diff/7a1d6d92

Branch: refs/heads/master
Commit: 7a1d6d921ba81c7f92eab8d3b20aae461a46066a
Parents: e24bd36
Author: Keith Turner 
Authored: Fri Oct 2 10:19:37 2015 -0400
Committer: Keith Turner 
Committed: Fri Oct 2 11:10:00 2015 -0400

--
 .../accumulo/core/iterators/Combiner.java   |  93 +-
 .../core/iterators/CombinerTestUtil.java|  23 +++
 .../iterators/user/BigDecimalCombinerTest.java  |   6 +-
 .../core/iterators/user/CombinerTest.java   | 175 ---
 4 files changed, 270 insertions(+), 27 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/accumulo/blob/7a1d6d92/core/src/main/java/org/apache/accumulo/core/iterators/Combiner.java
--
diff --git 
a/core/src/main/java/org/apache/accumulo/core/iterators/Combiner.java 
b/core/src/main/java/org/apache/accumulo/core/iterators/Combiner.java
index 97d0ce3..091803b 100644
--- a/core/src/main/java/org/apache/accumulo/core/iterators/Combiner.java
+++ b/core/src/main/java/org/apache/accumulo/core/iterators/Combiner.java
@@ -22,6 +22,9 @@ import java.util.Iterator;
 import java.util.List;
 import java.util.Map;
 import java.util.NoSuchElementException;
+import java.util.concurrent.Callable;
+import java.util.concurrent.ExecutionException;
+import java.util.concurrent.TimeUnit;
 
 import org.apache.accumulo.core.client.IteratorSetting;
 import org.apache.accumulo.core.client.IteratorSetting.Column;
@@ -31,11 +34,15 @@ import org.apache.accumulo.core.data.Key;
 import org.apache.accumulo.core.data.PartialKey;
 import org.apache.accumulo.core.data.Range;
 import org.apache.accumulo.core.data.Value;
+import org.apache.accumulo.core.iterators.IteratorUtil.IteratorScope;
 import org.apache.accumulo.core.iterators.conf.ColumnSet;
 import org.apache.hadoop.io.Text;
 import org.apache.log4j.Logger;
 
+import com.google.common.annotations.VisibleForTesting;
 import com.google.common.base.Splitter;
+import com.google.common.cache.Cache;
+import com.google.common.cache.CacheBuilder;
 import com.google.common.collect.Lists;
 
 /**
@@ -45,18 +52,28 @@ import com.google.common.collect.Lists;
  * will combine all Keys in column family and qualifier individually. 
Combination is only ever performed on multiple versions and not across column 
qualifiers
  * or column visibilities.
  *
+ * 
  * Implementations must provide a reduce method: {@code public Value 
reduce(Key key, Iterator iter)}.
  *
+ * 
  * This reduce method will be passed the most recent Key and an iterator over 
the Values for all non-deleted versions of that Key. A combiner will not combine
  * keys that differ by more than the timestamp.
  *
+ * 
  * This class and its implementations do not automatically filter out unwanted 
columns from those being combined, thus it is generally recommended to use a
  * {@link Combiner} implementation with the {@link 
ScannerBase#fetchColumnFamily(Text)} or {@link ScannerBase#fetchColumn(Text, 
Text)} methods.
+ *
+ * 
+ * WARNING : Using deletes with Combiners may not work as intended. See {@link 
#setReduceOnFullCompactionOnly(IteratorSetting, boolean)}
  */
 public abstract class Combiner extends WrappingIterator implements 
OptionDescriber {
-  static final Logger log = Logger.getLogger(Combiner.class);
+  static final Logger sawDeleteLog = 
Logger.getLogger(Combiner.class.getName()+".SawDelete");
   protected static final String COLUMNS_OPTION = "columns";
   protected static final String ALL_OPTION = "all";
+  protected static final String REDUCE_ON_FULL_COMPACTION_ONLY_OPTION = 
"reduceOnFullCompactionOnly";
+
+  private boolean isMajorCompaction;
+  private boolean reduceOnFullCompactionOnly;
 
   /**
* A Java Iterator that iterates over the Values for a given Key from a 
source SortedKeyValueIterator.
@@ -149,6 +166,27 @@ public abstract class Combiner extends WrappingIterator 
implements OptionDescrib
 
   private Key workKey = new Key();
 
+  @VisibleForTesting
+  static final Cache loggedMsgCache = 
CacheBuilder.newBuilder().expireAfterWrite(1, 
TimeUnit.HOURS).maximumSize(1).build();
+
+  private void sawDelete() {
+if (isMajorCompaction && !reduceOnFullCompactionOnly) {
+  try {
+loggedMsgCache.get(this.getClass().getName(), new Callable() {
+  @Override
+  public Boolean call() throws Exception {
+

[3/5] accumulo git commit: ACCUMULO-3462 use object reference equality to remove the minimum object queued

2015-10-02 Thread ecn
ACCUMULO-3462 use object reference equality to remove the minimum object queued


Project: http://git-wip-us.apache.org/repos/asf/accumulo/repo
Commit: http://git-wip-us.apache.org/repos/asf/accumulo/commit/4b5ea535
Tree: http://git-wip-us.apache.org/repos/asf/accumulo/tree/4b5ea535
Diff: http://git-wip-us.apache.org/repos/asf/accumulo/diff/4b5ea535

Branch: refs/heads/master
Commit: 4b5ea535516d98ac482e33e210a6c48fb8f12c43
Parents: 7a1d6d9
Author: Eric C. Newton 
Authored: Fri Oct 2 13:09:57 2015 -0400
Committer: Eric C. Newton 
Committed: Fri Oct 2 13:09:57 2015 -0400

--
 .../java/org/apache/accumulo/tserver/CompactionQueue.java | 10 --
 1 file changed, 8 insertions(+), 2 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/accumulo/blob/4b5ea535/server/tserver/src/main/java/org/apache/accumulo/tserver/CompactionQueue.java
--
diff --git 
a/server/tserver/src/main/java/org/apache/accumulo/tserver/CompactionQueue.java 
b/server/tserver/src/main/java/org/apache/accumulo/tserver/CompactionQueue.java
index 0cb04a7..1e7c086 100644
--- 
a/server/tserver/src/main/java/org/apache/accumulo/tserver/CompactionQueue.java
+++ 
b/server/tserver/src/main/java/org/apache/accumulo/tserver/CompactionQueue.java
@@ -36,8 +36,14 @@ public class CompactionQueue extends AbstractQueue 
implements Blocking
   return null;
 
 Comparable min = Collections.min(task);
-task.remove(min);
-return (Runnable) min;
+Iterator iterator = task.iterator();
+while (iterator.hasNext()) {
+  if (iterator.next() == min) {
+iterator.remove();
+return (Runnable) min;
+  }
+}
+throw new IllegalStateException("Minimum object found, but not there when 
removing");
   }
 
   @Override



accumulo git commit: ACCUMULO-4016 wrapper classes should forward to underlying methods

2015-10-02 Thread ecn
Repository: accumulo
Updated Branches:
  refs/heads/1.6 a922ed791 -> a39b3f6be


ACCUMULO-4016 wrapper classes should forward to underlying methods


Project: http://git-wip-us.apache.org/repos/asf/accumulo/repo
Commit: http://git-wip-us.apache.org/repos/asf/accumulo/commit/a39b3f6b
Tree: http://git-wip-us.apache.org/repos/asf/accumulo/tree/a39b3f6b
Diff: http://git-wip-us.apache.org/repos/asf/accumulo/diff/a39b3f6b

Branch: refs/heads/1.6
Commit: a39b3f6be7eace0c8980517800ce068bb6cc1afc
Parents: a922ed7
Author: Eric C. Newton 
Authored: Fri Oct 2 14:40:48 2015 -0400
Committer: Eric C. Newton 
Committed: Fri Oct 2 14:40:48 2015 -0400

--
 .../java/org/apache/accumulo/trace/instrument/TraceRunnable.java   | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
--


http://git-wip-us.apache.org/repos/asf/accumulo/blob/a39b3f6b/trace/src/main/java/org/apache/accumulo/trace/instrument/TraceRunnable.java
--
diff --git 
a/trace/src/main/java/org/apache/accumulo/trace/instrument/TraceRunnable.java 
b/trace/src/main/java/org/apache/accumulo/trace/instrument/TraceRunnable.java
index 3b7d4f6..45df0fe 100644
--- 
a/trace/src/main/java/org/apache/accumulo/trace/instrument/TraceRunnable.java
+++ 
b/trace/src/main/java/org/apache/accumulo/trace/instrument/TraceRunnable.java
@@ -51,7 +51,7 @@ public class TraceRunnable implements Runnable, 
Comparable {
   @Override
   public boolean equals(Object o) {
 if (o instanceof TraceRunnable) {
-  return 0 == this.compareTo((TraceRunnable) o);
+  return runnable.equals(((TraceRunnable) o).runnable);
 }
 
 return false;



[3/4] accumulo git commit: ACCUMULO-4016 wrapper classes should forward to underlying methods

2015-10-02 Thread ecn
ACCUMULO-4016 wrapper classes should forward to underlying methods


Project: http://git-wip-us.apache.org/repos/asf/accumulo/repo
Commit: http://git-wip-us.apache.org/repos/asf/accumulo/commit/a39b3f6b
Tree: http://git-wip-us.apache.org/repos/asf/accumulo/tree/a39b3f6b
Diff: http://git-wip-us.apache.org/repos/asf/accumulo/diff/a39b3f6b

Branch: refs/heads/1.7
Commit: a39b3f6be7eace0c8980517800ce068bb6cc1afc
Parents: a922ed7
Author: Eric C. Newton 
Authored: Fri Oct 2 14:40:48 2015 -0400
Committer: Eric C. Newton 
Committed: Fri Oct 2 14:40:48 2015 -0400

--
 .../java/org/apache/accumulo/trace/instrument/TraceRunnable.java   | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
--


http://git-wip-us.apache.org/repos/asf/accumulo/blob/a39b3f6b/trace/src/main/java/org/apache/accumulo/trace/instrument/TraceRunnable.java
--
diff --git 
a/trace/src/main/java/org/apache/accumulo/trace/instrument/TraceRunnable.java 
b/trace/src/main/java/org/apache/accumulo/trace/instrument/TraceRunnable.java
index 3b7d4f6..45df0fe 100644
--- 
a/trace/src/main/java/org/apache/accumulo/trace/instrument/TraceRunnable.java
+++ 
b/trace/src/main/java/org/apache/accumulo/trace/instrument/TraceRunnable.java
@@ -51,7 +51,7 @@ public class TraceRunnable implements Runnable, 
Comparable {
   @Override
   public boolean equals(Object o) {
 if (o instanceof TraceRunnable) {
-  return 0 == this.compareTo((TraceRunnable) o);
+  return runnable.equals(((TraceRunnable) o).runnable);
 }
 
 return false;



[2/2] accumulo git commit: ACCUMULO-3462 use object reference equality to remove the minimum object queued

2015-10-02 Thread ecn
ACCUMULO-3462 use object reference equality to remove the minimum object queued


Project: http://git-wip-us.apache.org/repos/asf/accumulo/repo
Commit: http://git-wip-us.apache.org/repos/asf/accumulo/commit/0013e46e
Tree: http://git-wip-us.apache.org/repos/asf/accumulo/tree/0013e46e
Diff: http://git-wip-us.apache.org/repos/asf/accumulo/diff/0013e46e

Branch: refs/heads/1.7
Commit: 0013e46e6b7f195f9d17dbd540b841d2933ac37b
Parents: f50db38 4b5ea53
Author: Eric C. Newton 
Authored: Fri Oct 2 13:15:15 2015 -0400
Committer: Eric C. Newton 
Committed: Fri Oct 2 13:15:15 2015 -0400

--
 .../java/org/apache/accumulo/tserver/CompactionQueue.java | 10 --
 1 file changed, 8 insertions(+), 2 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/accumulo/blob/0013e46e/server/tserver/src/main/java/org/apache/accumulo/tserver/CompactionQueue.java
--
diff --cc 
server/tserver/src/main/java/org/apache/accumulo/tserver/CompactionQueue.java
index bbb6536,1e7c086..f87131e
--- 
a/server/tserver/src/main/java/org/apache/accumulo/tserver/CompactionQueue.java
+++ 
b/server/tserver/src/main/java/org/apache/accumulo/tserver/CompactionQueue.java
@@@ -48,9 -35,15 +48,15 @@@ class CompactionQueue extends AbstractQ
  if (task.size() == 0)
return null;
  
 -Comparable min = Collections.min(task);
 -Iterator iterator = task.iterator();
 +TraceRunnable min = Collections.min(task, comparator);
- task.remove(min);
- return min;
++Iterator iterator = task.iterator();
+ while (iterator.hasNext()) {
+   if (iterator.next() == min) {
+ iterator.remove();
 -return (Runnable) min;
++return min;
+   }
+ }
+ throw new IllegalStateException("Minimum object found, but not there when 
removing");
}
  
@Override



[4/5] accumulo git commit: ACCUMULO-3462 use object reference equality to remove the minimum object queued

2015-10-02 Thread ecn
ACCUMULO-3462 use object reference equality to remove the minimum object queued


Project: http://git-wip-us.apache.org/repos/asf/accumulo/repo
Commit: http://git-wip-us.apache.org/repos/asf/accumulo/commit/0013e46e
Tree: http://git-wip-us.apache.org/repos/asf/accumulo/tree/0013e46e
Diff: http://git-wip-us.apache.org/repos/asf/accumulo/diff/0013e46e

Branch: refs/heads/master
Commit: 0013e46e6b7f195f9d17dbd540b841d2933ac37b
Parents: f50db38 4b5ea53
Author: Eric C. Newton 
Authored: Fri Oct 2 13:15:15 2015 -0400
Committer: Eric C. Newton 
Committed: Fri Oct 2 13:15:15 2015 -0400

--
 .../java/org/apache/accumulo/tserver/CompactionQueue.java | 10 --
 1 file changed, 8 insertions(+), 2 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/accumulo/blob/0013e46e/server/tserver/src/main/java/org/apache/accumulo/tserver/CompactionQueue.java
--
diff --cc 
server/tserver/src/main/java/org/apache/accumulo/tserver/CompactionQueue.java
index bbb6536,1e7c086..f87131e
--- 
a/server/tserver/src/main/java/org/apache/accumulo/tserver/CompactionQueue.java
+++ 
b/server/tserver/src/main/java/org/apache/accumulo/tserver/CompactionQueue.java
@@@ -48,9 -35,15 +48,15 @@@ class CompactionQueue extends AbstractQ
  if (task.size() == 0)
return null;
  
 -Comparable min = Collections.min(task);
 -Iterator iterator = task.iterator();
 +TraceRunnable min = Collections.min(task, comparator);
- task.remove(min);
- return min;
++Iterator iterator = task.iterator();
+ while (iterator.hasNext()) {
+   if (iterator.next() == min) {
+ iterator.remove();
 -return (Runnable) min;
++return min;
+   }
+ }
+ throw new IllegalStateException("Minimum object found, but not there when 
removing");
}
  
@Override



[2/5] accumulo git commit: Merge branch '1.6' into 1.7

2015-10-02 Thread ecn
Merge branch '1.6' into 1.7

Conflicts:
core/src/main/java/org/apache/accumulo/core/iterators/Combiner.java


Project: http://git-wip-us.apache.org/repos/asf/accumulo/repo
Commit: http://git-wip-us.apache.org/repos/asf/accumulo/commit/f50db38f
Tree: http://git-wip-us.apache.org/repos/asf/accumulo/tree/f50db38f
Diff: http://git-wip-us.apache.org/repos/asf/accumulo/diff/f50db38f

Branch: refs/heads/master
Commit: f50db38f7ad71cb22480c457b7c42ab233c41b21
Parents: 38f36e2 7a1d6d9
Author: Keith Turner 
Authored: Fri Oct 2 11:46:54 2015 -0400
Committer: Keith Turner 
Committed: Fri Oct 2 11:46:54 2015 -0400

--
 .../accumulo/core/iterators/Combiner.java   |  97 ++-
 .../core/iterators/CombinerTestUtil.java|  23 +++
 .../iterators/user/BigDecimalCombinerTest.java  |   6 +-
 .../core/iterators/user/CombinerTest.java   | 170 ---
 4 files changed, 272 insertions(+), 24 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/accumulo/blob/f50db38f/core/src/main/java/org/apache/accumulo/core/iterators/Combiner.java
--
diff --cc core/src/main/java/org/apache/accumulo/core/iterators/Combiner.java
index 1c2d8b5,091803b..b3cd93b
--- a/core/src/main/java/org/apache/accumulo/core/iterators/Combiner.java
+++ b/core/src/main/java/org/apache/accumulo/core/iterators/Combiner.java
@@@ -31,10 -34,15 +34,16 @@@ import org.apache.accumulo.core.data.Ke
  import org.apache.accumulo.core.data.PartialKey;
  import org.apache.accumulo.core.data.Range;
  import org.apache.accumulo.core.data.Value;
+ import org.apache.accumulo.core.iterators.IteratorUtil.IteratorScope;
  import org.apache.accumulo.core.iterators.conf.ColumnSet;
  import org.apache.hadoop.io.Text;
 -import org.apache.log4j.Logger;
++import org.slf4j.Logger;
++import org.slf4j.LoggerFactory;
  
+ import com.google.common.annotations.VisibleForTesting;
  import com.google.common.base.Splitter;
+ import com.google.common.cache.Cache;
+ import com.google.common.cache.CacheBuilder;
  import com.google.common.collect.Lists;
  
  /**
@@@ -49,12 -59,21 +60,23 @@@
   * This reduce method will be passed the most recent Key and an iterator over 
the Values for all non-deleted versions of that Key. A combiner will not combine
   * keys that differ by more than the timestamp.
   *
+  * 
   * This class and its implementations do not automatically filter out 
unwanted columns from those being combined, thus it is generally recommended to 
use a
   * {@link Combiner} implementation with the {@link 
ScannerBase#fetchColumnFamily(Text)} or {@link ScannerBase#fetchColumn(Text, 
Text)} methods.
+  *
+  * 
+  * WARNING : Using deletes with Combiners may not work as intended. See 
{@link #setReduceOnFullCompactionOnly(IteratorSetting, boolean)}
   */
  public abstract class Combiner extends WrappingIterator implements 
OptionDescriber {
 -  static final Logger sawDeleteLog = 
Logger.getLogger(Combiner.class.getName()+".SawDelete");
++
++  static final Logger sawDeleteLog = 
LoggerFactory.getLogger(Combiner.class.getName() + ".SawDelete");
++
protected static final String COLUMNS_OPTION = "columns";
protected static final String ALL_OPTION = "all";
+   protected static final String REDUCE_ON_FULL_COMPACTION_ONLY_OPTION = 
"reduceOnFullCompactionOnly";
+ 
+   private boolean isMajorCompaction;
+   private boolean reduceOnFullCompactionOnly;
  
/**
 * A Java Iterator that iterates over the Values for a given Key from a 
source SortedKeyValueIterator.
@@@ -147,6 -166,27 +169,28 @@@
  
private Key workKey = new Key();
  
+   @VisibleForTesting
+   static final Cache loggedMsgCache = 
CacheBuilder.newBuilder().expireAfterWrite(1, 
TimeUnit.HOURS).maximumSize(1).build();
+ 
+   private void sawDelete() {
+ if (isMajorCompaction && !reduceOnFullCompactionOnly) {
+   try {
+ loggedMsgCache.get(this.getClass().getName(), new Callable() 
{
+   @Override
+   public Boolean call() throws Exception {
 -sawDeleteLog.error("Combiner of type " + 
Combiner.this.getClass().getSimpleName()
 -+ " saw a delete during a partial compaction.  This could 
cause undesired results.  See ACCUMULO-2232.  Will not log subsequent 
occurences for at least 1 hour.");
++sawDeleteLog.error(
++"Combiner of type {} saw a delete during a partial 
compaction.  This could cause undesired results.  See ACCUMULO-2232.  Will not 
log subsequent "
+++ "occurences for at least 1 hour.", 
Combiner.this.getClass().getSimpleName());
+ // the value is not used and does not matter
+ return Boolean.TRUE;
+   }
+ });
+   } catch (ExecutionException e) {
+ throw 

[2/2] accumulo git commit: Merge branch '1.6' of https://git-wip-us.apache.org/repos/asf/accumulo into 1.6

2015-10-02 Thread ecn
Merge branch '1.6' of https://git-wip-us.apache.org/repos/asf/accumulo into 1.6


Project: http://git-wip-us.apache.org/repos/asf/accumulo/repo
Commit: http://git-wip-us.apache.org/repos/asf/accumulo/commit/a922ed79
Tree: http://git-wip-us.apache.org/repos/asf/accumulo/tree/a922ed79
Diff: http://git-wip-us.apache.org/repos/asf/accumulo/diff/a922ed79

Branch: refs/heads/1.6
Commit: a922ed791acbda208529230c4c161bab285cbb91
Parents: fbb082d 4b5ea53
Author: Eric C. Newton 
Authored: Fri Oct 2 14:22:04 2015 -0400
Committer: Eric C. Newton 
Committed: Fri Oct 2 14:22:04 2015 -0400

--

--




[1/2] accumulo git commit: ACCUMULO-4016 use object reference equality to remove the minimum object queued

2015-10-02 Thread ecn
Repository: accumulo
Updated Branches:
  refs/heads/1.7 0013e46e6 -> 01234bef3


ACCUMULO-4016 use object reference equality to remove the minimum object queued


Project: http://git-wip-us.apache.org/repos/asf/accumulo/repo
Commit: http://git-wip-us.apache.org/repos/asf/accumulo/commit/747a1901
Tree: http://git-wip-us.apache.org/repos/asf/accumulo/tree/747a1901
Diff: http://git-wip-us.apache.org/repos/asf/accumulo/diff/747a1901

Branch: refs/heads/1.7
Commit: 747a1901cc964e61ffd7f32b0b4302b28397a615
Parents: f50db38 4b5ea53
Author: Eric C. Newton 
Authored: Fri Oct 2 13:15:15 2015 -0400
Committer: Eric C. Newton 
Committed: Fri Oct 2 14:21:27 2015 -0400

--
 .../java/org/apache/accumulo/tserver/CompactionQueue.java | 10 --
 1 file changed, 8 insertions(+), 2 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/accumulo/blob/747a1901/server/tserver/src/main/java/org/apache/accumulo/tserver/CompactionQueue.java
--
diff --cc 
server/tserver/src/main/java/org/apache/accumulo/tserver/CompactionQueue.java
index bbb6536,1e7c086..f87131e
--- 
a/server/tserver/src/main/java/org/apache/accumulo/tserver/CompactionQueue.java
+++ 
b/server/tserver/src/main/java/org/apache/accumulo/tserver/CompactionQueue.java
@@@ -48,9 -35,15 +48,15 @@@ class CompactionQueue extends AbstractQ
  if (task.size() == 0)
return null;
  
 -Comparable min = Collections.min(task);
 -Iterator iterator = task.iterator();
 +TraceRunnable min = Collections.min(task, comparator);
- task.remove(min);
- return min;
++Iterator iterator = task.iterator();
+ while (iterator.hasNext()) {
+   if (iterator.next() == min) {
+ iterator.remove();
 -return (Runnable) min;
++return min;
+   }
+ }
+ throw new IllegalStateException("Minimum object found, but not there when 
removing");
}
  
@Override



[4/7] accumulo git commit: Merge branch '1.7' of https://git-wip-us.apache.org/repos/asf/accumulo into 1.7

2015-10-02 Thread ecn
Merge branch '1.7' of https://git-wip-us.apache.org/repos/asf/accumulo into 1.7


Project: http://git-wip-us.apache.org/repos/asf/accumulo/repo
Commit: http://git-wip-us.apache.org/repos/asf/accumulo/commit/01234bef
Tree: http://git-wip-us.apache.org/repos/asf/accumulo/tree/01234bef
Diff: http://git-wip-us.apache.org/repos/asf/accumulo/diff/01234bef

Branch: refs/heads/master
Commit: 01234bef3a6ff8d456830245d64a0747b0d1a1ae
Parents: 747a190 0013e46
Author: Eric C. Newton 
Authored: Fri Oct 2 14:22:14 2015 -0400
Committer: Eric C. Newton 
Committed: Fri Oct 2 14:22:14 2015 -0400

--

--




[4/4] accumulo git commit: ACCUMULO-4016 resolve conflict

2015-10-02 Thread ecn
ACCUMULO-4016 resolve conflict


Project: http://git-wip-us.apache.org/repos/asf/accumulo/repo
Commit: http://git-wip-us.apache.org/repos/asf/accumulo/commit/4623103e
Tree: http://git-wip-us.apache.org/repos/asf/accumulo/tree/4623103e
Diff: http://git-wip-us.apache.org/repos/asf/accumulo/diff/4623103e

Branch: refs/heads/1.7
Commit: 4623103e2644e46eb06d8a0a0cddf9ac8f6e622e
Parents: 01234be a39b3f6
Author: Eric C. Newton 
Authored: Fri Oct 2 14:42:19 2015 -0400
Committer: Eric C. Newton 
Committed: Fri Oct 2 14:42:19 2015 -0400

--

--




[6/7] accumulo git commit: ACCUMULO-4016 resolve conflict

2015-10-02 Thread ecn
ACCUMULO-4016 resolve conflict


Project: http://git-wip-us.apache.org/repos/asf/accumulo/repo
Commit: http://git-wip-us.apache.org/repos/asf/accumulo/commit/4623103e
Tree: http://git-wip-us.apache.org/repos/asf/accumulo/tree/4623103e
Diff: http://git-wip-us.apache.org/repos/asf/accumulo/diff/4623103e

Branch: refs/heads/master
Commit: 4623103e2644e46eb06d8a0a0cddf9ac8f6e622e
Parents: 01234be a39b3f6
Author: Eric C. Newton 
Authored: Fri Oct 2 14:42:19 2015 -0400
Committer: Eric C. Newton 
Committed: Fri Oct 2 14:42:19 2015 -0400

--

--




[1/4] accumulo git commit: ACCUMULO-4016 use object reference equality to remove the minimum object queued

2015-10-02 Thread ecn
Repository: accumulo
Updated Branches:
  refs/heads/1.7 01234bef3 -> 4623103e2


ACCUMULO-4016 use object reference equality to remove the minimum object queued


Project: http://git-wip-us.apache.org/repos/asf/accumulo/repo
Commit: http://git-wip-us.apache.org/repos/asf/accumulo/commit/fbb082d9
Tree: http://git-wip-us.apache.org/repos/asf/accumulo/tree/fbb082d9
Diff: http://git-wip-us.apache.org/repos/asf/accumulo/diff/fbb082d9

Branch: refs/heads/1.7
Commit: fbb082d962aa472240ffccce753c5b4309fd5a46
Parents: 7a1d6d9
Author: Eric C. Newton 
Authored: Fri Oct 2 13:09:57 2015 -0400
Committer: Eric C. Newton 
Committed: Fri Oct 2 14:20:32 2015 -0400

--
 .../java/org/apache/accumulo/tserver/CompactionQueue.java | 10 --
 1 file changed, 8 insertions(+), 2 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/accumulo/blob/fbb082d9/server/tserver/src/main/java/org/apache/accumulo/tserver/CompactionQueue.java
--
diff --git 
a/server/tserver/src/main/java/org/apache/accumulo/tserver/CompactionQueue.java 
b/server/tserver/src/main/java/org/apache/accumulo/tserver/CompactionQueue.java
index 0cb04a7..1e7c086 100644
--- 
a/server/tserver/src/main/java/org/apache/accumulo/tserver/CompactionQueue.java
+++ 
b/server/tserver/src/main/java/org/apache/accumulo/tserver/CompactionQueue.java
@@ -36,8 +36,14 @@ public class CompactionQueue extends AbstractQueue 
implements Blocking
   return null;
 
 Comparable min = Collections.min(task);
-task.remove(min);
-return (Runnable) min;
+Iterator iterator = task.iterator();
+while (iterator.hasNext()) {
+  if (iterator.next() == min) {
+iterator.remove();
+return (Runnable) min;
+  }
+}
+throw new IllegalStateException("Minimum object found, but not there when 
removing");
   }
 
   @Override



[5/7] accumulo git commit: ACCUMULO-4016 wrapper classes should forward to underlying methods

2015-10-02 Thread ecn
ACCUMULO-4016 wrapper classes should forward to underlying methods


Project: http://git-wip-us.apache.org/repos/asf/accumulo/repo
Commit: http://git-wip-us.apache.org/repos/asf/accumulo/commit/a39b3f6b
Tree: http://git-wip-us.apache.org/repos/asf/accumulo/tree/a39b3f6b
Diff: http://git-wip-us.apache.org/repos/asf/accumulo/diff/a39b3f6b

Branch: refs/heads/master
Commit: a39b3f6be7eace0c8980517800ce068bb6cc1afc
Parents: a922ed7
Author: Eric C. Newton 
Authored: Fri Oct 2 14:40:48 2015 -0400
Committer: Eric C. Newton 
Committed: Fri Oct 2 14:40:48 2015 -0400

--
 .../java/org/apache/accumulo/trace/instrument/TraceRunnable.java   | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
--


http://git-wip-us.apache.org/repos/asf/accumulo/blob/a39b3f6b/trace/src/main/java/org/apache/accumulo/trace/instrument/TraceRunnable.java
--
diff --git 
a/trace/src/main/java/org/apache/accumulo/trace/instrument/TraceRunnable.java 
b/trace/src/main/java/org/apache/accumulo/trace/instrument/TraceRunnable.java
index 3b7d4f6..45df0fe 100644
--- 
a/trace/src/main/java/org/apache/accumulo/trace/instrument/TraceRunnable.java
+++ 
b/trace/src/main/java/org/apache/accumulo/trace/instrument/TraceRunnable.java
@@ -51,7 +51,7 @@ public class TraceRunnable implements Runnable, 
Comparable {
   @Override
   public boolean equals(Object o) {
 if (o instanceof TraceRunnable) {
-  return 0 == this.compareTo((TraceRunnable) o);
+  return runnable.equals(((TraceRunnable) o).runnable);
 }
 
 return false;



[2/7] accumulo git commit: ACCUMULO-4016 use object reference equality to remove the minimum object queued

2015-10-02 Thread ecn
ACCUMULO-4016 use object reference equality to remove the minimum object queued


Project: http://git-wip-us.apache.org/repos/asf/accumulo/repo
Commit: http://git-wip-us.apache.org/repos/asf/accumulo/commit/747a1901
Tree: http://git-wip-us.apache.org/repos/asf/accumulo/tree/747a1901
Diff: http://git-wip-us.apache.org/repos/asf/accumulo/diff/747a1901

Branch: refs/heads/master
Commit: 747a1901cc964e61ffd7f32b0b4302b28397a615
Parents: f50db38 4b5ea53
Author: Eric C. Newton 
Authored: Fri Oct 2 13:15:15 2015 -0400
Committer: Eric C. Newton 
Committed: Fri Oct 2 14:21:27 2015 -0400

--
 .../java/org/apache/accumulo/tserver/CompactionQueue.java | 10 --
 1 file changed, 8 insertions(+), 2 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/accumulo/blob/747a1901/server/tserver/src/main/java/org/apache/accumulo/tserver/CompactionQueue.java
--
diff --cc 
server/tserver/src/main/java/org/apache/accumulo/tserver/CompactionQueue.java
index bbb6536,1e7c086..f87131e
--- 
a/server/tserver/src/main/java/org/apache/accumulo/tserver/CompactionQueue.java
+++ 
b/server/tserver/src/main/java/org/apache/accumulo/tserver/CompactionQueue.java
@@@ -48,9 -35,15 +48,15 @@@ class CompactionQueue extends AbstractQ
  if (task.size() == 0)
return null;
  
 -Comparable min = Collections.min(task);
 -Iterator iterator = task.iterator();
 +TraceRunnable min = Collections.min(task, comparator);
- task.remove(min);
- return min;
++Iterator iterator = task.iterator();
+ while (iterator.hasNext()) {
+   if (iterator.next() == min) {
+ iterator.remove();
 -return (Runnable) min;
++return min;
+   }
+ }
+ throw new IllegalStateException("Minimum object found, but not there when 
removing");
}
  
@Override



[1/4] accumulo git commit: ACCUMULO-2232 fix since version

2015-10-02 Thread kturner
Repository: accumulo
Updated Branches:
  refs/heads/master 49b44e4eb -> 445f3fe1d


ACCUMULO-2232 fix since version


Project: http://git-wip-us.apache.org/repos/asf/accumulo/repo
Commit: http://git-wip-us.apache.org/repos/asf/accumulo/commit/f3203854
Tree: http://git-wip-us.apache.org/repos/asf/accumulo/tree/f3203854
Diff: http://git-wip-us.apache.org/repos/asf/accumulo/diff/f3203854

Branch: refs/heads/master
Commit: f3203854451c41b06210a9a9fc3ce492f9feb58c
Parents: a39b3f6
Author: Keith Turner 
Authored: Fri Oct 2 15:37:38 2015 -0400
Committer: Keith Turner 
Committed: Fri Oct 2 15:37:38 2015 -0400

--
 .../src/main/java/org/apache/accumulo/core/iterators/Combiner.java | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
--


http://git-wip-us.apache.org/repos/asf/accumulo/blob/f3203854/core/src/main/java/org/apache/accumulo/core/iterators/Combiner.java
--
diff --git 
a/core/src/main/java/org/apache/accumulo/core/iterators/Combiner.java 
b/core/src/main/java/org/apache/accumulo/core/iterators/Combiner.java
index 091803b..5dd4f82 100644
--- a/core/src/main/java/org/apache/accumulo/core/iterators/Combiner.java
+++ b/core/src/main/java/org/apache/accumulo/core/iterators/Combiner.java
@@ -393,7 +393,7 @@ public abstract class Combiner extends WrappingIterator 
implements OptionDescrib
* This method was added in 1.6.4 and 1.7.1. If you want your code to work 
in earlier versions of 1.6 and 1.7 then do not call this method. If not set this
* property defaults to false in order to maintain compatibility.
*
-   * @since 1.6.4 1.7.1 1.8.0
+   * @since 1.6.5 1.7.1 1.8.0
*/
 
   public static void setReduceOnFullCompactionOnly(IteratorSetting is, boolean 
reduceOnFullCompactionOnly) {



[3/4] accumulo git commit: Merge branch '1.7'

2015-10-02 Thread kturner
Merge branch '1.7'


Project: http://git-wip-us.apache.org/repos/asf/accumulo/repo
Commit: http://git-wip-us.apache.org/repos/asf/accumulo/commit/3444ef7c
Tree: http://git-wip-us.apache.org/repos/asf/accumulo/tree/3444ef7c
Diff: http://git-wip-us.apache.org/repos/asf/accumulo/diff/3444ef7c

Branch: refs/heads/master
Commit: 3444ef7c5f9ef48e3f24eb38300868ab79c7b45e
Parents: 49b44e4 713282a
Author: Keith Turner 
Authored: Fri Oct 2 15:48:40 2015 -0400
Committer: Keith Turner 
Committed: Fri Oct 2 15:48:40 2015 -0400

--
 .../src/main/java/org/apache/accumulo/core/iterators/Combiner.java | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
--




[2/4] accumulo git commit: Merge branch '1.6' into 1.7

2015-10-02 Thread kturner
Merge branch '1.6' into 1.7


Project: http://git-wip-us.apache.org/repos/asf/accumulo/repo
Commit: http://git-wip-us.apache.org/repos/asf/accumulo/commit/713282a0
Tree: http://git-wip-us.apache.org/repos/asf/accumulo/tree/713282a0
Diff: http://git-wip-us.apache.org/repos/asf/accumulo/diff/713282a0

Branch: refs/heads/master
Commit: 713282a0e38f2146466ed631b9ad9fa26aaf2a39
Parents: 4623103 f320385
Author: Keith Turner 
Authored: Fri Oct 2 15:43:38 2015 -0400
Committer: Keith Turner 
Committed: Fri Oct 2 15:43:38 2015 -0400

--
 .../src/main/java/org/apache/accumulo/core/iterators/Combiner.java | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
--


http://git-wip-us.apache.org/repos/asf/accumulo/blob/713282a0/core/src/main/java/org/apache/accumulo/core/iterators/Combiner.java
--



[2/2] accumulo git commit: Merge branch '1.6' into 1.7

2015-10-02 Thread kturner
Merge branch '1.6' into 1.7


Project: http://git-wip-us.apache.org/repos/asf/accumulo/repo
Commit: http://git-wip-us.apache.org/repos/asf/accumulo/commit/713282a0
Tree: http://git-wip-us.apache.org/repos/asf/accumulo/tree/713282a0
Diff: http://git-wip-us.apache.org/repos/asf/accumulo/diff/713282a0

Branch: refs/heads/1.7
Commit: 713282a0e38f2146466ed631b9ad9fa26aaf2a39
Parents: 4623103 f320385
Author: Keith Turner 
Authored: Fri Oct 2 15:43:38 2015 -0400
Committer: Keith Turner 
Committed: Fri Oct 2 15:43:38 2015 -0400

--
 .../src/main/java/org/apache/accumulo/core/iterators/Combiner.java | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
--


http://git-wip-us.apache.org/repos/asf/accumulo/blob/713282a0/core/src/main/java/org/apache/accumulo/core/iterators/Combiner.java
--



accumulo git commit: ACCUMULO-2232 fix since version

2015-10-02 Thread kturner
Repository: accumulo
Updated Branches:
  refs/heads/1.6 a39b3f6be -> f32038544


ACCUMULO-2232 fix since version


Project: http://git-wip-us.apache.org/repos/asf/accumulo/repo
Commit: http://git-wip-us.apache.org/repos/asf/accumulo/commit/f3203854
Tree: http://git-wip-us.apache.org/repos/asf/accumulo/tree/f3203854
Diff: http://git-wip-us.apache.org/repos/asf/accumulo/diff/f3203854

Branch: refs/heads/1.6
Commit: f3203854451c41b06210a9a9fc3ce492f9feb58c
Parents: a39b3f6
Author: Keith Turner 
Authored: Fri Oct 2 15:37:38 2015 -0400
Committer: Keith Turner 
Committed: Fri Oct 2 15:37:38 2015 -0400

--
 .../src/main/java/org/apache/accumulo/core/iterators/Combiner.java | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
--


http://git-wip-us.apache.org/repos/asf/accumulo/blob/f3203854/core/src/main/java/org/apache/accumulo/core/iterators/Combiner.java
--
diff --git 
a/core/src/main/java/org/apache/accumulo/core/iterators/Combiner.java 
b/core/src/main/java/org/apache/accumulo/core/iterators/Combiner.java
index 091803b..5dd4f82 100644
--- a/core/src/main/java/org/apache/accumulo/core/iterators/Combiner.java
+++ b/core/src/main/java/org/apache/accumulo/core/iterators/Combiner.java
@@ -393,7 +393,7 @@ public abstract class Combiner extends WrappingIterator 
implements OptionDescrib
* This method was added in 1.6.4 and 1.7.1. If you want your code to work 
in earlier versions of 1.6 and 1.7 then do not call this method. If not set this
* property defaults to false in order to maintain compatibility.
*
-   * @since 1.6.4 1.7.1 1.8.0
+   * @since 1.6.5 1.7.1 1.8.0
*/
 
   public static void setReduceOnFullCompactionOnly(IteratorSetting is, boolean 
reduceOnFullCompactionOnly) {



[1/2] accumulo git commit: ACCUMULO-2232 fix since version

2015-10-02 Thread kturner
Repository: accumulo
Updated Branches:
  refs/heads/1.7 4623103e2 -> 713282a0e


ACCUMULO-2232 fix since version


Project: http://git-wip-us.apache.org/repos/asf/accumulo/repo
Commit: http://git-wip-us.apache.org/repos/asf/accumulo/commit/f3203854
Tree: http://git-wip-us.apache.org/repos/asf/accumulo/tree/f3203854
Diff: http://git-wip-us.apache.org/repos/asf/accumulo/diff/f3203854

Branch: refs/heads/1.7
Commit: f3203854451c41b06210a9a9fc3ce492f9feb58c
Parents: a39b3f6
Author: Keith Turner 
Authored: Fri Oct 2 15:37:38 2015 -0400
Committer: Keith Turner 
Committed: Fri Oct 2 15:37:38 2015 -0400

--
 .../src/main/java/org/apache/accumulo/core/iterators/Combiner.java | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
--


http://git-wip-us.apache.org/repos/asf/accumulo/blob/f3203854/core/src/main/java/org/apache/accumulo/core/iterators/Combiner.java
--
diff --git 
a/core/src/main/java/org/apache/accumulo/core/iterators/Combiner.java 
b/core/src/main/java/org/apache/accumulo/core/iterators/Combiner.java
index 091803b..5dd4f82 100644
--- a/core/src/main/java/org/apache/accumulo/core/iterators/Combiner.java
+++ b/core/src/main/java/org/apache/accumulo/core/iterators/Combiner.java
@@ -393,7 +393,7 @@ public abstract class Combiner extends WrappingIterator 
implements OptionDescrib
* This method was added in 1.6.4 and 1.7.1. If you want your code to work 
in earlier versions of 1.6 and 1.7 then do not call this method. If not set this
* property defaults to false in order to maintain compatibility.
*
-   * @since 1.6.4 1.7.1 1.8.0
+   * @since 1.6.5 1.7.1 1.8.0
*/
 
   public static void setReduceOnFullCompactionOnly(IteratorSetting is, boolean 
reduceOnFullCompactionOnly) {



[4/4] accumulo git commit: ACCUMULO-2232 Fix test

2015-10-02 Thread kturner
ACCUMULO-2232 Fix test


Project: http://git-wip-us.apache.org/repos/asf/accumulo/repo
Commit: http://git-wip-us.apache.org/repos/asf/accumulo/commit/445f3fe1
Tree: http://git-wip-us.apache.org/repos/asf/accumulo/tree/445f3fe1
Diff: http://git-wip-us.apache.org/repos/asf/accumulo/diff/445f3fe1

Branch: refs/heads/master
Commit: 445f3fe1dc0fb61ec3ac67ed9793f755293eb4f4
Parents: 3444ef7
Author: Keith Turner 
Authored: Fri Oct 2 16:11:33 2015 -0400
Committer: Keith Turner 
Committed: Fri Oct 2 16:11:33 2015 -0400

--
 .../accumulo/server/replication/StatusCombinerTest.java  | 11 ++-
 1 file changed, 10 insertions(+), 1 deletion(-)
--


http://git-wip-us.apache.org/repos/asf/accumulo/blob/445f3fe1/server/base/src/test/java/org/apache/accumulo/server/replication/StatusCombinerTest.java
--
diff --git 
a/server/base/src/test/java/org/apache/accumulo/server/replication/StatusCombinerTest.java
 
b/server/base/src/test/java/org/apache/accumulo/server/replication/StatusCombinerTest.java
index 26ad8de..7f70a57 100644
--- 
a/server/base/src/test/java/org/apache/accumulo/server/replication/StatusCombinerTest.java
+++ 
b/server/base/src/test/java/org/apache/accumulo/server/replication/StatusCombinerTest.java
@@ -24,9 +24,11 @@ import java.util.List;
 
 import org.apache.accumulo.core.client.IteratorSetting;
 import org.apache.accumulo.core.client.IteratorSetting.Column;
+import org.apache.accumulo.core.client.impl.BaseIteratorEnvironment;
 import org.apache.accumulo.core.data.Key;
 import org.apache.accumulo.core.iterators.Combiner;
 import org.apache.accumulo.core.iterators.DevNull;
+import org.apache.accumulo.core.iterators.IteratorUtil.IteratorScope;
 import org.apache.accumulo.core.replication.ReplicationSchema.StatusSection;
 import org.apache.accumulo.server.replication.proto.Replication.Status;
 import org.junit.Assert;
@@ -39,6 +41,13 @@ public class StatusCombinerTest {
   private Key key;
   private Status.Builder builder;
 
+  private static class TestIE extends BaseIteratorEnvironment {
+@Override
+public IteratorScope getIteratorScope() {
+  return IteratorScope.scan;
+}
+  }
+
   @Before
   public void initCombiner() throws IOException {
 key = new Key();
@@ -46,7 +55,7 @@ public class StatusCombinerTest {
 builder = Status.newBuilder();
 IteratorSetting cfg = new IteratorSetting(50, StatusCombiner.class);
 Combiner.setColumns(cfg, Collections.singletonList(new 
Column(StatusSection.NAME)));
-combiner.init(new DevNull(), cfg.getOptions(), null);
+combiner.init(new DevNull(), cfg.getOptions(), new TestIE());
   }
 
   @Test