pig-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jcove...@apache.org
Subject svn commit: r1371534 - in /pig/trunk/src/org/apache/pig/data: BinInterSedes.java utils/SedesHelper.java
Date Fri, 10 Aug 2012 00:17:16 GMT
Author: jcoveney
Date: Fri Aug 10 00:17:15 2012
New Revision: 1371534

URL: http://svn.apache.org/viewvc?rev=1371534&view=rev
Log:
properly commit PIG-2862 (jcoveney)

Modified:
    pig/trunk/src/org/apache/pig/data/BinInterSedes.java
    pig/trunk/src/org/apache/pig/data/utils/SedesHelper.java

Modified: pig/trunk/src/org/apache/pig/data/BinInterSedes.java
URL: http://svn.apache.org/viewvc/pig/trunk/src/org/apache/pig/data/BinInterSedes.java?rev=1371534&r1=1371533&r2=1371534&view=diff
==============================================================================
--- pig/trunk/src/org/apache/pig/data/BinInterSedes.java (original)
+++ pig/trunk/src/org/apache/pig/data/BinInterSedes.java Fri Aug 10 00:17:15 2012
@@ -103,6 +103,17 @@ public class BinInterSedes implements In
     public static final byte LONG_0 = 34;
     public static final byte LONG_1 = 35;
 
+    public static final byte TUPLE_0 = 36;
+    public static final byte TUPLE_1 = 37;
+    public static final byte TUPLE_2 = 38;
+    public static final byte TUPLE_3 = 39;
+    public static final byte TUPLE_4 = 40;
+    public static final byte TUPLE_5 = 41;
+    public static final byte TUPLE_6 = 42;
+    public static final byte TUPLE_7 = 43;
+    public static final byte TUPLE_8 = 44;
+    public static final byte TUPLE_9 = 45;
+
     private static TupleFactory mTupleFactory = TupleFactory.getInstance();
     private static BagFactory mBagFactory = BagFactory.getInstance();
     public static final int UNSIGNED_SHORT_MAX = 65535;
