accumulo-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From els...@apache.org
Subject [8/9] accumulo git commit: ACCUMULO-3789: Code compiled against 1.6 lexicoders can't run in 1.7
Date Sun, 10 May 2015 21:06:26 GMT
ACCUMULO-3789: Code compiled against 1.6 lexicoders can't run in 1.7

Added concrete implementation of decode to all client Lexicoders. Implementation just delegates
to decode method in AbstractEncoder.

Signed-off-by: Josh Elser <elserj@apache.org>


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

Branch: refs/heads/1.7
Commit: f91385488b93e87513cc63ed78e6b74a512f0a3e
Parents: 719aac4
Author: Russ Weeks <rweeks@newbrightidea.com>
Authored: Sat May 9 22:55:34 2015 -0700
Committer: Josh Elser <elserj@apache.org>
Committed: Sun May 10 13:34:28 2015 -0400

----------------------------------------------------------------------
 .../client/lexicoder/BigIntegerLexicoder.java   | 10 +++++++
 .../core/client/lexicoder/DateLexicoder.java    | 10 +++++++
 .../core/client/lexicoder/DoubleLexicoder.java  | 10 +++++++
 .../core/client/lexicoder/IntegerLexicoder.java | 10 +++++++
 .../core/client/lexicoder/ListLexicoder.java    | 10 +++++++
 .../core/client/lexicoder/PairLexicoder.java    | 10 +++++++
 .../core/client/lexicoder/StringLexicoder.java  | 10 +++++++
 .../core/client/lexicoder/TextLexicoder.java    | 10 +++++++
 .../client/lexicoder/UIntegerLexicoder.java     | 10 +++++++
 .../core/client/lexicoder/ULongLexicoder.java   | 10 +++++++
 .../core/client/lexicoder/UUIDLexicoder.java    | 10 +++++++
 .../accumulo/core/iterators/LongCombiner.java   | 30 ++++++++++++++++++++
 .../core/iterators/user/BigDecimalCombiner.java | 10 +++++++
 .../iterators/user/SummingArrayCombiner.java    | 20 +++++++++++++
 14 files changed, 170 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/accumulo/blob/f9138548/core/src/main/java/org/apache/accumulo/core/client/lexicoder/BigIntegerLexicoder.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/accumulo/core/client/lexicoder/BigIntegerLexicoder.java
b/core/src/main/java/org/apache/accumulo/core/client/lexicoder/BigIntegerLexicoder.java
index 577e33e..59db11c 100644
--- a/core/src/main/java/org/apache/accumulo/core/client/lexicoder/BigIntegerLexicoder.java
+++ b/core/src/main/java/org/apache/accumulo/core/client/lexicoder/BigIntegerLexicoder.java
@@ -63,6 +63,16 @@ public class BigIntegerLexicoder extends AbstractLexicoder<BigInteger>
implement
 
   }
 
+  /**
+   * @deprecated Since 1.7.0
+   */
+  @Override
+  @Deprecated
+  public BigInteger decode(byte[] b) {
+    // This concrete implementation is provided for backwards compatibility with 1.6; it
can be removed in 2.0. See ACCUMULO-3789.
+    return super.decode(b);
+  }
+
   @Override
   protected BigInteger decodeUnchecked(byte[] b, int offset, int origLen) throws ValueFormatException
{
 

http://git-wip-us.apache.org/repos/asf/accumulo/blob/f9138548/core/src/main/java/org/apache/accumulo/core/client/lexicoder/DateLexicoder.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/accumulo/core/client/lexicoder/DateLexicoder.java
b/core/src/main/java/org/apache/accumulo/core/client/lexicoder/DateLexicoder.java
index 2d17d37..2d928b4 100644
--- a/core/src/main/java/org/apache/accumulo/core/client/lexicoder/DateLexicoder.java
+++ b/core/src/main/java/org/apache/accumulo/core/client/lexicoder/DateLexicoder.java
@@ -34,6 +34,16 @@ public class DateLexicoder extends AbstractLexicoder<Date> implements
Lexicoder<
     return longEncoder.encode(data.getTime());
   }
 
