[37/50] [abbrv] hbase git commit: HBASE-18573 Update Append and Delete to use Mutation#getCellList(family)

2017-08-20 Thread busbey
HBASE-18573 Update Append and Delete to use Mutation#getCellList(family)

Signed-off-by: Jerry He 


Project: http://git-wip-us.apache.org/repos/asf/hbase/repo
Commit: http://git-wip-us.apache.org/repos/asf/hbase/commit/4c3a64db
Tree: http://git-wip-us.apache.org/repos/asf/hbase/tree/4c3a64db
Diff: http://git-wip-us.apache.org/repos/asf/hbase/diff/4c3a64db

Branch: refs/heads/HBASE-18467
Commit: 4c3a64db13b086ad3d8a6ffa1be8ba2f5a24719c
Parents: 5d2c3dd
Author: Xiang Li 
Authored: Thu Aug 17 00:39:35 2017 +0800
Committer: Jerry He 
Committed: Wed Aug 16 14:50:46 2017 -0700

--
 .../org/apache/hadoop/hbase/client/Append.java  |  9 +++---
 .../org/apache/hadoop/hbase/client/Delete.java  | 31 
 2 files changed, 10 insertions(+), 30 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/hbase/blob/4c3a64db/hbase-client/src/main/java/org/apache/hadoop/hbase/client/Append.java
--
diff --git 
a/hbase-client/src/main/java/org/apache/hadoop/hbase/client/Append.java 
b/hbase-client/src/main/java/org/apache/hadoop/hbase/client/Append.java
index 2bd0860..6947313 100644
--- a/hbase-client/src/main/java/org/apache/hadoop/hbase/client/Append.java
+++ b/hbase-client/src/main/java/org/apache/hadoop/hbase/client/Append.java
@@ -134,11 +134,10 @@ public class Append extends Mutation {
   public Append add(final Cell cell) {
 // Presume it is KeyValue for now.
 byte [] family = CellUtil.cloneFamily(cell);
-List list = this.familyMap.get(family);
-if (list == null) {
-  list  = new ArrayList<>(1);
-  this.familyMap.put(family, list);
-}
+
+// Get cell list for the family
+List list = getCellList(family);
+
 // find where the new entry should be placed in the List
 list.add(cell);
 return this;

http://git-wip-us.apache.org/repos/asf/hbase/blob/4c3a64db/hbase-client/src/main/java/org/apache/hadoop/hbase/client/Delete.java
--
diff --git 
a/hbase-client/src/main/java/org/apache/hadoop/hbase/client/Delete.java 
b/hbase-client/src/main/java/org/apache/hadoop/hbase/client/Delete.java
index bf5241c..66b6cfc 100644
--- a/hbase-client/src/main/java/org/apache/hadoop/hbase/client/Delete.java
+++ b/hbase-client/src/main/java/org/apache/hadoop/hbase/client/Delete.java
@@ -180,11 +180,7 @@ public class Delete extends Mutation implements 
Comparable {
 " doesn't match the original one " +  Bytes.toStringBinary(this.row));
 }
 byte [] family = CellUtil.cloneFamily(kv);
-List list = familyMap.get(family);
-if (list == null) {
-  list = new ArrayList<>(1);
-  familyMap.put(family, list);
-}
+List list = getCellList(family);
 list.add(kv);
 return this;
   }
