hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From apurt...@apache.org
Subject [01/13] hbase git commit: HBASE-12279 Generated thrift files were generated with the wrong parameters (Niels Basjes)
Date Sat, 08 Nov 2014 02:35:09 GMT
Repository: hbase
Updated Branches:
  refs/heads/0.98 d2eb3cf3f -> 2a12bac89
  refs/heads/branch-1 87fb97476 -> 0145650cb
  refs/heads/master fb1af86ee -> 3b8c0769c


http://git-wip-us.apache.org/repos/asf/hbase/blob/5ffa4579/hbase-thrift/src/main/java/org/apache/hadoop/hbase/thrift2/generated/TResult.java
----------------------------------------------------------------------
diff --git a/hbase-thrift/src/main/java/org/apache/hadoop/hbase/thrift2/generated/TResult.java
b/hbase-thrift/src/main/java/org/apache/hadoop/hbase/thrift2/generated/TResult.java
index b605159..182f947 100644
--- a/hbase-thrift/src/main/java/org/apache/hadoop/hbase/thrift2/generated/TResult.java
+++ b/hbase-thrift/src/main/java/org/apache/hadoop/hbase/thrift2/generated/TResult.java
@@ -6,6 +6,7 @@
  */
 package org.apache.hadoop.hbase.thrift2.generated;
 
+import org.apache.commons.lang.builder.HashCodeBuilder;
 import org.apache.thrift.scheme.IScheme;
 import org.apache.thrift.scheme.SchemeFactory;
 import org.apache.thrift.scheme.StandardScheme;
@@ -317,7 +318,19 @@ public class TResult implements org.apache.thrift.TBase<TResult, TResult._Fields
 
   @Override
   public int hashCode() {
-    return 0;
+    HashCodeBuilder builder = new HashCodeBuilder();
+
+    boolean present_row = true && (isSetRow());
+    builder.append(present_row);
+    if (present_row)
+      builder.append(row);
+
+    boolean present_columnValues = true && (isSetColumnValues());
+    builder.append(present_columnValues);
+    if (present_columnValues)
+      builder.append(columnValues);
+
+    return builder.toHashCode();
   }
 
   public int compareTo(TResult other) {

http://git-wip-us.apache.org/repos/asf/hbase/blob/5ffa4579/hbase-thrift/src/main/java/org/apache/hadoop/hbase/thrift2/generated/TRowMutations.java
----------------------------------------------------------------------
diff --git a/hbase-thrift/src/main/java/org/apache/hadoop/hbase/thrift2/generated/TRowMutations.java
b/hbase-thrift/src/main/java/org/apache/hadoop/hbase/thrift2/generated/TRowMutations.java
index 5d6f2e9..94521c2 100644
--- a/hbase-thrift/src/main/java/org/apache/hadoop/hbase/thrift2/generated/TRowMutations.java
+++ b/hbase-thrift/src/main/java/org/apache/hadoop/hbase/thrift2/generated/TRowMutations.java
@@ -6,6 +6,7 @@
  */
 package org.apache.hadoop.hbase.thrift2.generated;
 
+import org.apache.commons.lang.builder.HashCodeBuilder;
 import org.apache.thrift.scheme.IScheme;
 import org.apache.thrift.scheme.SchemeFactory;
 import org.apache.thrift.scheme.StandardScheme;
@@ -318,7 +319,19 @@ public class TRowMutations implements org.apache.thrift.TBase<TRowMutations,
TRo
 
   @Override
   public int hashCode() {
-    return 0;
+    HashCodeBuilder builder = new HashCodeBuilder();
+
+    boolean present_row = true && (isSetRow());
+    builder.append(present_row);
+    if (present_row)
+      builder.append(row);
+
+    boolean present_mutations = true && (isSetMutations());
+    builder.append(present_mutations);
+    if (present_mutations)
+      builder.append(mutations);
+
+    return builder.toHashCode();
   }
 
   public int compareTo(TRowMutations other) {
@@ -444,14 +457,14 @@ public class TRowMutations implements org.apache.thrift.TBase<TRowMutations,
TRo
           case 2: // MUTATIONS
             if (schemeField.type == org.apache.thrift.protocol.TType.LIST) {
               {
-                org.apache.thrift.protocol.TList _list98 = iprot.readListBegin();
-                struct.mutations = new ArrayList<TMutation>(_list98.size);
-                for (int _i99 = 0; _i99 < _list98.size; ++_i99)
+                org.apache.thrift.protocol.TList _list124 = iprot.readListBegin();
+                struct.mutations = new ArrayList<TMutation>(_list124.size);
+                for (int _i125 = 0; _i125 < _list124.size; ++_i125)
                 {
-                  TMutation _elem100; // optional
-                  _elem100 = new TMutation();
-                  _elem100.read(iprot);
-                  struct.mutations.add(_elem100);
+                  TMutation _elem126; // required
+                  _elem126 = new TMutation();
+                  _elem126.read(iprot);
+                  struct.mutations.add(_elem126);
                 }
                 iprot.readListEnd();
               }
@@ -484,9 +497,9 @@ public class TRowMutations implements org.apache.thrift.TBase<TRowMutations,
TRo
         oprot.writeFieldBegin(MUTATIONS_FIELD_DESC);
         {
           oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT,
struct.mutations.size()));
-          for (TMutation _iter101 : struct.mutations)
+          for (TMutation _iter127 : struct.mutations)
           {
-            _iter101.write(oprot);
+            _iter127.write(oprot);
           }
           oprot.writeListEnd();
         }
@@ -512,9 +525,9 @@ public class TRowMutations implements org.apache.thrift.TBase<TRowMutations,
TRo
       oprot.writeBinary(struct.row);
       {
         oprot.writeI32(struct.mutations.size());
-        for (TMutation _iter102 : struct.mutations)
+        for (TMutation _iter128 : struct.mutations)
         {
-          _iter102.write(oprot);
+          _iter128.write(oprot);
         }
       }
     }