@@ -111,6 +122,16 @@ public class BinInterSedes implements In
 
     public Tuple readTuple(DataInput in, byte type) throws IOException {
         switch (type) {
+        case TUPLE_0:
+        case TUPLE_1:
+        case TUPLE_2:
+        case TUPLE_3:
+        case TUPLE_4:
+        case TUPLE_5:
+        case TUPLE_6:
+        case TUPLE_7:
+        case TUPLE_8:
+        case TUPLE_9:
         case TUPLE:
         case TINYTUPLE:
         case SMALLTUPLE:
@@ -140,8 +161,29 @@ public class BinInterSedes implements In
     }
 
     public int getTupleSize(DataInput in, byte type) throws IOException {
+
         int sz;
         switch (type) {
+        case TUPLE_0:
+            return 0;
+        case TUPLE_1:
+            return 1;
+        case TUPLE_2:
+            return 2;
+        case TUPLE_3:
+            return 3;
+        case TUPLE_4:
+            return 4;
+        case TUPLE_5:
+            return 5;
+        case TUPLE_6:
+            return 6;
+        case TUPLE_7:
+            return 7;
+        case TUPLE_8:
+            return 8;
+        case TUPLE_9:
+            return 9;
         case TINYTUPLE:
             sz = in.readUnsignedByte();
             break;
@@ -281,6 +323,16 @@ public class BinInterSedes implements In
     @Override
     public Object readDatum(DataInput in, byte type) throws IOException, ExecException {
         switch (type) {
+        case TUPLE_0:
+        case TUPLE_1:
+        case TUPLE_2:
+        case TUPLE_3:
+        case TUPLE_4:
+        case TUPLE_5:
+        case TUPLE_6:
+        case TUPLE_7:
+        case TUPLE_8:
+        case TUPLE_9:
         case TUPLE:
         case TINYTUPLE:
         case SMALLTUPLE:
@@ -817,6 +869,16 @@ public class BinInterSedes implements In
                 }
                 break;
             }
+            case BinInterSedes.TUPLE_0:
+            case BinInterSedes.TUPLE_1:
+            case BinInterSedes.TUPLE_2:
+            case BinInterSedes.TUPLE_3:
+            case BinInterSedes.TUPLE_4:
+            case BinInterSedes.TUPLE_5:
+            case BinInterSedes.TUPLE_6:
+            case BinInterSedes.TUPLE_7:
+            case BinInterSedes.TUPLE_8:
+            case BinInterSedes.TUPLE_9:
             case BinInterSedes.TINYTUPLE:
             case BinInterSedes.SMALLTUPLE:
             case BinInterSedes.TUPLE: {
@@ -1142,6 +1204,26 @@ public class BinInterSedes implements In
             case BinInterSedes.BAG:
             case BinInterSedes.MAP:
                 return bb.getInt();
+            case BinInterSedes.TUPLE_0:
+                return 0;
+            case BinInterSedes.TUPLE_1:
+                return 1;
+            case BinInterSedes.TUPLE_2:
+                return 2;
+            case BinInterSedes.TUPLE_3:
+                return 3;
+            case BinInterSedes.TUPLE_4:
+                return 4;
+            case BinInterSedes.TUPLE_5:
+                return 5;
+            case BinInterSedes.TUPLE_6:
+                return 6;
+            case BinInterSedes.TUPLE_7:
+                return 7;
+            case BinInterSedes.TUPLE_8:
+                return 8;
+            case BinInterSedes.TUPLE_9:
+                return 9;
             default:
                 throw new RuntimeException("Unexpected data type " + type + " found in stream.");
             }
@@ -1173,6 +1255,16 @@ public class BinInterSedes implements In
             || b == BinInterSedes.TINYTUPLE
             || b == BinInterSedes.SCHEMA_TUPLE
             || b == BinInterSedes.SCHEMA_TUPLE_BYTE_INDEX
-            || b == BinInterSedes.SCHEMA_TUPLE_SHORT_INDEX;
+            || b == BinInterSedes.SCHEMA_TUPLE_SHORT_INDEX
+            || b == BinInterSedes.TUPLE_0
+            || b == BinInterSedes.TUPLE_1
+            || b == BinInterSedes.TUPLE_2
+            || b == BinInterSedes.TUPLE_3
+            || b == BinInterSedes.TUPLE_4
+            || b == BinInterSedes.TUPLE_5
+            || b == BinInterSedes.TUPLE_6
+            || b == BinInterSedes.TUPLE_7
+            || b == BinInterSedes.TUPLE_8
+            || b == BinInterSedes.TUPLE_9;
     }
 }

Modified: pig/trunk/src/org/apache/pig/data/utils/SedesHelper.java
URL: http://svn.apache.org/viewvc/pig/trunk/src/org/apache/pig/data/utils/SedesHelper.java?rev=1371534&r1=1371533&r2=1371534&view=diff
==============================================================================
--- pig/trunk/src/org/apache/pig/data/utils/SedesHelper.java (original)
+++ pig/trunk/src/org/apache/pig/data/utils/SedesHelper.java Fri Aug 10 00:17:15 2012
@@ -87,6 +87,38 @@ public class SedesHelper {
 
     public static void writeGenericTuple(DataOutput out, Tuple t) throws IOException {
         int sz = t.size();
+        switch (sz) {
+        case BinInterSedes.TUPLE_0:
+            out.writeByte(BinInterSedes.TUPLE_0);
+            break;
+        case BinInterSedes.TUPLE_1:
+            out.writeByte(BinInterSedes.TUPLE_1);
+            break;
+        case BinInterSedes.TUPLE_2:
+            out.writeByte(BinInterSedes.TUPLE_2);
+            break;
+        case BinInterSedes.TUPLE_3:
+            out.writeByte(BinInterSedes.TUPLE_3);
+            break;
+        case BinInterSedes.TUPLE_4:
+            out.writeByte(BinInterSedes.TUPLE_4);
+            break;
+        case BinInterSedes.TUPLE_5:
+            out.writeByte(BinInterSedes.TUPLE_5);
+            break;
+        case BinInterSedes.TUPLE_6:
+            out.writeByte(BinInterSedes.TUPLE_6);
+            break;
+        case BinInterSedes.TUPLE_7:
+            out.writeByte(BinInterSedes.TUPLE_7);
+            break;
+        case BinInterSedes.TUPLE_8:
+            out.writeByte(BinInterSedes.TUPLE_8);
+            break;
+        case BinInterSedes.TUPLE_9:
+            out.writeByte(BinInterSedes.TUPLE_9);
+            break;
+        default:
         if (sz < BinInterSedes.UNSIGNED_BYTE_MAX) {
             out.writeByte(BinInterSedes.TINYTUPLE);
             out.writeByte(sz);
@@ -97,6 +129,7 @@ public class SedesHelper {
             out.writeByte(BinInterSedes.TUPLE);
             out.writeInt(sz);
         }
+        }
 
         for (int i = 0; i < sz; i++) {
             pigSerializer.writeDatum(out, t.get(i));



Mime
View raw message