Author: gates
Date: Thu Jan 21 19:06:02 2010
New Revision: 901828

URL: http://svn.apache.org/viewvc?rev=901828&view=rev
Log:
PIG-1166 Reverting this change pending further discussion of when we want to 
break UDF interfaces.

Removed:
    hadoop/pig/trunk/test/org/apache/pig/test/TestTupleBagInterface.java
Modified:
    hadoop/pig/trunk/CHANGES.txt
    hadoop/pig/trunk/src/org/apache/pig/data/AccumulativeBag.java
    hadoop/pig/trunk/src/org/apache/pig/data/DataBag.java
    hadoop/pig/trunk/src/org/apache/pig/data/DefaultAbstractBag.java
    hadoop/pig/trunk/src/org/apache/pig/data/DefaultTuple.java
    hadoop/pig/trunk/src/org/apache/pig/data/DistinctDataBag.java
    hadoop/pig/trunk/src/org/apache/pig/data/InternalCachedBag.java
    hadoop/pig/trunk/src/org/apache/pig/data/InternalDistinctBag.java
    hadoop/pig/trunk/src/org/apache/pig/data/InternalSortedBag.java
    hadoop/pig/trunk/src/org/apache/pig/data/NonSpillableDataBag.java
    hadoop/pig/trunk/src/org/apache/pig/data/ReadOnceBag.java
    hadoop/pig/trunk/src/org/apache/pig/data/SingleTupleBag.java
    hadoop/pig/trunk/src/org/apache/pig/data/TargetedTuple.java
    hadoop/pig/trunk/src/org/apache/pig/data/Tuple.java
    hadoop/pig/trunk/src/org/apache/pig/pen/util/ExampleTuple.java

Modified: hadoop/pig/trunk/CHANGES.txt
URL: 
http://svn.apache.org/viewvc/hadoop/pig/trunk/CHANGES.txt?rev=901828&r1=901827&r2=901828&view=diff
==============================================================================
--- hadoop/pig/trunk/CHANGES.txt (original)
+++ hadoop/pig/trunk/CHANGES.txt Thu Jan 21 19:06:02 2010
@@ -24,8 +24,6 @@
 
 IMPROVEMENTS
 
-PIG-1166: A bit change of the interface of Tuple & DataBag:make the set and 
append method return this (zjffdu)
-
 PIG-1177: Pig 0.6 Docs - Zebra docs (chandec via olgan)
 
 PIG-1175: Pig 0.6 Docs - Store v. Dump (chandec via olgan)

Modified: hadoop/pig/trunk/src/org/apache/pig/data/AccumulativeBag.java
URL: 
http://svn.apache.org/viewvc/hadoop/pig/trunk/src/org/apache/pig/data/AccumulativeBag.java?rev=901828&r1=901827&r2=901828&view=diff
==============================================================================
--- hadoop/pig/trunk/src/org/apache/pig/data/AccumulativeBag.java (original)
+++ hadoop/pig/trunk/src/org/apache/pig/data/AccumulativeBag.java Thu Jan 21 
19:06:02 2010
@@ -35,11 +35,11 @@
         this.index = index;
     }
     