@@ -525,14 +538,14 @@ public class TRowMutations implements org.apache.thrift.TBase<TRowMutations,
TRo
       struct.row = iprot.readBinary();
       struct.setRowIsSet(true);
       {
-        org.apache.thrift.protocol.TList _list103 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT,
iprot.readI32());
-        struct.mutations = new ArrayList<TMutation>(_list103.size);
-        for (int _i104 = 0; _i104 < _list103.size; ++_i104)
+        org.apache.thrift.protocol.TList _list129 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT,
iprot.readI32());
+        struct.mutations = new ArrayList<TMutation>(_list129.size);
+        for (int _i130 = 0; _i130 < _list129.size; ++_i130)
         {
-          TMutation _elem105; // optional
-          _elem105 = new TMutation();
-          _elem105.read(iprot);
-          struct.mutations.add(_elem105);
+          TMutation _elem131; // required
+          _elem131 = new TMutation();
+          _elem131.read(iprot);
+          struct.mutations.add(_elem131);
         }
       }
       struct.setMutationsIsSet(true);

http://git-wip-us.apache.org/repos/asf/hbase/blob/5ffa4579/hbase-thrift/src/main/java/org/apache/hadoop/hbase/thrift2/generated/TScan.java
----------------------------------------------------------------------
diff --git a/hbase-thrift/src/main/java/org/apache/hadoop/hbase/thrift2/generated/TScan.java
b/hbase-thrift/src/main/java/org/apache/hadoop/hbase/thrift2/generated/TScan.java
index 21e8731..3fbf970 100644
--- a/hbase-thrift/src/main/java/org/apache/hadoop/hbase/thrift2/generated/TScan.java
+++ b/hbase-thrift/src/main/java/org/apache/hadoop/hbase/thrift2/generated/TScan.java
@@ -1,11 +1,12 @@
 /**
- * Autogenerated by Thrift Compiler (0.9.1)
+ * Autogenerated by Thrift Compiler (0.9.0)
  *
  * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
  *  @generated
  */
 package org.apache.hadoop.hbase.thrift2.generated;
 
+import org.apache.commons.lang.builder.HashCodeBuilder;
 import org.apache.thrift.scheme.IScheme;
 import org.apache.thrift.scheme.SchemeFactory;
 import org.apache.thrift.scheme.StandardScheme;
@@ -15,8 +16,6 @@ import org.apache.thrift.protocol.TTupleProtocol;
 import org.apache.thrift.protocol.TProtocolException;
 import org.apache.thrift.EncodingUtils;
 import org.apache.thrift.TException;
-import org.apache.thrift.async.AsyncMethodCallback;
-import org.apache.thrift.server.AbstractNonblockingServer.*;
 import java.util.List;
 import java.util.ArrayList;
 import java.util.Map;
@@ -36,7 +35,7 @@ import org.slf4j.LoggerFactory;
  * Any timestamps in the columns are ignored, use timeRange to select by timestamp.
  * Max versions defaults to 1.
  */