+  /**
+   * @deprecated Since 1.7.0
+   */
+  @Override
+  @Deprecated
+  public Date decode(byte[] b) {
+    // This concrete implementation is provided for backwards compatibility with 1.6; it
can be removed in 2.0. See ACCUMULO-3789.
+    return super.decode(b);
+  }
+
   @Override
   protected Date decodeUnchecked(byte[] data, int offset, int len) {
     return new Date(longEncoder.decodeUnchecked(data, offset, len));

http://git-wip-us.apache.org/repos/asf/accumulo/blob/f9138548/core/src/main/java/org/apache/accumulo/core/client/lexicoder/DoubleLexicoder.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/accumulo/core/client/lexicoder/DoubleLexicoder.java
b/core/src/main/java/org/apache/accumulo/core/client/lexicoder/DoubleLexicoder.java
index 14413c0..c473f5f 100644
--- a/core/src/main/java/org/apache/accumulo/core/client/lexicoder/DoubleLexicoder.java
+++ b/core/src/main/java/org/apache/accumulo/core/client/lexicoder/DoubleLexicoder.java
@@ -38,6 +38,16 @@ public class DoubleLexicoder extends AbstractLexicoder<Double> implements
Lexico
     return longEncoder.encode(l);
   }
 
+  /**
+   * @deprecated Since 1.7.0
+   */
+  @Override
+  @Deprecated
+  public Double decode(byte[] b) {
+    // This concrete implementation is provided for backwards compatibility with 1.6; it
can be removed in 2.0. See ACCUMULO-3789.
+    return super.decode(b);
+  }
+
   @Override
   protected Double decodeUnchecked(byte[] data, int offset, int len) {
     long l = longEncoder.decodeUnchecked(data, offset, len);

http://git-wip-us.apache.org/repos/asf/accumulo/blob/f9138548/core/src/main/java/org/apache/accumulo/core/client/lexicoder/IntegerLexicoder.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/accumulo/core/client/lexicoder/IntegerLexicoder.java
b/core/src/main/java/org/apache/accumulo/core/client/lexicoder/IntegerLexicoder.java
index f96b41d..f3c481d 100644
--- a/core/src/main/java/org/apache/accumulo/core/client/lexicoder/IntegerLexicoder.java
+++ b/core/src/main/java/org/apache/accumulo/core/client/lexicoder/IntegerLexicoder.java
@@ -33,6 +33,16 @@ public class IntegerLexicoder extends AbstractLexicoder<Integer>
implements Lexi
     return uil.encode(i ^ 0x80000000);
   }
 
+  /**
+   * @deprecated Since 1.7.0
+   */
+  @Override
+  @Deprecated
+  public Integer decode(byte[] b) {
+    // This concrete implementation is provided for backwards compatibility with 1.6; it
can be removed in 2.0. See ACCUMULO-3789.
+    return super.decode(b);
+  }
+
   @Override
   protected Integer decodeUnchecked(byte[] data, int offset, int len) {
     return uil.decodeUnchecked(data, offset, len) ^ 0x80000000;

http://git-wip-us.apache.org/repos/asf/accumulo/blob/f9138548/core/src/main/java/org/apache/accumulo/core/client/lexicoder/ListLexicoder.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/accumulo/core/client/lexicoder/ListLexicoder.java
b/core/src/main/java/org/apache/accumulo/core/client/lexicoder/ListLexicoder.java
index 3c20401..99ffe3b 100644
--- a/core/src/main/java/org/apache/accumulo/core/client/lexicoder/ListLexicoder.java
+++ b/core/src/main/java/org/apache/accumulo/core/client/lexicoder/ListLexicoder.java
@@ -56,6 +56,16 @@ public class ListLexicoder<LT> extends AbstractLexicoder<List<LT>>
implements Le
     return concat(encElements);
   }
 
