hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From st...@apache.org
Subject svn commit: r788475 - in /hadoop/hbase/trunk: CHANGES.txt src/java/org/apache/hadoop/hbase/client/Put.java
Date Thu, 25 Jun 2009 19:26:01 GMT
Author: stack
Date: Thu Jun 25 19:26:01 2009
New Revision: 788475

URL: http://svn.apache.org/viewvc?rev=788475&view=rev
Log:
HBASE-1584 Put add methods should return this for ease of use (Be consistant with Get)

Modified:
    hadoop/hbase/trunk/CHANGES.txt
    hadoop/hbase/trunk/src/java/org/apache/hadoop/hbase/client/Put.java

Modified: hadoop/hbase/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/hadoop/hbase/trunk/CHANGES.txt?rev=788475&r1=788474&r2=788475&view=diff
==============================================================================
--- hadoop/hbase/trunk/CHANGES.txt (original)
+++ hadoop/hbase/trunk/CHANGES.txt Thu Jun 25 19:26:01 2009
@@ -401,6 +401,8 @@
                'memtable' or....
    HBASE-1562  How to handle the setting of 32 bit versus 64 bit machines
                (Erik Holstad via Stack)
+   HBASE-1584  Put add methods should return this for ease of use (Be
+               consistant with Get) (Clint Morgan via Stack)
 
   OPTIMIZATIONS
    HBASE-1412  Change values for delete column and column family in KeyValue

Modified: hadoop/hbase/trunk/src/java/org/apache/hadoop/hbase/client/Put.java
URL: http://svn.apache.org/viewvc/hadoop/hbase/trunk/src/java/org/apache/hadoop/hbase/client/Put.java?rev=788475&r1=788474&r2=788475&view=diff
==============================================================================
--- hadoop/hbase/trunk/src/java/org/apache/hadoop/hbase/client/Put.java (original)
+++ hadoop/hbase/trunk/src/java/org/apache/hadoop/hbase/client/Put.java Thu Jun 25 19:26:01
2009
@@ -103,8 +103,8 @@
    * @param qualifier column qualifier
    * @param value column value
    */
-  public void add(byte [] family, byte [] qualifier, byte [] value) {
-    add(family, qualifier, this.timestamp, value);
+  public Put add(byte [] family, byte [] qualifier, byte [] value) {
+    return add(family, qualifier, this.timestamp, value);
   }
 
   /**
@@ -115,9 +115,9 @@
    * @param ts version timestamp
    * @param value column value
    */
-  public void add(byte [] column, long ts, byte [] value) {
+  public Put add(byte [] column, long ts, byte [] value) {
     byte [][] parts = KeyValue.parseColumn(column);
-    add(parts[0], parts[1], ts, value);
+    return add(parts[0], parts[1], ts, value);
   }
 
   /**
@@ -128,7 +128,7 @@
    * @param ts version timestamp
    * @param value column value
    */
-  public void add(byte [] family, byte [] qualifier, long ts, byte [] value) {
+  public Put add(byte [] family, byte [] qualifier, long ts, byte [] value) {
     List<KeyValue> list = familyMap.get(family);
     if(list == null) {
       list = new ArrayList<KeyValue>(0);
@@ -137,13 +137,14 @@
       KeyValue.Type.Put, value); 
     list.add(kv);
     familyMap.put(family, list);
+    return this;
   }
   
   /**
    * Add the specified KeyValue to this Put operation.
    * @param kv
    */
-  public void add(KeyValue kv) {
+  public Put add(KeyValue kv) {
     byte [] family = kv.getFamily();
     List<KeyValue> list = familyMap.get(family);
     if(list == null) {
@@ -151,6 +152,7 @@
     }
     list.add(kv);
     familyMap.put(family, list);
+    return this;
   }
   
   
@@ -195,11 +197,19 @@
   }
   
   /**
+   * @return Timestamp
+   */
+  public long getTimeStamp() {
+    return this.timestamp;
+  }
+  
+  /**
    * Method for setting the timestamp
    * @param timestamp
    */
-  public void setTimeStamp(long timestamp) {
+  public Put setTimeStamp(long timestamp) {
     this.timestamp = timestamp;
+    return this;
   }
   
   /**



Mime
View raw message