-public class TScan implements org.apache.thrift.TBase<TScan, TScan._Fields>, java.io.Serializable,
Cloneable, Comparable<TScan> {
+public class TScan implements org.apache.thrift.TBase<TScan, TScan._Fields>, java.io.Serializable,
Cloneable {
   private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TScan");
 
   private static final org.apache.thrift.protocol.TField START_ROW_FIELD_DESC = new org.apache.thrift.protocol.TField("startRow",
org.apache.thrift.protocol.TType.STRING, (short)1);
@@ -215,7 +214,7 @@ public class TScan implements org.apache.thrift.TBase<TScan, TScan._Fields>,
jav
 ;
     }
     if (other.isSetColumns()) {
-      List<TColumn> __this__columns = new ArrayList<TColumn>(other.columns.size());
+      List<TColumn> __this__columns = new ArrayList<TColumn>();
       for (TColumn other_element : other.columns) {
         __this__columns.add(new TColumn(other_element));
       }
@@ -232,7 +231,20 @@ public class TScan implements org.apache.thrift.TBase<TScan, TScan._Fields>,
jav
     }
     this.batchSize = other.batchSize;
     if (other.isSetAttributes()) {
-      Map<ByteBuffer,ByteBuffer> __this__attributes = new HashMap<ByteBuffer,ByteBuffer>(other.attributes);
+      Map<ByteBuffer,ByteBuffer> __this__attributes = new HashMap<ByteBuffer,ByteBuffer>();
+      for (Map.Entry<ByteBuffer, ByteBuffer> other_element : other.attributes.entrySet())
{
+
+        ByteBuffer other_element_key = other_element.getKey();
+        ByteBuffer other_element_value = other_element.getValue();
+
+        ByteBuffer __this__attributes_copy_key = org.apache.thrift.TBaseHelper.copyBinary(other_element_key);
+;
+
+        ByteBuffer __this__attributes_copy_value = org.apache.thrift.TBaseHelper.copyBinary(other_element_value);
+;
+
+        __this__attributes.put(__this__attributes_copy_key, __this__attributes_copy_value);
+      }
       this.attributes = __this__attributes;
     }
     if (other.isSetAuthorizations()) {
@@ -862,123 +874,180 @@ public class TScan implements org.apache.thrift.TBase<TScan, TScan._Fields>,
jav
 
   @Override
   public int hashCode() {
-    return 0;
+    HashCodeBuilder builder = new HashCodeBuilder();
+
+    boolean present_startRow = true && (isSetStartRow());
+    builder.append(present_startRow);
+    if (present_startRow)
+      builder.append(startRow);
+
+    boolean present_stopRow = true && (isSetStopRow());
+    builder.append(present_stopRow);
+    if (present_stopRow)
+      builder.append(stopRow);
+
+    boolean present_columns = true && (isSetColumns());
+    builder.append(present_columns);
+    if (present_columns)
+      builder.append(columns);
+
+    boolean present_caching = true && (isSetCaching());
+    builder.append(present_caching);
+    if (present_caching)
+      builder.append(caching);
+
+    boolean present_maxVersions = true && (isSetMaxVersions());
+    builder.append(present_maxVersions);
+    if (present_maxVersions)
+      builder.append(maxVersions);
+
+    boolean present_timeRange = true && (isSetTimeRange());
+    builder.append(present_timeRange);
+    if (present_timeRange)
+      builder.append(timeRange);
+
+    boolean present_filterString = true && (isSetFilterString());
+    builder.append(present_filterString);
+    if (present_filterString)
+      builder.append(filterString);
+
+    boolean present_batchSize = true && (isSetBatchSize());
+    builder.append(present_batchSize);
+    if (present_batchSize)
+      builder.append(batchSize);
+
+    boolean present_attributes = true && (isSetAttributes());
+    builder.append(present_attributes);
+    if (present_attributes)
+      builder.append(attributes);
+
+    boolean present_authorizations = true && (isSetAuthorizations());
+    builder.append(present_authorizations);
+    if (present_authorizations)
+      builder.append(authorizations);
+
+    boolean present_reversed = true && (isSetReversed());
+    builder.append(present_reversed);
+    if (present_reversed)
+      builder.append(reversed);
+
+    return builder.toHashCode();
   }
 
-  @Override
   public int compareTo(TScan other) {
     if (!getClass().equals(other.getClass())) {
       return getClass().getName().compareTo(other.getClass().getName());
     }
 
     int lastComparison = 0;
+    TScan typedOther = (TScan)other;
 
-    lastComparison = Boolean.valueOf(isSetStartRow()).compareTo(other.isSetStartRow());
+    lastComparison = Boolean.valueOf(isSetStartRow()).compareTo(typedOther.isSetStartRow());
     if (lastComparison != 0) {
       return lastComparison;
     }
     if (isSetStartRow()) {
-      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.startRow, other.startRow);
+      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.startRow, typedOther.startRow);
       if (lastComparison != 0) {
         return lastComparison;
       }
     }
-    lastComparison = Boolean.valueOf(isSetStopRow()).compareTo(other.isSetStopRow());
+    lastComparison = Boolean.valueOf(isSetStopRow()).compareTo(typedOther.isSetStopRow());
     if (lastComparison != 0) {
       return lastComparison;
     }
     if (isSetStopRow()) {
-      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.stopRow, other.stopRow);
+      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.stopRow, typedOther.stopRow);
       if (lastComparison != 0) {
         return lastComparison;
       }
     }