+  /**
+   * @deprecated Since 1.7.0
+   */
+  @Override
+  @Deprecated
+  public List<LT> decode(byte[] b) {
+    // This concrete implementation is provided for backwards compatibility with 1.6; it
can be removed in 2.0. See ACCUMULO-3789.
+    return super.decode(b);
+  }
+
   @Override
   protected List<LT> decodeUnchecked(byte[] b, int offset, int len) {
 

http://git-wip-us.apache.org/repos/asf/accumulo/blob/f9138548/core/src/main/java/org/apache/accumulo/core/client/lexicoder/PairLexicoder.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/accumulo/core/client/lexicoder/PairLexicoder.java
b/core/src/main/java/org/apache/accumulo/core/client/lexicoder/PairLexicoder.java
index f28912c..679e823 100644
--- a/core/src/main/java/org/apache/accumulo/core/client/lexicoder/PairLexicoder.java
+++ b/core/src/main/java/org/apache/accumulo/core/client/lexicoder/PairLexicoder.java
@@ -65,6 +65,16 @@ public class PairLexicoder<A extends Comparable<A>,B extends Comparable<B>>
exte
     return concat(escape(firstLexicoder.encode(data.getFirst())), escape(secondLexicoder.encode(data.getSecond())));
   }
 
+  /**
+   * @deprecated Since 1.7.0
+   */
+  @Override
+  @Deprecated
+  public ComparablePair<A,B> decode(byte[] b) {
+    // This concrete implementation is provided for backwards compatibility with 1.6; it
can be removed in 2.0. See ACCUMULO-3789.
+    return super.decode(b);
+  }
+
   @Override
   protected ComparablePair<A,B> decodeUnchecked(byte[] data, int offset, int len) {
 

http://git-wip-us.apache.org/repos/asf/accumulo/blob/f9138548/core/src/main/java/org/apache/accumulo/core/client/lexicoder/StringLexicoder.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/accumulo/core/client/lexicoder/StringLexicoder.java
b/core/src/main/java/org/apache/accumulo/core/client/lexicoder/StringLexicoder.java
index f7b1877..94558ce 100644
--- a/core/src/main/java/org/apache/accumulo/core/client/lexicoder/StringLexicoder.java
+++ b/core/src/main/java/org/apache/accumulo/core/client/lexicoder/StringLexicoder.java
@@ -34,6 +34,16 @@ public class StringLexicoder extends AbstractLexicoder<String> implements
Lexico
     return data.getBytes(UTF_8);
   }
 
+  /**
+   * @deprecated Since 1.7.0
+   */
+  @Override
+  @Deprecated
+  public String decode(byte[] b) {
+    // This concrete implementation is provided for backwards compatibility with 1.6; it
can be removed in 2.0. See ACCUMULO-3789.
+    return super.decode(b);
+  }
+
   @Override
   protected String decodeUnchecked(byte[] data, int offset, int len) {
     return new String(data, offset, len, UTF_8);

http://git-wip-us.apache.org/repos/asf/accumulo/blob/f9138548/core/src/main/java/org/apache/accumulo/core/client/lexicoder/TextLexicoder.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/accumulo/core/client/lexicoder/TextLexicoder.java
b/core/src/main/java/org/apache/accumulo/core/client/lexicoder/TextLexicoder.java
index bb29857..55702b6 100644
--- a/core/src/main/java/org/apache/accumulo/core/client/lexicoder/TextLexicoder.java
+++ b/core/src/main/java/org/apache/accumulo/core/client/lexicoder/TextLexicoder.java
@@ -34,6 +34,16 @@ public class TextLexicoder extends AbstractLexicoder<Text> implements
Lexicoder<
     return TextUtil.getBytes(data);
   }
 
+  /**
+   * @deprecated Since 1.7.0
+   */
+  @Override
+  @Deprecated
+  public Text decode(byte[] b) {
+    // This concrete implementation is provided for backwards compatibility with 1.6; it
can be removed in 2.0. See ACCUMULO-3789.
+    return super.decode(b);
+  }
+
   @Override
   protected Text decodeUnchecked(byte[] data, int offset, int len) {
     Text text = new Text();

http://git-wip-us.apache.org/repos/asf/accumulo/blob/f9138548/core/src/main/java/org/apache/accumulo/core/client/lexicoder/UIntegerLexicoder.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/accumulo/core/client/lexicoder/UIntegerLexicoder.java
b/core/src/main/java/org/apache/accumulo/core/client/lexicoder/UIntegerLexicoder.java
index e99c3b1..8194244 100644
--- a/core/src/main/java/org/apache/accumulo/core/client/lexicoder/UIntegerLexicoder.java
+++ b/core/src/main/java/org/apache/accumulo/core/client/lexicoder/UIntegerLexicoder.java
@@ -53,6 +53,16 @@ public class UIntegerLexicoder extends AbstractLexicoder<Integer>
implements Lex
 
   }
 