-    public DataBag add(Tuple t) {
+    public void add(Tuple t) {
         throw new RuntimeException("AccumulativeBag does not support add 
operation");
     }
 
-    public DataBag addAll(DataBag b) {
+    public void addAll(DataBag b) {
         throw new RuntimeException("AccumulativeBag does not support add 
operation");
     }
 

Modified: hadoop/pig/trunk/src/org/apache/pig/data/DataBag.java
URL: 
http://svn.apache.org/viewvc/hadoop/pig/trunk/src/org/apache/pig/data/DataBag.java?rev=901828&r1=901827&r2=901828&view=diff
==============================================================================
--- hadoop/pig/trunk/src/org/apache/pig/data/DataBag.java (original)
+++ hadoop/pig/trunk/src/org/apache/pig/data/DataBag.java Thu Jan 21 19:06:02 
2010
@@ -94,16 +94,14 @@
     /**
      * Add a tuple to the bag.
      * @param t tuple to add.
-     * @return The DataBag itself
      */
-    DataBag add(Tuple t);
+    void add(Tuple t);
 
     /**
      * Add contents of a bag to the bag.
      * @param b bag to add contents of.
-     * @return The DataBag itself
      */
-    DataBag addAll(DataBag b);
+    void addAll(DataBag b);
 
     /**
      * Clear out the contents of the bag, both on disk and in memory.

Modified: hadoop/pig/trunk/src/org/apache/pig/data/DefaultAbstractBag.java
URL: 
http://svn.apache.org/viewvc/hadoop/pig/trunk/src/org/apache/pig/data/DefaultAbstractBag.java?rev=901828&r1=901827&r2=901828&view=diff
==============================================================================
--- hadoop/pig/trunk/src/org/apache/pig/data/DefaultAbstractBag.java (original)
+++ hadoop/pig/trunk/src/org/apache/pig/data/DefaultAbstractBag.java Thu Jan 21 
19:06:02 2010
@@ -76,12 +76,11 @@
      * Add a tuple to the bag.
      * @param t tuple to add.
      */
-    public DataBag add(Tuple t) {
+    public void add(Tuple t) {
         synchronized (mContents) {
             mMemSizeChanged = true;
             mSize++;
             mContents.add(t);
-            return this;
         }
     }
 
@@ -89,13 +88,12 @@
      * Add contents of a bag to the bag.
      * @param b bag to add contents of.
      */
-    public DataBag addAll(DataBag b) {
+    public void addAll(DataBag b) {
         synchronized (mContents) {
             mMemSizeChanged = true;
             mSize += b.size();
             Iterator<Tuple> i = b.iterator();
             while (i.hasNext()) mContents.add(i.next());
-            return this;
         }
     }
 

Modified: hadoop/pig/trunk/src/org/apache/pig/data/DefaultTuple.java
URL: 
http://svn.apache.org/viewvc/hadoop/pig/trunk/src/org/apache/pig/data/DefaultTuple.java?rev=901828&r1=901827&r2=901828&view=diff
==============================================================================
--- hadoop/pig/trunk/src/org/apache/pig/data/DefaultTuple.java (original)
+++ hadoop/pig/trunk/src/org/apache/pig/data/DefaultTuple.java Thu Jan 21 
19:06:02 2010
@@ -159,9 +159,8 @@
      * @throws ExecException if the field number is greater than or equal to
      * the number of fields in the tuple.
      */
-    public Tuple set(int fieldNum, Object val) throws ExecException {
+    public void set(int fieldNum, Object val) throws ExecException {
         mFields.set(fieldNum, val);
-        return this;
     }
 
     /**
@@ -172,9 +171,8 @@
      * than construct it with newTuple() and append values.
      * @param val Object to append to the tuple.
      */
-    public Tuple append(Object val) {
+    public void append(Object val) {
         mFields.add(val);
-        return this;
     }
 
     /**

Modified: hadoop/pig/trunk/src/org/apache/pig/data/DistinctDataBag.java
URL: 
http://svn.apache.org/viewvc/hadoop/pig/trunk/src/org/apache/pig/data/DistinctDataBag.java?rev=901828&r1=901827&r2=901828&view=diff
==============================================================================
--- hadoop/pig/trunk/src/org/apache/pig/data/DistinctDataBag.java (original)
+++ hadoop/pig/trunk/src/org/apache/pig/data/DistinctDataBag.java Thu Jan 21 
19:06:02 2010
@@ -102,17 +102,16 @@
     }
 
     @Override
-    public DataBag add(Tuple t) {
+    public void add(Tuple t) {
         synchronized (mContents) {
             if (mContents.add(t)) {
                 mSize++;
             }
-            return this;
         }
     }
 
     @Override
-    public DataBag addAll(DataBag b) {
+    public void addAll(DataBag b) {
         synchronized (mContents) {
             Iterator<Tuple> i = b.iterator();
             while (i.hasNext()) {
@@ -120,7 +119,6 @@
                     mSize++;
                 }
             }
-            return this;
         }
     }
 

Modified: hadoop/pig/trunk/src/org/apache/pig/data/InternalCachedBag.java
URL: 
http://svn.apache.org/viewvc/hadoop/pig/trunk/src/org/apache/pig/data/InternalCachedBag.java?rev=901828&r1=901827&r2=901828&view=diff
==============================================================================
--- hadoop/pig/trunk/src/org/apache/pig/data/InternalCachedBag.java (original)
+++ hadoop/pig/trunk/src/org/apache/pig/data/InternalCachedBag.java Thu Jan 21 
19:06:02 2010
@@ -76,7 +76,7 @@
         addDone = false;
     }
 
-    public DataBag add(Tuple t) {
+    public void add(Tuple t) {
        
         if(addDone) {
             throw new IllegalStateException("InternalCachedBag is closed for 
adding new tuples");
@@ -115,15 +115,13 @@
         }
         
         mSize++;
-        return this;
     }
 
-    public DataBag addAll(DataBag b) {
+    public void addAll(DataBag b) {
        Iterator<Tuple> iter = b.iterator();
        while(iter.hasNext()) {
                add(iter.next());
        }
-       return this;
     }
 
     public void addAll(Collection<Tuple> c) {

Modified: hadoop/pig/trunk/src/org/apache/pig/data/InternalDistinctBag.java
URL: 
http://svn.apache.org/viewvc/hadoop/pig/trunk/src/org/apache/pig/data/InternalDistinctBag.java?rev=901828&r1=901827&r2=901828&view=diff
==============================================================================
--- hadoop/pig/trunk/src/org/apache/pig/data/InternalDistinctBag.java (original)
+++ hadoop/pig/trunk/src/org/apache/pig/data/InternalDistinctBag.java Thu Jan 
21 19:06:02 2010
@@ -138,7 +138,7 @@
     }
 
     @Override
-    public DataBag add(Tuple t) {        
+    public void add(Tuple t) {        
         
         if(mReadStarted) {
             throw new IllegalStateException("InternalDistinctBag is closed for 
adding new tuples");
@@ -162,16 +162,14 @@
                        log.debug("Memory can hold "+ cacheLimit + " records.");
                 }
             }          
-        }
-        return this;
+        }      
     }
 
-    public DataBag addAll(DataBag b) {
+    public void addAll(DataBag b) {
        Iterator<Tuple> iter = b.iterator();
        while(iter.hasNext()) {
                add(iter.next());
        }
-       return this;
     }
 
     public void addAll(Collection<Tuple> c) {

Modified: hadoop/pig/trunk/src/org/apache/pig/data/InternalSortedBag.java
URL: 
http://svn.apache.org/viewvc/hadoop/pig/trunk/src/org/apache/pig/data/InternalSortedBag.java?rev=901828&r1=901827&r2=901828&view=diff
==============================================================================
--- hadoop/pig/trunk/src/org/apache/pig/data/InternalSortedBag.java (original)
+++ hadoop/pig/trunk/src/org/apache/pig/data/InternalSortedBag.java Thu Jan 21 
19:06:02 2010
@@ -136,7 +136,7 @@
         }        
     }
     
-    public DataBag add(Tuple t) {
+    public void add(Tuple t) {
        if(mReadStarted) {
             throw new IllegalStateException("InternalSortedBag is closed for 
adding new tuples");
         }
@@ -160,15 +160,13 @@
         }
                 
         mSize++;
-        return this;
     }
     
-    public DataBag addAll(DataBag b) {
+    public void addAll(DataBag b) {
        Iterator<Tuple> iter = b.iterator();
        while(iter.hasNext()) {
                add(iter.next());
        }
-       return this;
     }
 
     public void addAll(Collection<Tuple> c) {

Modified: hadoop/pig/trunk/src/org/apache/pig/data/NonSpillableDataBag.java
URL: 
http://svn.apache.org/viewvc/hadoop/pig/trunk/src/org/apache/pig/data/NonSpillableDataBag.java?rev=901828&r1=901827&r2=901828&view=diff
==============================================================================
--- hadoop/pig/trunk/src/org/apache/pig/data/NonSpillableDataBag.java (original)
+++ hadoop/pig/trunk/src/org/apache/pig/data/NonSpillableDataBag.java Thu Jan 
21 19:06:02 2010
@@ -111,17 +111,15 @@
     }
 
     @Override
-    public DataBag add(Tuple t) {
+    public void add(Tuple t) {
         mContents.add(t);
-        return this;
     }
 
     @Override
-    public DataBag addAll(DataBag b) {
+    public void addAll(DataBag b) {
         for (Tuple t : b) {
             mContents.add(t);
         }
-        return this;
     }
 
     @Override

Modified: hadoop/pig/trunk/src/org/apache/pig/data/ReadOnceBag.java
URL: 
http://svn.apache.org/viewvc/hadoop/pig/trunk/src/org/apache/pig/data/ReadOnceBag.java?rev=901828&r1=901827&r2=901828&view=diff
==============================================================================
--- hadoop/pig/trunk/src/org/apache/pig/data/ReadOnceBag.java (original)
+++ hadoop/pig/trunk/src/org/apache/pig/data/ReadOnceBag.java Thu Jan 21 
19:06:02 2010
@@ -92,7 +92,7 @@
      * @see org.apache.pig.data.DataBag#add(org.apache.pig.data.Tuple)
      */
     @Override
-    public DataBag add(Tuple t) {
+    public void add(Tuple t) {
         throw new RuntimeException("ReadOnceBag does not support add 
operation");              
     }
 
@@ -100,7 +100,7 @@
      * @see org.apache.pig.data.DataBag#addAll(org.apache.pig.data.DataBag)
      */
     @Override
-    public DataBag addAll(DataBag b) {
+    public void addAll(DataBag b) {
         throw new RuntimeException("ReadOnceBag does not support addAll 
operation");
     }
 

Modified: hadoop/pig/trunk/src/org/apache/pig/data/SingleTupleBag.java
URL: 
http://svn.apache.org/viewvc/hadoop/pig/trunk/src/org/apache/pig/data/SingleTupleBag.java?rev=901828&r1=901827&r2=901828&view=diff
==============================================================================
--- hadoop/pig/trunk/src/org/apache/pig/data/SingleTupleBag.java (original)
+++ hadoop/pig/trunk/src/org/apache/pig/data/SingleTupleBag.java Thu Jan 21 
19:06:02 2010
@@ -50,16 +50,15 @@
      * Tuple is ever added into a SingleTupleBag
      */
     @Override
-    public DataBag add(Tuple t) {
+    public void add(Tuple t) {
         item = t;
-        return this;
     }
 
     /* (non-Javadoc)
      * @see org.apache.pig.data.DataBag#addAll(org.apache.pig.data.DataBag)
      */
     @Override
-    public DataBag addAll(DataBag b) {
+    public void addAll(DataBag b) {
         throw new RuntimeException("Cannot create SingleTupleBag from another 
DataBag");
     }
 

Modified: hadoop/pig/trunk/src/org/apache/pig/data/TargetedTuple.java
URL: 
http://svn.apache.org/viewvc/hadoop/pig/trunk/src/org/apache/pig/data/TargetedTuple.java?rev=901828&r1=901827&r2=901828&view=diff
==============================================================================
--- hadoop/pig/trunk/src/org/apache/pig/data/TargetedTuple.java (original)
+++ hadoop/pig/trunk/src/org/apache/pig/data/TargetedTuple.java Thu Jan 21 
19:06:02 2010
@@ -106,9 +106,8 @@
         this.targetOps = targetOps;
     }
 
-    public Tuple append(Object val) {
+    public void append(Object val) {
         t.append(val);
-        return this;
     }
 
     public Object get(int fieldNum) throws ExecException {
@@ -135,9 +134,8 @@
         this.t = t;
     }
 
-    public Tuple set(int fieldNum, Object val) throws ExecException {
+    public void set(int fieldNum, Object val) throws ExecException {
         t.set(fieldNum, val);
-        return this;
     }
 
     public int size() {

Modified: hadoop/pig/trunk/src/org/apache/pig/data/Tuple.java
URL: 
http://svn.apache.org/viewvc/hadoop/pig/trunk/src/org/apache/pig/data/Tuple.java?rev=901828&r1=901827&r2=901828&view=diff
==============================================================================
--- hadoop/pig/trunk/src/org/apache/pig/data/Tuple.java (original)
+++ hadoop/pig/trunk/src/org/apache/pig/data/Tuple.java Thu Jan 21 19:06:02 2010
@@ -110,9 +110,8 @@
      * @param val Object to put in the indicated field.
      * @throws ExecException if the field number is greater than or equal to
      * the number of fields in the tuple.
-     * @return The Tuple itself
      */
-    Tuple set(int fieldNum, Object val) throws ExecException;
+    void set(int fieldNum, Object val) throws ExecException;
 
     /**
      * Append a field to a tuple.  This method is not efficient as it may
@@ -121,9 +120,8 @@
      * newTuple(int) method and then fill in the values with set(), rather
      * than construct it with newTuple() and append values.
      * @param val Object to append to the tuple.
-     * @return The Tuple itself
      */
-    Tuple append(Object val);
+    void append(Object val);
 
     /**
      * Determine the size of tuple in memory.  This is used by data bags

Modified: hadoop/pig/trunk/src/org/apache/pig/pen/util/ExampleTuple.java
URL: 
http://svn.apache.org/viewvc/hadoop/pig/trunk/src/org/apache/pig/pen/util/ExampleTuple.java?rev=901828&r1=901827&r2=901828&view=diff
==============================================================================
--- hadoop/pig/trunk/src/org/apache/pig/pen/util/ExampleTuple.java (original)
+++ hadoop/pig/trunk/src/org/apache/pig/pen/util/ExampleTuple.java Thu Jan 21 
19:06:02 2010
@@ -71,9 +71,9 @@
         return t;
     }
 
-    public Tuple append(Object val) {
+    public void append(Object val) {
         t.append(val);
-        return this;
+
     }
 
     public Object get(int fieldNum) throws ExecException {
@@ -104,9 +104,8 @@
         t.reference(t);
     }
 
-    public Tuple set(int fieldNum, Object val) throws ExecException {
+    public void set(int fieldNum, Object val) throws ExecException {
         t.set(fieldNum, val);
-        return this;
     }
 
     public void setNull(boolean isNull) {


Reply via email to