-    lastComparison = Boolean.valueOf(isSetColumns()).compareTo(other.isSetColumns());
+    lastComparison = Boolean.valueOf(isSetColumns()).compareTo(typedOther.isSetColumns());
     if (lastComparison != 0) {
       return lastComparison;
     }
     if (isSetColumns()) {
-      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.columns, other.columns);
+      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.columns, typedOther.columns);
       if (lastComparison != 0) {
         return lastComparison;
       }
     }
-    lastComparison = Boolean.valueOf(isSetCaching()).compareTo(other.isSetCaching());
+    lastComparison = Boolean.valueOf(isSetCaching()).compareTo(typedOther.isSetCaching());
     if (lastComparison != 0) {
       return lastComparison;
     }
     if (isSetCaching()) {
-      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.caching, other.caching);
+      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.caching, typedOther.caching);
       if (lastComparison != 0) {
         return lastComparison;
       }
     }
-    lastComparison = Boolean.valueOf(isSetMaxVersions()).compareTo(other.isSetMaxVersions());
+    lastComparison = Boolean.valueOf(isSetMaxVersions()).compareTo(typedOther.isSetMaxVersions());
     if (lastComparison != 0) {
       return lastComparison;
     }
     if (isSetMaxVersions()) {
-      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.maxVersions, other.maxVersions);
+      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.maxVersions, typedOther.maxVersions);
       if (lastComparison != 0) {
         return lastComparison;
       }
     }
-    lastComparison = Boolean.valueOf(isSetTimeRange()).compareTo(other.isSetTimeRange());
+    lastComparison = Boolean.valueOf(isSetTimeRange()).compareTo(typedOther.isSetTimeRange());
     if (lastComparison != 0) {
       return lastComparison;
     }
     if (isSetTimeRange()) {
-      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.timeRange, other.timeRange);
+      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.timeRange, typedOther.timeRange);
       if (lastComparison != 0) {
         return lastComparison;
       }
     }
-    lastComparison = Boolean.valueOf(isSetFilterString()).compareTo(other.isSetFilterString());
+    lastComparison = Boolean.valueOf(isSetFilterString()).compareTo(typedOther.isSetFilterString());
     if (lastComparison != 0) {
       return lastComparison;
     }
     if (isSetFilterString()) {
-      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.filterString, other.filterString);
+      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.filterString, typedOther.filterString);
       if (lastComparison != 0) {
         return lastComparison;
       }
     }
-    lastComparison = Boolean.valueOf(isSetBatchSize()).compareTo(other.isSetBatchSize());
+    lastComparison = Boolean.valueOf(isSetBatchSize()).compareTo(typedOther.isSetBatchSize());
     if (lastComparison != 0) {
       return lastComparison;
     }
     if (isSetBatchSize()) {
-      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.batchSize, other.batchSize);
+      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.batchSize, typedOther.batchSize);
       if (lastComparison != 0) {
         return lastComparison;
       }
     }
-    lastComparison = Boolean.valueOf(isSetAttributes()).compareTo(other.isSetAttributes());
+    lastComparison = Boolean.valueOf(isSetAttributes()).compareTo(typedOther.isSetAttributes());
     if (lastComparison != 0) {
       return lastComparison;
     }
     if (isSetAttributes()) {
-      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.attributes, other.attributes);
+      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.attributes, typedOther.attributes);
       if (lastComparison != 0) {
         return lastComparison;
       }
     }
-    lastComparison = Boolean.valueOf(isSetAuthorizations()).compareTo(other.isSetAuthorizations());
+    lastComparison = Boolean.valueOf(isSetAuthorizations()).compareTo(typedOther.isSetAuthorizations());
     if (lastComparison != 0) {
       return lastComparison;
     }
     if (isSetAuthorizations()) {
-      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.authorizations, other.authorizations);
+      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.authorizations, typedOther.authorizations);
       if (lastComparison != 0) {
         return lastComparison;
       }
     }