+  /**
+   * @deprecated Since 1.7.0
+   */
+  @Override
+  @Deprecated
+  public Integer decode(byte[] b) {
+    // This concrete implementation is provided for backwards compatibility with 1.6; it
can be removed in 2.0. See ACCUMULO-3789.
+    return super.decode(b);
+  }
+
   @Override
   protected Integer decodeUnchecked(byte[] data, int offset, int len) {
 

http://git-wip-us.apache.org/repos/asf/accumulo/blob/f9138548/core/src/main/java/org/apache/accumulo/core/client/lexicoder/ULongLexicoder.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/accumulo/core/client/lexicoder/ULongLexicoder.java
b/core/src/main/java/org/apache/accumulo/core/client/lexicoder/ULongLexicoder.java
index a69ed34..72d4a52 100644
--- a/core/src/main/java/org/apache/accumulo/core/client/lexicoder/ULongLexicoder.java
+++ b/core/src/main/java/org/apache/accumulo/core/client/lexicoder/ULongLexicoder.java
@@ -73,4 +73,14 @@ public class ULongLexicoder extends AbstractLexicoder<Long> implements
Lexicoder
 
     return l;
   }
+
+  /**
+   * @deprecated Since 1.7.0
+   */
+  @Override
+  @Deprecated
+  public Long decode(byte[] b) {
+    // This concrete implementation is provided for backwards compatibility with 1.6; it
can be removed in 2.0. See ACCUMULO-3789.
+    return super.decode(b);
+  }
 }

http://git-wip-us.apache.org/repos/asf/accumulo/blob/f9138548/core/src/main/java/org/apache/accumulo/core/client/lexicoder/UUIDLexicoder.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/accumulo/core/client/lexicoder/UUIDLexicoder.java
b/core/src/main/java/org/apache/accumulo/core/client/lexicoder/UUIDLexicoder.java
index e8e2c06..423c371 100644
--- a/core/src/main/java/org/apache/accumulo/core/client/lexicoder/UUIDLexicoder.java
+++ b/core/src/main/java/org/apache/accumulo/core/client/lexicoder/UUIDLexicoder.java
@@ -56,6 +56,16 @@ public class UUIDLexicoder extends AbstractLexicoder<UUID> implements
Lexicoder<
     }
   }
 
