HBASE-1637 Delete client class methods should return itself like Put, Get, Scan (Jon Gray via Nitay)

git-svn-id: https://svn.apache.org/repos/asf/hadoop/hbase/trunk@792746 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Nitay Joffe 2009-07-09 23:27:09 +00:00
parent 800f623138
commit 2ec772096e
2 changed files with 19 additions and 9 deletions

View File

@ -454,6 +454,8 @@ Release 0.20.0 - Unreleased
HBASE-1626 Allow emitting Deletes out of new TableReducer
(Lars George via Stack)
HBASE-1551 HBase should manage multiple node ZooKeeper quorum
HBASE-1637 Delete client class methods should return itself like Put, Get,
Scan (Jon Gray via Nitay)
OPTIMIZATIONS
HBASE-1412 Change values for delete column and column family in KeyValue

View File

@ -132,8 +132,9 @@ public class Delete implements Writable {
* specified family.
* @param family family name
*/
public void deleteFamily(byte [] family) {
this.deleteFamily(family, HConstants.LATEST_TIMESTAMP);
public Delete deleteFamily(byte [] family) {
this.deleteFamily(family, HConstants.LATEST_TIMESTAMP);
return this;
}
/**
@ -145,7 +146,7 @@ public class Delete implements Writable {
* @param family family name
* @param timestamp maximum version timestamp
*/
public void deleteFamily(byte [] family, long timestamp) {
public Delete deleteFamily(byte [] family, long timestamp) {
List<KeyValue> list = familyMap.get(family);
if(list == null) {
list = new ArrayList<KeyValue>();
@ -154,6 +155,7 @@ public class Delete implements Writable {
}
list.add(new KeyValue(row, family, null, timestamp, KeyValue.Type.DeleteFamily));
familyMap.put(family, list);
return this;
}
/**
@ -161,8 +163,9 @@ public class Delete implements Writable {
* @param family family name
* @param qualifier column qualifier
*/
public void deleteColumns(byte [] family, byte [] qualifier) {
public Delete deleteColumns(byte [] family, byte [] qualifier) {
this.deleteColumns(family, qualifier, HConstants.LATEST_TIMESTAMP);
return this;
}
/**
@ -172,7 +175,7 @@ public class Delete implements Writable {
* @param qualifier column qualifier
* @param timestamp maximum version timestamp
*/
public void deleteColumns(byte [] family, byte [] qualifier, long timestamp) {
public Delete deleteColumns(byte [] family, byte [] qualifier, long timestamp) {
List<KeyValue> list = familyMap.get(family);
if (list == null) {
list = new ArrayList<KeyValue>();
@ -180,6 +183,7 @@ public class Delete implements Writable {
list.add(new KeyValue(this.row, family, qualifier, timestamp,
KeyValue.Type.DeleteColumn));
familyMap.put(family, list);
return this;
}
/**
@ -189,9 +193,10 @@ public class Delete implements Writable {
* @param column colon-delimited family and qualifier
* @param timestamp maximum version timestamp
*/
public void deleteColumns(byte [] column, long timestamp) {
public Delete deleteColumns(byte [] column, long timestamp) {
byte [][] parts = KeyValue.parseColumn(column);
this.deleteColumns(parts[0], parts[1], timestamp);
return this;
}
/**
@ -202,8 +207,9 @@ public class Delete implements Writable {
* @param family family name
* @param qualifier column qualifier
*/
public void deleteColumn(byte [] family, byte [] qualifier) {
public Delete deleteColumn(byte [] family, byte [] qualifier) {
this.deleteColumn(family, qualifier, HConstants.LATEST_TIMESTAMP);
return this;
}
/**
@ -212,7 +218,7 @@ public class Delete implements Writable {
* @param qualifier column qualifier
* @param timestamp version timestamp
*/
public void deleteColumn(byte [] family, byte [] qualifier, long timestamp) {
public Delete deleteColumn(byte [] family, byte [] qualifier, long timestamp) {
List<KeyValue> list = familyMap.get(family);
if(list == null) {
list = new ArrayList<KeyValue>();
@ -220,6 +226,7 @@ public class Delete implements Writable {
list.add(new KeyValue(
this.row, family, qualifier, timestamp, KeyValue.Type.Delete));
familyMap.put(family, list);
return this;
}
/**
@ -227,9 +234,10 @@ public class Delete implements Writable {
* <code>family:qualifier</code> notation.
* @param column colon-delimited family and qualifier
*/
public void deleteColumn(byte [] column) {
public Delete deleteColumn(byte [] column) {
byte [][] parts = KeyValue.parseColumn(column);
this.deleteColumn(parts[0], parts[1], HConstants.LATEST_TIMESTAMP);
return this;
}
/**