-    lastComparison = Boolean.valueOf(isSetReversed()).compareTo(other.isSetReversed());
+    lastComparison = Boolean.valueOf(isSetReversed()).compareTo(typedOther.isSetReversed());
     if (lastComparison != 0) {
       return lastComparison;
     }
     if (isSetReversed()) {
-      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.reversed, other.reversed);
+      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.reversed, typedOther.reversed);
       if (lastComparison != 0) {
         return lastComparison;
       }
@@ -1170,7 +1239,7 @@ public class TScan implements org.apache.thrift.TBase<TScan, TScan._Fields>,
jav
                 struct.columns = new ArrayList<TColumn>(_list106.size);
                 for (int _i107 = 0; _i107 < _list106.size; ++_i107)
                 {
-                  TColumn _elem108;
+                  TColumn _elem108; // required
                   _elem108 = new TColumn();
                   _elem108.read(iprot);
                   struct.columns.add(_elem108);
@@ -1230,8 +1299,8 @@ public class TScan implements org.apache.thrift.TBase<TScan, TScan._Fields>,
jav
                 struct.attributes = new HashMap<ByteBuffer,ByteBuffer>(2*_map109.size);
                 for (int _i110 = 0; _i110 < _map109.size; ++_i110)
                 {
-                  ByteBuffer _key111;
-                  ByteBuffer _val112;
+                  ByteBuffer _key111; // required
+                  ByteBuffer _val112; // required
                   _key111 = iprot.readBinary();
                   _val112 = iprot.readBinary();
                   struct.attributes.put(_key111, _val112);
@@ -1477,7 +1546,7 @@ public class TScan implements org.apache.thrift.TBase<TScan, TScan._Fields>,
jav
           struct.columns = new ArrayList<TColumn>(_list117.size);
           for (int _i118 = 0; _i118 < _list117.size; ++_i118)
           {
-            TColumn _elem119;
+            TColumn _elem119; // required
             _elem119 = new TColumn();
             _elem119.read(iprot);
             struct.columns.add(_elem119);
@@ -1512,8 +1581,8 @@ public class TScan implements org.apache.thrift.TBase<TScan, TScan._Fields>,
jav
           struct.attributes = new HashMap<ByteBuffer,ByteBuffer>(2*_map120.size);
           for (int _i121 = 0; _i121 < _map120.size; ++_i121)
           {
-            ByteBuffer _key122;
-            ByteBuffer _val123;
+            ByteBuffer _key122; // required
+            ByteBuffer _val123; // required
             _key122 = iprot.readBinary();
             _val123 = iprot.readBinary();
             struct.attributes.put(_key122, _val123);

http://git-wip-us.apache.org/repos/asf/hbase/blob/5ffa4579/hbase-thrift/src/main/java/org/apache/hadoop/hbase/thrift2/generated/TTimeRange.java
----------------------------------------------------------------------
diff --git a/hbase-thrift/src/main/java/org/apache/hadoop/hbase/thrift2/generated/TTimeRange.java
b/hbase-thrift/src/main/java/org/apache/hadoop/hbase/thrift2/generated/TTimeRange.java
index ffac493..cc7a15b 100644
--- a/hbase-thrift/src/main/java/org/apache/hadoop/hbase/thrift2/generated/TTimeRange.java
+++ b/hbase-thrift/src/main/java/org/apache/hadoop/hbase/thrift2/generated/TTimeRange.java
@@ -6,6 +6,7 @@
  */
 package org.apache.hadoop.hbase.thrift2.generated;
 
+import org.apache.commons.lang.builder.HashCodeBuilder;
 import org.apache.thrift.scheme.IScheme;
 import org.apache.thrift.scheme.SchemeFactory;
 import org.apache.thrift.scheme.StandardScheme;
@@ -286,7 +287,19 @@ public class TTimeRange implements org.apache.thrift.TBase<TTimeRange,
TTimeRang
 
   @Override
   public int hashCode() {
-    return 0;
+    HashCodeBuilder builder = new HashCodeBuilder();
+
+    boolean present_minStamp = true;
+    builder.append(present_minStamp);
+    if (present_minStamp)
+      builder.append(minStamp);
+
+    boolean present_maxStamp = true;
+    builder.append(present_maxStamp);
+    if (present_maxStamp)
+      builder.append(maxStamp);
+
+    return builder.toHashCode();
   }
 
   public int compareTo(TTimeRange other) {


Mime
View raw message