+  /**
+   * @deprecated Since 1.7.0
+   */
+  @Override
+  @Deprecated
+  public UUID decode(byte[] b) {
+    // This concrete implementation is provided for backwards compatibility with 1.6; it
can be removed in 2.0. See ACCUMULO-3789.
+    return super.decode(b);
+  }
+
   @Override
   protected UUID decodeUnchecked(byte[] b, int offset, int len) throws ValueFormatException
{
     try {

http://git-wip-us.apache.org/repos/asf/accumulo/blob/f9138548/core/src/main/java/org/apache/accumulo/core/iterators/LongCombiner.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/accumulo/core/iterators/LongCombiner.java b/core/src/main/java/org/apache/accumulo/core/iterators/LongCombiner.java
index cbc76ab..7bd8079 100644
--- a/core/src/main/java/org/apache/accumulo/core/iterators/LongCombiner.java
+++ b/core/src/main/java/org/apache/accumulo/core/iterators/LongCombiner.java
@@ -133,6 +133,16 @@ public abstract class LongCombiner extends TypedValueCombiner<Long>
{
       return baos.toByteArray();
     }
 
+    /**
+     * @deprecated Since 1.7.0
+     */
+    @Override
+    @Deprecated
+    public Long decode(byte[] b) {
+      // This concrete implementation is provided for backwards compatibility with 1.6; it
can be removed in 2.0. See ACCUMULO-3789.
+      return super.decode(b);
+    }
+
     @Override
     protected Long decodeUnchecked(byte[] b, int offset, int len) {
       DataInputStream dis = new DataInputStream(new ByteArrayInputStream(b, offset, len));
@@ -162,6 +172,16 @@ public abstract class LongCombiner extends TypedValueCombiner<Long>
{
       return b;
     }
 
+    /**
+     * @deprecated Since 1.7.0
+     */
+    @Override
+    @Deprecated
+    public Long decode(byte[] b) {
+      // This concrete implementation is provided for backwards compatibility with 1.6; it
can be removed in 2.0. See ACCUMULO-3789.
+      return super.decode(b);
+    }
+
     @Override
     protected Long decodeUnchecked(byte[] b, int offset, int len) {
       return decodeStatic(b, offset, len);
@@ -192,6 +212,16 @@ public abstract class LongCombiner extends TypedValueCombiner<Long>
{
       return Long.toString(v).getBytes(UTF_8);
     }
 
+    /**
+     * @deprecated Since 1.7.0
+     */
+    @Override
+    @Deprecated
+    public Long decode(byte[] b) {
+      // This concrete implementation is provided for backwards compatibility with 1.6; it
can be removed in 2.0. See ACCUMULO-3789.
+      return super.decode(b);
+    }
+
     @Override
     protected Long decodeUnchecked(byte[] b, int offset, int len) {
       try {

http://git-wip-us.apache.org/repos/asf/accumulo/blob/f9138548/core/src/main/java/org/apache/accumulo/core/iterators/user/BigDecimalCombiner.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/accumulo/core/iterators/user/BigDecimalCombiner.java
b/core/src/main/java/org/apache/accumulo/core/iterators/user/BigDecimalCombiner.java
index e90e87e..f2c03f3 100644
--- a/core/src/main/java/org/apache/accumulo/core/iterators/user/BigDecimalCombiner.java
+++ b/core/src/main/java/org/apache/accumulo/core/iterators/user/BigDecimalCombiner.java
@@ -108,6 +108,16 @@ public abstract class BigDecimalCombiner extends TypedValueCombiner<BigDecimal>
       return v.toString().getBytes(UTF_8);
     }
 
+    /**
+     * @deprecated Since 1.7.0
+     */
+    @Override
+    @Deprecated
+    public BigDecimal decode(byte[] b) {
+      // This concrete implementation is provided for backwards compatibility with 1.6; it
can be removed in 2.0. See ACCUMULO-3789.
+      return super.decode(b);
+    }
+
     @Override
     protected BigDecimal decodeUnchecked(byte[] b, int offset, int len) throws ValueFormatException
{
       try {

http://git-wip-us.apache.org/repos/asf/accumulo/blob/f9138548/core/src/main/java/org/apache/accumulo/core/iterators/user/SummingArrayCombiner.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/accumulo/core/iterators/user/SummingArrayCombiner.java
b/core/src/main/java/org/apache/accumulo/core/iterators/user/SummingArrayCombiner.java
index 04c0af1..32b7a7a 100644
--- a/core/src/main/java/org/apache/accumulo/core/iterators/user/SummingArrayCombiner.java
+++ b/core/src/main/java/org/apache/accumulo/core/iterators/user/SummingArrayCombiner.java
@@ -162,6 +162,16 @@ public class SummingArrayCombiner extends TypedValueCombiner<List<Long>>
{
       return baos.toByteArray();
     }
 
+    /**
+     * @deprecated Since 1.7.0
+     */
+    @Override
+    @Deprecated
+    public List<V> decode(byte[] b) {
+      // This concrete implementation is provided for backwards compatibility with 1.6; it
can be removed in 2.0. See ACCUMULO-3789.
+      return super.decode(b);
+    }
+
     @Override
     protected List<V> decodeUnchecked(byte[] b, int offset, int origLen) {
       DataInputStream dis = new DataInputStream(new ByteArrayInputStream(b, offset, origLen));
@@ -215,6 +225,16 @@ public class SummingArrayCombiner extends TypedValueCombiner<List<Long>>
{
       return sb.toString().getBytes(UTF_8);
     }
 
+    /**
+     * @deprecated Since 1.7.0
+     */
+    @Override
+    @Deprecated
+    public List<Long> decode(byte[] b) {
+      // This concrete implementation is provided for backwards compatibility with 1.6; it
can be removed in 2.0. See ACCUMULO-3789.
+      return super.decode(b);
+    }
+
     @Override
     protected List<Long> decodeUnchecked(byte[] b, int offset, int len) {
       String[] longstrs = new String(b, offset, len, UTF_8).split(",");


Mime
View raw message