@@ -216,11 +212,8 @@ public class Delete extends Mutation implements 
Comparable {
 if (timestamp < 0) {
   throw new IllegalArgumentException("Timestamp cannot be negative. ts=" + 
timestamp);
 }
-List list = familyMap.get(family);
-if(list == null) {
-  list = new ArrayList<>(1);
-  familyMap.put(family, list);
-} else if(!list.isEmpty()) {
+List list = getCellList(family);
+if(!list.isEmpty()) {
   list.clear();
 }
 KeyValue kv = new KeyValue(row, family, null, timestamp, 
KeyValue.Type.DeleteFamily);
@@ -236,11 +229,7 @@ public class Delete extends Mutation implements 
Comparable {
* @return this for invocation chaining
*/
   public Delete addFamilyVersion(final byte [] family, final long timestamp) {
-List list = familyMap.get(family);
-if(list == null) {
-  list = new ArrayList<>(1);
-  familyMap.put(family, list);
-}
+List list = getCellList(family);
 list.add(new KeyValue(row, family, null, timestamp,
   KeyValue.Type.DeleteFamilyVersion));
 return this;
@@ -269,11 +258,7 @@ public class Delete extends Mutation implements 
Comparable {
 if (timestamp < 0) {
   throw new IllegalArgumentException("Timestamp cannot be negative. ts=" + 
timestamp);
 }
-List list = familyMap.get(family);
-if (list == null) {
-  list = new ArrayList<>(1);
-  familyMap.put(family, list);
-}
+List list = getCellList(family);
 list.add(new KeyValue(this.row, family, qualifier, timestamp,
 KeyValue.Type.DeleteColumn));
 return this;
@@ -304,11 +289,7 @@ public class Delete extends Mutation implements 
Comparable {
 if (timestamp < 0) {
   throw new IllegalArgumentException("Timestamp cannot be negative. ts=" + 
timestamp);
 }
-List list = familyMap.get(family);
-if(list == null) {
-  list = new ArrayList<>(1);
-  familyMap.put(family, list);
-}
+List list = getCellList(family);
 

[46/50] [abbrv] hbase git commit: HBASE-18573 Update Append and Delete to use Mutation#getCellList(family)

2017-08-17 Thread stack
HBASE-18573 Update Append and Delete to use Mutation#getCellList(family)

Signed-off-by: Jerry He 


Project: http://git-wip-us.apache.org/repos/asf/hbase/repo
Commit: http://git-wip-us.apache.org/repos/asf/hbase/commit/4c3a64db
Tree: http://git-wip-us.apache.org/repos/asf/hbase/tree/4c3a64db
Diff: http://git-wip-us.apache.org/repos/asf/hbase/diff/4c3a64db

Branch: refs/heads/HBASE-14070.HLC
Commit: 4c3a64db13b086ad3d8a6ffa1be8ba2f5a24719c
Parents: 5d2c3dd
Author: Xiang Li 
Authored: Thu Aug 17 00:39:35 2017 +0800
Committer: Jerry He 
Committed: Wed Aug 16 14:50:46 2017 -0700

--
 .../org/apache/hadoop/hbase/client/Append.java  |  9 +++---
 .../org/apache/hadoop/hbase/client/Delete.java  | 31 
 2 files changed, 10 insertions(+), 30 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/hbase/blob/4c3a64db/hbase-client/src/main/java/org/apache/hadoop/hbase/client/Append.java
--
diff --git 
a/hbase-client/src/main/java/org/apache/hadoop/hbase/client/Append.java 
b/hbase-client/src/main/java/org/apache/hadoop/hbase/client/Append.java
index 2bd0860..6947313 100644
--- a/hbase-client/src/main/java/org/apache/hadoop/hbase/client/Append.java
+++ b/hbase-client/src/main/java/org/apache/hadoop/hbase/client/Append.java
@@ -134,11 +134,10 @@ public class Append extends Mutation {
   public Append add(final Cell cell) {
 // Presume it is KeyValue for now.
 byte [] family = CellUtil.cloneFamily(cell);
-List list = this.familyMap.get(family);
-if (list == null) {
-  list  = new ArrayList<>(1);
-  this.familyMap.put(family, list);
-}
+
+// Get cell list for the family
+List list = getCellList(family);
+
 // find where the new entry should be placed in the List
 list.add(cell);
 return this;

http://git-wip-us.apache.org/repos/asf/hbase/blob/4c3a64db/hbase-client/src/main/java/org/apache/hadoop/hbase/client/Delete.java
--
diff --git 
a/hbase-client/src/main/java/org/apache/hadoop/hbase/client/Delete.java 
b/hbase-client/src/main/java/org/apache/hadoop/hbase/client/Delete.java
index bf5241c..66b6cfc 100644
--- a/hbase-client/src/main/java/org/apache/hadoop/hbase/client/Delete.java
+++ b/hbase-client/src/main/java/org/apache/hadoop/hbase/client/Delete.java
@@ -180,11 +180,7 @@ public class Delete extends Mutation implements 
Comparable {
 " doesn't match the original one " +  Bytes.toStringBinary(this.row));
 }
 byte [] family = CellUtil.cloneFamily(kv);
-List list = familyMap.get(family);
-if (list == null) {
-  list = new ArrayList<>(1);
-  familyMap.put(family, list);
-}
+List list = getCellList(family);
 list.add(kv);
 return this;
   }
@@ -216,11 +212,8 @@ public class Delete extends Mutation implements 
Comparable {
 if (timestamp < 0) {
   throw new IllegalArgumentException("Timestamp cannot be negative. ts=" + 
timestamp);
 }
-List list = familyMap.get(family);
-if(list == null) {
-  list = new ArrayList<>(1);
-  familyMap.put(family, list);
-} else if(!list.isEmpty()) {
+List list = getCellList(family);
+if(!list.isEmpty()) {
   list.clear();
 }
 KeyValue kv = new KeyValue(row, family, null, timestamp, 
KeyValue.Type.DeleteFamily);
@@ -236,11 +229,7 @@ public class Delete extends Mutation implements 
Comparable {
* @return this for invocation chaining
*/
   public Delete addFamilyVersion(final byte [] family, final long timestamp) {
-List list = familyMap.get(family);
-if(list == null) {
-  list = new ArrayList<>(1);
-  familyMap.put(family, list);
-}
+List list = getCellList(family);
 list.add(new KeyValue(row, family, null, timestamp,
   KeyValue.Type.DeleteFamilyVersion));
 return this;
@@ -269,11 +258,7 @@ public class Delete extends Mutation implements 
Comparable {
 if (timestamp < 0) {
   throw new IllegalArgumentException("Timestamp cannot be negative. ts=" + 
timestamp);
 }
-List list = familyMap.get(family);
-if (list == null) {
-  list = new ArrayList<>(1);
-  familyMap.put(family, list);
-}
+List list = getCellList(family);
 list.add(new KeyValue(this.row, family, qualifier, timestamp,
 KeyValue.Type.DeleteColumn));
 return this;
@@ -304,11 +289,7 @@ public class Delete extends Mutation implements 
Comparable {
 if (timestamp < 0) {
   throw new IllegalArgumentException("Timestamp cannot be negative. ts=" + 
timestamp);
 }
-List list = familyMap.get(family);
-if(list == null) {
-  list = new ArrayList<>(1);
-  familyMap.put(family, list);
-}
+List list = getCellList(family);
 

hbase git commit: HBASE-18573 Update Append and Delete to use Mutation#getCellList(family)

2017-08-16 Thread jerryjch
Repository: hbase
Updated Branches:
  refs/heads/branch-1.4 255319a0e -> 60f88a970


HBASE-18573 Update Append and Delete to use Mutation#getCellList(family)

Signed-off-by: Jerry He 


Project: http://git-wip-us.apache.org/repos/asf/hbase/repo
Commit: http://git-wip-us.apache.org/repos/asf/hbase/commit/60f88a97
Tree: http://git-wip-us.apache.org/repos/asf/hbase/tree/60f88a97
Diff: http://git-wip-us.apache.org/repos/asf/hbase/diff/60f88a97

Branch: refs/heads/branch-1.4
Commit: 60f88a97084656ad18e4b890d311cb110d4b6fa8
Parents: 255319a
Author: Xiang Li 
Authored: Thu Aug 17 00:39:35 2017 +0800
Committer: Jerry He 
Committed: Wed Aug 16 15:13:43 2017 -0700

--
 .../org/apache/hadoop/hbase/client/Append.java  |  9 +++---
 .../org/apache/hadoop/hbase/client/Delete.java  | 31 
 2 files changed, 10 insertions(+), 30 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/hbase/blob/60f88a97/hbase-client/src/main/java/org/apache/hadoop/hbase/client/Append.java
--
diff --git 
a/hbase-client/src/main/java/org/apache/hadoop/hbase/client/Append.java 
b/hbase-client/src/main/java/org/apache/hadoop/hbase/client/Append.java
index 0741a0d..efc958d 100644
--- a/hbase-client/src/main/java/org/apache/hadoop/hbase/client/Append.java
+++ b/hbase-client/src/main/java/org/apache/hadoop/hbase/client/Append.java
@@ -122,11 +122,10 @@ public class Append extends Mutation {
   public Append add(final Cell cell) {
 // Presume it is KeyValue for now.
 byte [] family = CellUtil.cloneFamily(cell);
-List list = this.familyMap.get(family);
-if (list == null) {
-  list  = new ArrayList();
-  this.familyMap.put(family, list);
-}
+
+// Get cell list for the family
+List list = getCellList(family);
+
 // find where the new entry should be placed in the List
 list.add(cell);
 return this;

http://git-wip-us.apache.org/repos/asf/hbase/blob/60f88a97/hbase-client/src/main/java/org/apache/hadoop/hbase/client/Delete.java
--
diff --git 
a/hbase-client/src/main/java/org/apache/hadoop/hbase/client/Delete.java 
b/hbase-client/src/main/java/org/apache/hadoop/hbase/client/Delete.java
index 8682eae..e45ae59 100644
--- a/hbase-client/src/main/java/org/apache/hadoop/hbase/client/Delete.java
+++ b/hbase-client/src/main/java/org/apache/hadoop/hbase/client/Delete.java
@@ -170,11 +170,7 @@ public class Delete extends Mutation implements 
Comparable {
 " doesn't match the original one " +  Bytes.toStringBinary(this.row));
 }
 byte [] family = CellUtil.cloneFamily(kv);
-List list = familyMap.get(family);
-if (list == null) {
-  list = new ArrayList();
-  familyMap.put(family, list);
-}
+List list = getCellList(family);
 list.add(kv);
 return this;
   }
@@ -236,11 +232,8 @@ public class Delete extends Mutation implements 
Comparable {
 if (timestamp < 0) {
   throw new IllegalArgumentException("Timestamp cannot be negative. ts=" + 
timestamp);
 }
-List list = familyMap.get(family);
-if(list == null) {
-  list = new ArrayList();
-  familyMap.put(family, list);
-} else if(!list.isEmpty()) {
+List list = getCellList(family);
+if(!list.isEmpty()) {
   list.clear();
 }
 KeyValue kv = new KeyValue(row, family, null, timestamp, 
KeyValue.Type.DeleteFamily);
@@ -269,11 +262,7 @@ public class Delete extends Mutation implements 
Comparable {
* @return this for invocation chaining
*/
   public Delete addFamilyVersion(final byte [] family, final long timestamp) {
-List list = familyMap.get(family);
-if(list == null) {
-  list = new ArrayList();
-  familyMap.put(family, list);
-}
+List list = getCellList(family);
 list.add(new KeyValue(row, family, null, timestamp,
   KeyValue.Type.DeleteFamilyVersion));
 return this;
@@ -328,11 +317,7 @@ public class Delete extends Mutation implements 
Comparable {
 if (timestamp < 0) {
   throw new IllegalArgumentException("Timestamp cannot be negative. ts=" + 
timestamp);
 }
-List list = familyMap.get(family);
-if (list == null) {
-  list = new ArrayList();
-  familyMap.put(family, list);
-}
+List list = getCellList(family);
 list.add(new KeyValue(this.row, family, qualifier, timestamp,
 KeyValue.Type.DeleteColumn));
 return this;
@@ -391,11 +376,7 @@ public class Delete extends Mutation implements 
Comparable {
 if (timestamp < 0) {
   throw new IllegalArgumentException("Timestamp cannot be negative. ts=" + 
timestamp);
 }
-List list = familyMap.get(family);
-if(list == null) {
-  list = new ArrayList();
-  

hbase git commit: HBASE-18573 Update Append and Delete to use Mutation#getCellList(family)

2017-08-16 Thread jerryjch
Repository: hbase
Updated Branches:
  refs/heads/branch-1 1f1ab8c87 -> 54aaf6bfb


HBASE-18573 Update Append and Delete to use Mutation#getCellList(family)

Signed-off-by: Jerry He 


Project: http://git-wip-us.apache.org/repos/asf/hbase/repo
Commit: http://git-wip-us.apache.org/repos/asf/hbase/commit/54aaf6bf
Tree: http://git-wip-us.apache.org/repos/asf/hbase/tree/54aaf6bf
Diff: http://git-wip-us.apache.org/repos/asf/hbase/diff/54aaf6bf

Branch: refs/heads/branch-1
Commit: 54aaf6bfb72815c343885f7ec40edbe20e4bc394
Parents: 1f1ab8c
Author: Xiang Li 
Authored: Thu Aug 17 00:39:35 2017 +0800
Committer: Jerry He 
Committed: Wed Aug 16 15:12:56 2017 -0700

--
 .../org/apache/hadoop/hbase/client/Append.java  |  9 +++---
 .../org/apache/hadoop/hbase/client/Delete.java  | 31 
 2 files changed, 10 insertions(+), 30 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/hbase/blob/54aaf6bf/hbase-client/src/main/java/org/apache/hadoop/hbase/client/Append.java
--
diff --git 
a/hbase-client/src/main/java/org/apache/hadoop/hbase/client/Append.java 
b/hbase-client/src/main/java/org/apache/hadoop/hbase/client/Append.java
index 0741a0d..efc958d 100644
--- a/hbase-client/src/main/java/org/apache/hadoop/hbase/client/Append.java
+++ b/hbase-client/src/main/java/org/apache/hadoop/hbase/client/Append.java
@@ -122,11 +122,10 @@ public class Append extends Mutation {
   public Append add(final Cell cell) {
 // Presume it is KeyValue for now.
 byte [] family = CellUtil.cloneFamily(cell);
-List list = this.familyMap.get(family);
-if (list == null) {
-  list  = new ArrayList();
-  this.familyMap.put(family, list);
-}
+
+// Get cell list for the family
+List list = getCellList(family);
+
 // find where the new entry should be placed in the List
 list.add(cell);
 return this;

http://git-wip-us.apache.org/repos/asf/hbase/blob/54aaf6bf/hbase-client/src/main/java/org/apache/hadoop/hbase/client/Delete.java
--
diff --git 
a/hbase-client/src/main/java/org/apache/hadoop/hbase/client/Delete.java 
b/hbase-client/src/main/java/org/apache/hadoop/hbase/client/Delete.java
index 8682eae..e45ae59 100644
--- a/hbase-client/src/main/java/org/apache/hadoop/hbase/client/Delete.java
+++ b/hbase-client/src/main/java/org/apache/hadoop/hbase/client/Delete.java
@@ -170,11 +170,7 @@ public class Delete extends Mutation implements 
Comparable {
 " doesn't match the original one " +  Bytes.toStringBinary(this.row));
 }
 byte [] family = CellUtil.cloneFamily(kv);
-List list = familyMap.get(family);
-if (list == null) {
-  list = new ArrayList();
-  familyMap.put(family, list);
-}
+List list = getCellList(family);
 list.add(kv);
 return this;
   }
@@ -236,11 +232,8 @@ public class Delete extends Mutation implements 
Comparable {
 if (timestamp < 0) {
   throw new IllegalArgumentException("Timestamp cannot be negative. ts=" + 
timestamp);
 }
-List list = familyMap.get(family);
-if(list == null) {
-  list = new ArrayList();
-  familyMap.put(family, list);
-} else if(!list.isEmpty()) {
+List list = getCellList(family);
+if(!list.isEmpty()) {
   list.clear();
 }
 KeyValue kv = new KeyValue(row, family, null, timestamp, 
KeyValue.Type.DeleteFamily);
@@ -269,11 +262,7 @@ public class Delete extends Mutation implements 
Comparable {
* @return this for invocation chaining
*/
   public Delete addFamilyVersion(final byte [] family, final long timestamp) {
-List list = familyMap.get(family);
-if(list == null) {
-  list = new ArrayList();
-  familyMap.put(family, list);
-}
+List list = getCellList(family);
 list.add(new KeyValue(row, family, null, timestamp,
   KeyValue.Type.DeleteFamilyVersion));
 return this;
@@ -328,11 +317,7 @@ public class Delete extends Mutation implements 
Comparable {
 if (timestamp < 0) {
   throw new IllegalArgumentException("Timestamp cannot be negative. ts=" + 
timestamp);
 }
-List list = familyMap.get(family);
-if (list == null) {
-  list = new ArrayList();
-  familyMap.put(family, list);
-}
+List list = getCellList(family);
 list.add(new KeyValue(this.row, family, qualifier, timestamp,
 KeyValue.Type.DeleteColumn));
 return this;
@@ -391,11 +376,7 @@ public class Delete extends Mutation implements 
Comparable {
 if (timestamp < 0) {
   throw new IllegalArgumentException("Timestamp cannot be negative. ts=" + 
timestamp);
 }
-List list = familyMap.get(family);
-if(list == null) {
-  list = new ArrayList();
-  

hbase git commit: HBASE-18573 Update Append and Delete to use Mutation#getCellList(family)

2017-08-16 Thread jerryjch
Repository: hbase
Updated Branches:
  refs/heads/master 5d2c3ddf5 -> 4c3a64db1


HBASE-18573 Update Append and Delete to use Mutation#getCellList(family)

Signed-off-by: Jerry He 


Project: http://git-wip-us.apache.org/repos/asf/hbase/repo
Commit: http://git-wip-us.apache.org/repos/asf/hbase/commit/4c3a64db
Tree: http://git-wip-us.apache.org/repos/asf/hbase/tree/4c3a64db
Diff: http://git-wip-us.apache.org/repos/asf/hbase/diff/4c3a64db

Branch: refs/heads/master
Commit: 4c3a64db13b086ad3d8a6ffa1be8ba2f5a24719c
Parents: 5d2c3dd
Author: Xiang Li 
Authored: Thu Aug 17 00:39:35 2017 +0800
Committer: Jerry He 
Committed: Wed Aug 16 14:50:46 2017 -0700

--
 .../org/apache/hadoop/hbase/client/Append.java  |  9 +++---
 .../org/apache/hadoop/hbase/client/Delete.java  | 31 
 2 files changed, 10 insertions(+), 30 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/hbase/blob/4c3a64db/hbase-client/src/main/java/org/apache/hadoop/hbase/client/Append.java
--
diff --git 
a/hbase-client/src/main/java/org/apache/hadoop/hbase/client/Append.java 
b/hbase-client/src/main/java/org/apache/hadoop/hbase/client/Append.java
index 2bd0860..6947313 100644
--- a/hbase-client/src/main/java/org/apache/hadoop/hbase/client/Append.java
+++ b/hbase-client/src/main/java/org/apache/hadoop/hbase/client/Append.java
@@ -134,11 +134,10 @@ public class Append extends Mutation {
   public Append add(final Cell cell) {
 // Presume it is KeyValue for now.
 byte [] family = CellUtil.cloneFamily(cell);
-List list = this.familyMap.get(family);
-if (list == null) {
-  list  = new ArrayList<>(1);
-  this.familyMap.put(family, list);
-}
+
+// Get cell list for the family
+List list = getCellList(family);
+
 // find where the new entry should be placed in the List
 list.add(cell);
 return this;

http://git-wip-us.apache.org/repos/asf/hbase/blob/4c3a64db/hbase-client/src/main/java/org/apache/hadoop/hbase/client/Delete.java
--
diff --git 
a/hbase-client/src/main/java/org/apache/hadoop/hbase/client/Delete.java 
b/hbase-client/src/main/java/org/apache/hadoop/hbase/client/Delete.java
index bf5241c..66b6cfc 100644
--- a/hbase-client/src/main/java/org/apache/hadoop/hbase/client/Delete.java
+++ b/hbase-client/src/main/java/org/apache/hadoop/hbase/client/Delete.java
@@ -180,11 +180,7 @@ public class Delete extends Mutation implements 
Comparable {
 " doesn't match the original one " +  Bytes.toStringBinary(this.row));
 }
 byte [] family = CellUtil.cloneFamily(kv);
-List list = familyMap.get(family);
-if (list == null) {
-  list = new ArrayList<>(1);
-  familyMap.put(family, list);
-}
+List list = getCellList(family);
 list.add(kv);
 return this;
   }
@@ -216,11 +212,8 @@ public class Delete extends Mutation implements 
Comparable {
 if (timestamp < 0) {
   throw new IllegalArgumentException("Timestamp cannot be negative. ts=" + 
timestamp);
 }
-List list = familyMap.get(family);
-if(list == null) {
-  list = new ArrayList<>(1);
-  familyMap.put(family, list);
-} else if(!list.isEmpty()) {
+List list = getCellList(family);
+if(!list.isEmpty()) {
   list.clear();
 }
 KeyValue kv = new KeyValue(row, family, null, timestamp, 
KeyValue.Type.DeleteFamily);
@@ -236,11 +229,7 @@ public class Delete extends Mutation implements 
Comparable {
* @return this for invocation chaining
*/
   public Delete addFamilyVersion(final byte [] family, final long timestamp) {
-List list = familyMap.get(family);
-if(list == null) {
-  list = new ArrayList<>(1);
-  familyMap.put(family, list);
-}
+List list = getCellList(family);
 list.add(new KeyValue(row, family, null, timestamp,
   KeyValue.Type.DeleteFamilyVersion));
 return this;
@@ -269,11 +258,7 @@ public class Delete extends Mutation implements 
Comparable {
 if (timestamp < 0) {
   throw new IllegalArgumentException("Timestamp cannot be negative. ts=" + 
timestamp);
 }
-List list = familyMap.get(family);
-if (list == null) {
-  list = new ArrayList<>(1);
-  familyMap.put(family, list);
-}
+List list = getCellList(family);
 list.add(new KeyValue(this.row, family, qualifier, timestamp,
 KeyValue.Type.DeleteColumn));
 return this;
@@ -304,11 +289,7 @@ public class Delete extends Mutation implements 
Comparable {
 if (timestamp < 0) {
   throw new IllegalArgumentException("Timestamp cannot be negative. ts=" + 
timestamp);
 }
-List list = familyMap.get(family);
-if(list == null) {
-  list = new ArrayList<>(1);
-  

hbase git commit: HBASE-18573 Update Append and Delete to use Mutation#getCellList(family)

2017-08-16 Thread jerryjch
Repository: hbase
Updated Branches:
  refs/heads/branch-2 7149f9997 -> 4057552ed


HBASE-18573 Update Append and Delete to use Mutation#getCellList(family)

Signed-off-by: Jerry He 


Project: http://git-wip-us.apache.org/repos/asf/hbase/repo
Commit: http://git-wip-us.apache.org/repos/asf/hbase/commit/4057552e
Tree: http://git-wip-us.apache.org/repos/asf/hbase/tree/4057552e
Diff: http://git-wip-us.apache.org/repos/asf/hbase/diff/4057552e

Branch: refs/heads/branch-2
Commit: 4057552ed6192c7b2e61035636dc8c7a897917c6
Parents: 7149f99
Author: Xiang Li 
Authored: Thu Aug 17 00:39:35 2017 +0800
Committer: Jerry He 
Committed: Wed Aug 16 14:45:33 2017 -0700

--
 .../org/apache/hadoop/hbase/client/Append.java  |  9 +++---
 .../org/apache/hadoop/hbase/client/Delete.java  | 31 
 2 files changed, 10 insertions(+), 30 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/hbase/blob/4057552e/hbase-client/src/main/java/org/apache/hadoop/hbase/client/Append.java
--
diff --git 
a/hbase-client/src/main/java/org/apache/hadoop/hbase/client/Append.java 
b/hbase-client/src/main/java/org/apache/hadoop/hbase/client/Append.java
index 2bd0860..6947313 100644
--- a/hbase-client/src/main/java/org/apache/hadoop/hbase/client/Append.java
+++ b/hbase-client/src/main/java/org/apache/hadoop/hbase/client/Append.java
@@ -134,11 +134,10 @@ public class Append extends Mutation {
   public Append add(final Cell cell) {
 // Presume it is KeyValue for now.
 byte [] family = CellUtil.cloneFamily(cell);
-List list = this.familyMap.get(family);
-if (list == null) {
-  list  = new ArrayList<>(1);
-  this.familyMap.put(family, list);
-}
+
+// Get cell list for the family
+List list = getCellList(family);
+
 // find where the new entry should be placed in the List
 list.add(cell);
 return this;

http://git-wip-us.apache.org/repos/asf/hbase/blob/4057552e/hbase-client/src/main/java/org/apache/hadoop/hbase/client/Delete.java
--
diff --git 
a/hbase-client/src/main/java/org/apache/hadoop/hbase/client/Delete.java 
b/hbase-client/src/main/java/org/apache/hadoop/hbase/client/Delete.java
index bf5241c..66b6cfc 100644
--- a/hbase-client/src/main/java/org/apache/hadoop/hbase/client/Delete.java
+++ b/hbase-client/src/main/java/org/apache/hadoop/hbase/client/Delete.java
@@ -180,11 +180,7 @@ public class Delete extends Mutation implements 
Comparable {
 " doesn't match the original one " +  Bytes.toStringBinary(this.row));
 }
 byte [] family = CellUtil.cloneFamily(kv);
-List list = familyMap.get(family);
-if (list == null) {
-  list = new ArrayList<>(1);
-  familyMap.put(family, list);
-}
+List list = getCellList(family);
 list.add(kv);
 return this;
   }
@@ -216,11 +212,8 @@ public class Delete extends Mutation implements 
Comparable {
 if (timestamp < 0) {
   throw new IllegalArgumentException("Timestamp cannot be negative. ts=" + 
timestamp);
 }
-List list = familyMap.get(family);
-if(list == null) {
-  list = new ArrayList<>(1);
-  familyMap.put(family, list);
-} else if(!list.isEmpty()) {
+List list = getCellList(family);
+if(!list.isEmpty()) {
   list.clear();
 }
 KeyValue kv = new KeyValue(row, family, null, timestamp, 
KeyValue.Type.DeleteFamily);
@@ -236,11 +229,7 @@ public class Delete extends Mutation implements 
Comparable {
* @return this for invocation chaining
*/
   public Delete addFamilyVersion(final byte [] family, final long timestamp) {
-List list = familyMap.get(family);
-if(list == null) {
-  list = new ArrayList<>(1);
-  familyMap.put(family, list);
-}
+List list = getCellList(family);
 list.add(new KeyValue(row, family, null, timestamp,
   KeyValue.Type.DeleteFamilyVersion));
 return this;
@@ -269,11 +258,7 @@ public class Delete extends Mutation implements 
Comparable {
 if (timestamp < 0) {
   throw new IllegalArgumentException("Timestamp cannot be negative. ts=" + 
timestamp);
 }
-List list = familyMap.get(family);
-if (list == null) {
-  list = new ArrayList<>(1);
-  familyMap.put(family, list);
-}
+List list = getCellList(family);
 list.add(new KeyValue(this.row, family, qualifier, timestamp,
 KeyValue.Type.DeleteColumn));
 return this;
@@ -304,11 +289,7 @@ public class Delete extends Mutation implements 
Comparable {
 if (timestamp < 0) {
   throw new IllegalArgumentException("Timestamp cannot be negative. ts=" + 
timestamp);
 }
-List list = familyMap.get(family);
-if(list == null) {
-  list = new ArrayList<>(1);
-