[jira] [Updated] (HBASE-18986) Remove unnecessary null check after CellUtil.cloneQualifier()

2017-10-15 Thread Jerry He (JIRA)

 [ 
https://issues.apache.org/jira/browse/HBASE-18986?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Jerry He updated HBASE-18986:
-
   Resolution: Fixed
 Hadoop Flags: Reviewed
Fix Version/s: 2.0.0-alpha-4
   3.0.0
   Status: Resolved  (was: Patch Available)

+1

> Remove unnecessary null check after CellUtil.cloneQualifier()
> -
>
> Key: HBASE-18986
> URL: https://issues.apache.org/jira/browse/HBASE-18986
> Project: HBase
>  Issue Type: Improvement
>Reporter: Xiang Li
>Assignee: Xiang Li
>Priority: Minor
> Fix For: 3.0.0, 2.0.0-alpha-4
>
> Attachments: HBASE-18986.master.000.patch
>
>
> In master branch,
> {code:title=hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HRegion.java|borderStyle=solid}
> // From line 2858
> public void prepareDeleteTimestamps(Mutation mutation, Map List> familyMap,
>   byte[] byteNow) throws IOException {
> for (Map.Entry e : familyMap.entrySet()) {
>   // ...
>   for (int i=0; i < listSize; i++) {
> // ...
> if (cell.getTimestamp() == HConstants.LATEST_TIMESTAMP && 
> CellUtil.isDeleteType(cell)) {
>   byte[] qual = CellUtil.cloneQualifier(cell);
>   if (qual == null) qual = HConstants.EMPTY_BYTE_ARRAY; // <-- here
>   ...
> {code}
> Might {{if (qual == null) qual = HConstants.EMPTY_BYTE_ARRAY;}} be removed?
> Could it be null after CellUtil.cloneQualifier()?
> {code:title=hbase-common/src/main/java/org/apache/hadoop/hbase/CellUtil.java|borderStyle=solid}
> public static byte[] cloneQualifier(Cell cell){
>   byte[] output = new byte[cell.getQualifierLength()];
>   copyQualifierTo(cell, output, 0);
>   return output;
> }
> {code}



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)


[jira] [Updated] (HBASE-18986) Remove unnecessary null check after CellUtil.cloneQualifier()

2017-10-15 Thread Xiang Li (JIRA)

 [ 
https://issues.apache.org/jira/browse/HBASE-18986?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Xiang Li updated HBASE-18986:
-
Attachment: (was: HBASE-18986.master.000.patch)

> Remove unnecessary null check after CellUtil.cloneQualifier()
> -
>
> Key: HBASE-18986
> URL: https://issues.apache.org/jira/browse/HBASE-18986
> Project: HBase
>  Issue Type: Improvement
>Reporter: Xiang Li
>Assignee: Xiang Li
>Priority: Minor
> Attachments: HBASE-18986.master.000.patch
>
>
> In master branch,
> {code:title=hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HRegion.java|borderStyle=solid}
> // From line 2858
> public void prepareDeleteTimestamps(Mutation mutation, Map List> familyMap,
>   byte[] byteNow) throws IOException {
> for (Map.Entry e : familyMap.entrySet()) {
>   // ...
>   for (int i=0; i < listSize; i++) {
> // ...
> if (cell.getTimestamp() == HConstants.LATEST_TIMESTAMP && 
> CellUtil.isDeleteType(cell)) {
>   byte[] qual = CellUtil.cloneQualifier(cell);
>   if (qual == null) qual = HConstants.EMPTY_BYTE_ARRAY; // <-- here
>   ...
> {code}
> Might {{if (qual == null) qual = HConstants.EMPTY_BYTE_ARRAY;}} be removed?
> Could it be null after CellUtil.cloneQualifier()?
> {code:title=hbase-common/src/main/java/org/apache/hadoop/hbase/CellUtil.java|borderStyle=solid}
> public static byte[] cloneQualifier(Cell cell){
>   byte[] output = new byte[cell.getQualifierLength()];
>   copyQualifierTo(cell, output, 0);
>   return output;
> }
> {code}



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)


[jira] [Updated] (HBASE-18986) Remove unnecessary null check after CellUtil.cloneQualifier()

2017-10-13 Thread Jerry He (JIRA)

 [ 
https://issues.apache.org/jira/browse/HBASE-18986?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Jerry He updated HBASE-18986:
-
Attachment: HBASE-18986.master.000.patch

Yup, after the clone, we will get a byte[0] -- EMPTY_BYTE_ARRAY anyway if no 
qual.
Retry.

> Remove unnecessary null check after CellUtil.cloneQualifier()
> -
>
> Key: HBASE-18986
> URL: https://issues.apache.org/jira/browse/HBASE-18986
> Project: HBase
>  Issue Type: Improvement
>Reporter: Xiang Li
>Assignee: Xiang Li
>Priority: Minor
> Attachments: HBASE-18986.master.000.patch, 
> HBASE-18986.master.000.patch
>
>
> In master branch,
> {code:title=hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HRegion.java|borderStyle=solid}
> // From line 2858
> public void prepareDeleteTimestamps(Mutation mutation, Map List> familyMap,
>   byte[] byteNow) throws IOException {
> for (Map.Entry e : familyMap.entrySet()) {
>   // ...
>   for (int i=0; i < listSize; i++) {
> // ...
> if (cell.getTimestamp() == HConstants.LATEST_TIMESTAMP && 
> CellUtil.isDeleteType(cell)) {
>   byte[] qual = CellUtil.cloneQualifier(cell);
>   if (qual == null) qual = HConstants.EMPTY_BYTE_ARRAY; // <-- here
>   ...
> {code}
> Might {{if (qual == null) qual = HConstants.EMPTY_BYTE_ARRAY;}} be removed?
> Could it be null after CellUtil.cloneQualifier()?
> {code:title=hbase-common/src/main/java/org/apache/hadoop/hbase/CellUtil.java|borderStyle=solid}
> public static byte[] cloneQualifier(Cell cell){
>   byte[] output = new byte[cell.getQualifierLength()];
>   copyQualifierTo(cell, output, 0);
>   return output;
> }
> {code}



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)


[jira] [Updated] (HBASE-18986) Remove unnecessary null check after CellUtil.cloneQualifier()

2017-10-13 Thread Xiang Li (JIRA)

 [ 
https://issues.apache.org/jira/browse/HBASE-18986?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Xiang Li updated HBASE-18986:
-
Status: Patch Available  (was: Open)

> Remove unnecessary null check after CellUtil.cloneQualifier()
> -
>
> Key: HBASE-18986
> URL: https://issues.apache.org/jira/browse/HBASE-18986
> Project: HBase
>  Issue Type: Improvement
>Reporter: Xiang Li
>Assignee: Xiang Li
>Priority: Minor
> Attachments: HBASE-18986.master.000.patch
>
>
> In master branch,
> {code:title=hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HRegion.java|borderStyle=solid}
> // From line 2858
> public void prepareDeleteTimestamps(Mutation mutation, Map List> familyMap,
>   byte[] byteNow) throws IOException {
> for (Map.Entry e : familyMap.entrySet()) {
>   // ...
>   for (int i=0; i < listSize; i++) {
> // ...
> if (cell.getTimestamp() == HConstants.LATEST_TIMESTAMP && 
> CellUtil.isDeleteType(cell)) {
>   byte[] qual = CellUtil.cloneQualifier(cell);
>   if (qual == null) qual = HConstants.EMPTY_BYTE_ARRAY; // <-- here
>   ...
> {code}
> Might {{if (qual == null) qual = HConstants.EMPTY_BYTE_ARRAY;}} be removed?
> Could it be null after CellUtil.cloneQualifier()?
> {code:title=hbase-common/src/main/java/org/apache/hadoop/hbase/CellUtil.java|borderStyle=solid}
> public static byte[] cloneQualifier(Cell cell){
>   byte[] output = new byte[cell.getQualifierLength()];
>   copyQualifierTo(cell, output, 0);
>   return output;
> }
> {code}



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)


[jira] [Updated] (HBASE-18986) Remove unnecessary null check after CellUtil.cloneQualifier()

2017-10-13 Thread Xiang Li (JIRA)

 [ 
https://issues.apache.org/jira/browse/HBASE-18986?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Xiang Li updated HBASE-18986:
-
Status: Open  (was: Patch Available)

> Remove unnecessary null check after CellUtil.cloneQualifier()
> -
>
> Key: HBASE-18986
> URL: https://issues.apache.org/jira/browse/HBASE-18986
> Project: HBase
>  Issue Type: Improvement
>Reporter: Xiang Li
>Assignee: Xiang Li
>Priority: Minor
> Attachments: HBASE-18986.master.000.patch
>
>
> In master branch,
> {code:title=hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HRegion.java|borderStyle=solid}
> // From line 2858
> public void prepareDeleteTimestamps(Mutation mutation, Map List> familyMap,
>   byte[] byteNow) throws IOException {
> for (Map.Entry e : familyMap.entrySet()) {
>   // ...
>   for (int i=0; i < listSize; i++) {
> // ...
> if (cell.getTimestamp() == HConstants.LATEST_TIMESTAMP && 
> CellUtil.isDeleteType(cell)) {
>   byte[] qual = CellUtil.cloneQualifier(cell);
>   if (qual == null) qual = HConstants.EMPTY_BYTE_ARRAY; // <-- here
>   ...
> {code}
> Might {{if (qual == null) qual = HConstants.EMPTY_BYTE_ARRAY;}} be removed?
> Could it be null after CellUtil.cloneQualifier()?
> {code:title=hbase-common/src/main/java/org/apache/hadoop/hbase/CellUtil.java|borderStyle=solid}
> public static byte[] cloneQualifier(Cell cell){
>   byte[] output = new byte[cell.getQualifierLength()];
>   copyQualifierTo(cell, output, 0);
>   return output;
> }
> {code}



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)


[jira] [Updated] (HBASE-18986) Remove unnecessary null check after CellUtil.cloneQualifier()

2017-10-12 Thread Xiang Li (JIRA)

 [ 
https://issues.apache.org/jira/browse/HBASE-18986?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Xiang Li updated HBASE-18986:
-
Status: Patch Available  (was: Open)

> Remove unnecessary null check after CellUtil.cloneQualifier()
> -
>
> Key: HBASE-18986
> URL: https://issues.apache.org/jira/browse/HBASE-18986
> Project: HBase
>  Issue Type: Improvement
>Reporter: Xiang Li
>Assignee: Xiang Li
>Priority: Minor
> Attachments: HBASE-18986.master.000.patch
>
>
> In master branch,
> {code:title=hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HRegion.java|borderStyle=solid}
> // From line 2858
> public void prepareDeleteTimestamps(Mutation mutation, Map List> familyMap,
>   byte[] byteNow) throws IOException {
> for (Map.Entry e : familyMap.entrySet()) {
>   // ...
>   for (int i=0; i < listSize; i++) {
> // ...
> if (cell.getTimestamp() == HConstants.LATEST_TIMESTAMP && 
> CellUtil.isDeleteType(cell)) {
>   byte[] qual = CellUtil.cloneQualifier(cell);
>   if (qual == null) qual = HConstants.EMPTY_BYTE_ARRAY; // <-- here
>   ...
> {code}
> Might {{if (qual == null) qual = HConstants.EMPTY_BYTE_ARRAY;}} be removed?
> Could it be null after CellUtil.cloneQualifier()?
> {code:title=hbase-common/src/main/java/org/apache/hadoop/hbase/CellUtil.java|borderStyle=solid}
> public static byte[] cloneQualifier(Cell cell){
>   byte[] output = new byte[cell.getQualifierLength()];
>   copyQualifierTo(cell, output, 0);
>   return output;
> }
> {code}



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)


[jira] [Updated] (HBASE-18986) Remove unnecessary null check after CellUtil.cloneQualifier()

2017-10-12 Thread Xiang Li (JIRA)

 [ 
https://issues.apache.org/jira/browse/HBASE-18986?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Xiang Li updated HBASE-18986:
-
Status: Open  (was: Patch Available)

> Remove unnecessary null check after CellUtil.cloneQualifier()
> -
>
> Key: HBASE-18986
> URL: https://issues.apache.org/jira/browse/HBASE-18986
> Project: HBase
>  Issue Type: Improvement
>Reporter: Xiang Li
>Assignee: Xiang Li
>Priority: Minor
> Attachments: HBASE-18986.master.000.patch
>
>
> In master branch,
> {code:title=hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HRegion.java|borderStyle=solid}
> // From line 2858
> public void prepareDeleteTimestamps(Mutation mutation, Map List> familyMap,
>   byte[] byteNow) throws IOException {
> for (Map.Entry e : familyMap.entrySet()) {
>   // ...
>   for (int i=0; i < listSize; i++) {
> // ...
> if (cell.getTimestamp() == HConstants.LATEST_TIMESTAMP && 
> CellUtil.isDeleteType(cell)) {
>   byte[] qual = CellUtil.cloneQualifier(cell);
>   if (qual == null) qual = HConstants.EMPTY_BYTE_ARRAY; // <-- here
>   ...
> {code}
> Might {{if (qual == null) qual = HConstants.EMPTY_BYTE_ARRAY;}} be removed?
> Could it be null after CellUtil.cloneQualifier()?
> {code:title=hbase-common/src/main/java/org/apache/hadoop/hbase/CellUtil.java|borderStyle=solid}
> public static byte[] cloneQualifier(Cell cell){
>   byte[] output = new byte[cell.getQualifierLength()];
>   copyQualifierTo(cell, output, 0);
>   return output;
> }
> {code}



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)


[jira] [Updated] (HBASE-18986) Remove unnecessary null check after CellUtil.cloneQualifier()

2017-10-11 Thread Xiang Li (JIRA)

 [ 
https://issues.apache.org/jira/browse/HBASE-18986?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Xiang Li updated HBASE-18986:
-
Status: Open  (was: Patch Available)

> Remove unnecessary null check after CellUtil.cloneQualifier()
> -
>
> Key: HBASE-18986
> URL: https://issues.apache.org/jira/browse/HBASE-18986
> Project: HBase
>  Issue Type: Improvement
>Reporter: Xiang Li
>Assignee: Xiang Li
>Priority: Minor
> Attachments: HBASE-18986.master.000.patch
>
>
> In master branch,
> {code:title=hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HRegion.java|borderStyle=solid}
> // From line 2858
> public void prepareDeleteTimestamps(Mutation mutation, Map List> familyMap,
>   byte[] byteNow) throws IOException {
> for (Map.Entry e : familyMap.entrySet()) {
>   // ...
>   for (int i=0; i < listSize; i++) {
> // ...
> if (cell.getTimestamp() == HConstants.LATEST_TIMESTAMP && 
> CellUtil.isDeleteType(cell)) {
>   byte[] qual = CellUtil.cloneQualifier(cell);
>   if (qual == null) qual = HConstants.EMPTY_BYTE_ARRAY; // <-- here
>   ...
> {code}
> Might {{if (qual == null) qual = HConstants.EMPTY_BYTE_ARRAY;}} be removed?
> Could it be null after CellUtil.cloneQualifier()?
> {code:title=hbase-common/src/main/java/org/apache/hadoop/hbase/CellUtil.java|borderStyle=solid}
> public static byte[] cloneQualifier(Cell cell){
>   byte[] output = new byte[cell.getQualifierLength()];
>   copyQualifierTo(cell, output, 0);
>   return output;
> }
> {code}



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)


[jira] [Updated] (HBASE-18986) Remove unnecessary null check after CellUtil.cloneQualifier()

2017-10-11 Thread Xiang Li (JIRA)

 [ 
https://issues.apache.org/jira/browse/HBASE-18986?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Xiang Li updated HBASE-18986:
-
Status: Patch Available  (was: Open)

> Remove unnecessary null check after CellUtil.cloneQualifier()
> -
>
> Key: HBASE-18986
> URL: https://issues.apache.org/jira/browse/HBASE-18986
> Project: HBase
>  Issue Type: Improvement
>Reporter: Xiang Li
>Assignee: Xiang Li
>Priority: Minor
> Attachments: HBASE-18986.master.000.patch
>
>
> In master branch,
> {code:title=hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HRegion.java|borderStyle=solid}
> // From line 2858
> public void prepareDeleteTimestamps(Mutation mutation, Map List> familyMap,
>   byte[] byteNow) throws IOException {
> for (Map.Entry e : familyMap.entrySet()) {
>   // ...
>   for (int i=0; i < listSize; i++) {
> // ...
> if (cell.getTimestamp() == HConstants.LATEST_TIMESTAMP && 
> CellUtil.isDeleteType(cell)) {
>   byte[] qual = CellUtil.cloneQualifier(cell);
>   if (qual == null) qual = HConstants.EMPTY_BYTE_ARRAY; // <-- here
>   ...
> {code}
> Might {{if (qual == null) qual = HConstants.EMPTY_BYTE_ARRAY;}} be removed?
> Could it be null after CellUtil.cloneQualifier()?
> {code:title=hbase-common/src/main/java/org/apache/hadoop/hbase/CellUtil.java|borderStyle=solid}
> public static byte[] cloneQualifier(Cell cell){
>   byte[] output = new byte[cell.getQualifierLength()];
>   copyQualifierTo(cell, output, 0);
>   return output;
> }
> {code}



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)


[jira] [Updated] (HBASE-18986) Remove unnecessary null check after CellUtil.cloneQualifier()

2017-10-11 Thread Xiang Li (JIRA)

 [ 
https://issues.apache.org/jira/browse/HBASE-18986?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Xiang Li updated HBASE-18986:
-
Status: Open  (was: Patch Available)

> Remove unnecessary null check after CellUtil.cloneQualifier()
> -
>
> Key: HBASE-18986
> URL: https://issues.apache.org/jira/browse/HBASE-18986
> Project: HBase
>  Issue Type: Improvement
>Reporter: Xiang Li
>Assignee: Xiang Li
>Priority: Minor
> Attachments: HBASE-18986.master.000.patch
>
>
> In master branch,
> {code:title=hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HRegion.java|borderStyle=solid}
> // From line 2858
> public void prepareDeleteTimestamps(Mutation mutation, Map List> familyMap,
>   byte[] byteNow) throws IOException {
> for (Map.Entry e : familyMap.entrySet()) {
>   // ...
>   for (int i=0; i < listSize; i++) {
> // ...
> if (cell.getTimestamp() == HConstants.LATEST_TIMESTAMP && 
> CellUtil.isDeleteType(cell)) {
>   byte[] qual = CellUtil.cloneQualifier(cell);
>   if (qual == null) qual = HConstants.EMPTY_BYTE_ARRAY; // <-- here
>   ...
> {code}
> Might {{if (qual == null) qual = HConstants.EMPTY_BYTE_ARRAY;}} be removed?
> Could it be null after CellUtil.cloneQualifier()?
> {code:title=hbase-common/src/main/java/org/apache/hadoop/hbase/CellUtil.java|borderStyle=solid}
> public static byte[] cloneQualifier(Cell cell){
>   byte[] output = new byte[cell.getQualifierLength()];
>   copyQualifierTo(cell, output, 0);
>   return output;
> }
> {code}



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)


[jira] [Updated] (HBASE-18986) Remove unnecessary null check after CellUtil.cloneQualifier()

2017-10-11 Thread Xiang Li (JIRA)

 [ 
https://issues.apache.org/jira/browse/HBASE-18986?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Xiang Li updated HBASE-18986:
-
Status: Patch Available  (was: Open)

> Remove unnecessary null check after CellUtil.cloneQualifier()
> -
>
> Key: HBASE-18986
> URL: https://issues.apache.org/jira/browse/HBASE-18986
> Project: HBase
>  Issue Type: Improvement
>Reporter: Xiang Li
>Assignee: Xiang Li
>Priority: Minor
> Attachments: HBASE-18986.master.000.patch
>
>
> In master branch,
> {code:title=hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HRegion.java|borderStyle=solid}
> // From line 2858
> public void prepareDeleteTimestamps(Mutation mutation, Map List> familyMap,
>   byte[] byteNow) throws IOException {
> for (Map.Entry e : familyMap.entrySet()) {
>   // ...
>   for (int i=0; i < listSize; i++) {
> // ...
> if (cell.getTimestamp() == HConstants.LATEST_TIMESTAMP && 
> CellUtil.isDeleteType(cell)) {
>   byte[] qual = CellUtil.cloneQualifier(cell);
>   if (qual == null) qual = HConstants.EMPTY_BYTE_ARRAY; // <-- here
>   ...
> {code}
> Might {{if (qual == null) qual = HConstants.EMPTY_BYTE_ARRAY;}} be removed?
> Could it be null after CellUtil.cloneQualifier()?
> {code:title=hbase-common/src/main/java/org/apache/hadoop/hbase/CellUtil.java|borderStyle=solid}
> public static byte[] cloneQualifier(Cell cell){
>   byte[] output = new byte[cell.getQualifierLength()];
>   copyQualifierTo(cell, output, 0);
>   return output;
> }
> {code}



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)


[jira] [Updated] (HBASE-18986) Remove unnecessary null check after CellUtil.cloneQualifier()

2017-10-11 Thread Xiang Li (JIRA)

 [ 
https://issues.apache.org/jira/browse/HBASE-18986?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Xiang Li updated HBASE-18986:
-
Status: Patch Available  (was: Open)

> Remove unnecessary null check after CellUtil.cloneQualifier()
> -
>
> Key: HBASE-18986
> URL: https://issues.apache.org/jira/browse/HBASE-18986
> Project: HBase
>  Issue Type: Improvement
>Reporter: Xiang Li
>Assignee: Xiang Li
>Priority: Minor
> Attachments: HBASE-18986.master.000.patch
>
>
> In master branch,
> {code:title=hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HRegion.java|borderStyle=solid}
> // From line 2858
> public void prepareDeleteTimestamps(Mutation mutation, Map List> familyMap,
>   byte[] byteNow) throws IOException {
> for (Map.Entry e : familyMap.entrySet()) {
>   // ...
>   for (int i=0; i < listSize; i++) {
> // ...
> if (cell.getTimestamp() == HConstants.LATEST_TIMESTAMP && 
> CellUtil.isDeleteType(cell)) {
>   byte[] qual = CellUtil.cloneQualifier(cell);
>   if (qual == null) qual = HConstants.EMPTY_BYTE_ARRAY; // <-- here
>   ...
> {code}
> Might {{if (qual == null) qual = HConstants.EMPTY_BYTE_ARRAY;}} be removed?
> Could it be null after CellUtil.cloneQualifier()?
> {code:title=hbase-common/src/main/java/org/apache/hadoop/hbase/CellUtil.java|borderStyle=solid}
> public static byte[] cloneQualifier(Cell cell){
>   byte[] output = new byte[cell.getQualifierLength()];
>   copyQualifierTo(cell, output, 0);
>   return output;
> }
> {code}



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)


[jira] [Updated] (HBASE-18986) Remove unnecessary null check after CellUtil.cloneQualifier()

2017-10-11 Thread Xiang Li (JIRA)

 [ 
https://issues.apache.org/jira/browse/HBASE-18986?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Xiang Li updated HBASE-18986:
-
Attachment: HBASE-18986.master.000.patch

> Remove unnecessary null check after CellUtil.cloneQualifier()
> -
>
> Key: HBASE-18986
> URL: https://issues.apache.org/jira/browse/HBASE-18986
> Project: HBase
>  Issue Type: Improvement
>Reporter: Xiang Li
>Assignee: Xiang Li
>Priority: Minor
> Attachments: HBASE-18986.master.000.patch
>
>
> In master branch,
> {code:title=hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HRegion.java|borderStyle=solid}
> // From line 2858
> public void prepareDeleteTimestamps(Mutation mutation, Map List> familyMap,
>   byte[] byteNow) throws IOException {
> for (Map.Entry e : familyMap.entrySet()) {
>   // ...
>   for (int i=0; i < listSize; i++) {
> // ...
> if (cell.getTimestamp() == HConstants.LATEST_TIMESTAMP && 
> CellUtil.isDeleteType(cell)) {
>   byte[] qual = CellUtil.cloneQualifier(cell);
>   if (qual == null) qual = HConstants.EMPTY_BYTE_ARRAY; // <-- here
>   ...
> {code}
> Might {{if (qual == null) qual = HConstants.EMPTY_BYTE_ARRAY;}} be removed?
> Could it be null after CellUtil.cloneQualifier()?
> {code:title=hbase-common/src/main/java/org/apache/hadoop/hbase/CellUtil.java|borderStyle=solid}
> public static byte[] cloneQualifier(Cell cell){
>   byte[] output = new byte[cell.getQualifierLength()];
>   copyQualifierTo(cell, output, 0);
>   return output;
> }
> {code}



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)


[jira] [Updated] (HBASE-18986) Remove unnecessary null check after CellUtil.cloneQualifier()

2017-10-11 Thread Xiang Li (JIRA)

 [ 
https://issues.apache.org/jira/browse/HBASE-18986?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Xiang Li updated HBASE-18986:
-
Description: 
In master branch,
{code:title=hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HRegion.java|borderStyle=solid}
// From line 2858
public void prepareDeleteTimestamps(Mutation mutation, Map 
familyMap,
  byte[] byteNow) throws IOException {
for (Map.Entry e : familyMap.entrySet()) {
  // ...
  for (int i=0; i < listSize; i++) {
// ...
if (cell.getTimestamp() == HConstants.LATEST_TIMESTAMP && 
CellUtil.isDeleteType(cell)) {
  byte[] qual = CellUtil.cloneQualifier(cell);
  if (qual == null) qual = HConstants.EMPTY_BYTE_ARRAY; // <-- here
  ...
{code}

Might {{if (qual == null) qual = HConstants.EMPTY_BYTE_ARRAY;}} be removed?
Could it be null after CellUtil.cloneQualifier()?
{code:title=hbase-common/src/main/java/org/apache/hadoop/hbase/CellUtil.java|borderStyle=solid}
public static byte[] cloneQualifier(Cell cell){
  byte[] output = new byte[cell.getQualifierLength()];
  copyQualifierTo(cell, output, 0);
  return output;
}
{code}

  was:
In master branch,
{code:title=hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HRegion.java|borderStyle=solid}
// From line 2858
public void prepareDeleteTimestamps(Mutation mutation, Map 
familyMap,
  byte[] byteNow) throws IOException {
for (Map.Entry e : familyMap.entrySet()) {
  // ...
  for (int i=0; i < listSize; i++) {
// ...
if (cell.getTimestamp() == HConstants.LATEST_TIMESTAMP && 
CellUtil.isDeleteType(cell)) {
  byte[] qual = CellUtil.cloneQualifier(cell);
  if (qual == null) qual = HConstants.EMPTY_BYTE_ARRAY; // <-- here
  ...
{code}

Might {{if (qual == null) qual = HConstants.EMPTY_BYTE_ARRAY;}} be removed? 
Could it be null after CellUtil.cloneQualifier()
{code:title=hbase-common/src/main/java/org/apache/hadoop/hbase/CellUtil.java|borderStyle=solid}
public static byte[] cloneQualifier(Cell cell){
  byte[] output = new byte[cell.getQualifierLength()];
  copyQualifierTo(cell, output, 0);
  return output;
}
{code}


> Remove unnecessary null check after CellUtil.cloneQualifier()
> -
>
> Key: HBASE-18986
> URL: https://issues.apache.org/jira/browse/HBASE-18986
> Project: HBase
>  Issue Type: Improvement
>Reporter: Xiang Li
>Assignee: Xiang Li
>Priority: Minor
>
> In master branch,
> {code:title=hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HRegion.java|borderStyle=solid}
> // From line 2858
> public void prepareDeleteTimestamps(Mutation mutation, Map List> familyMap,
>   byte[] byteNow) throws IOException {
> for (Map.Entry e : familyMap.entrySet()) {
>   // ...
>   for (int i=0; i < listSize; i++) {
> // ...
> if (cell.getTimestamp() == HConstants.LATEST_TIMESTAMP && 
> CellUtil.isDeleteType(cell)) {
>   byte[] qual = CellUtil.cloneQualifier(cell);
>   if (qual == null) qual = HConstants.EMPTY_BYTE_ARRAY; // <-- here
>   ...
> {code}
> Might {{if (qual == null) qual = HConstants.EMPTY_BYTE_ARRAY;}} be removed?
> Could it be null after CellUtil.cloneQualifier()?
> {code:title=hbase-common/src/main/java/org/apache/hadoop/hbase/CellUtil.java|borderStyle=solid}
> public static byte[] cloneQualifier(Cell cell){
>   byte[] output = new byte[cell.getQualifierLength()];
>   copyQualifierTo(cell, output, 0);
>   return output;
> }
> {code}



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)


[jira] [Updated] (HBASE-18986) Remove unnecessary null check after CellUtil.cloneQualifier()

2017-10-11 Thread Xiang Li (JIRA)

 [ 
https://issues.apache.org/jira/browse/HBASE-18986?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Xiang Li updated HBASE-18986:
-
Description: 
In master branch,
{code:title=hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HRegion.java|borderStyle=solid}
// From line 2858
public void prepareDeleteTimestamps(Mutation mutation, Map 
familyMap,
  byte[] byteNow) throws IOException {
for (Map.Entry e : familyMap.entrySet()) {
  // ...
  for (int i=0; i < listSize; i++) {
// ...
if (cell.getTimestamp() == HConstants.LATEST_TIMESTAMP && 
CellUtil.isDeleteType(cell)) {
  byte[] qual = CellUtil.cloneQualifier(cell);
  if (qual == null) qual = HConstants.EMPTY_BYTE_ARRAY; // <-- here
  ...
{code}

Might {{if (qual == null) qual = HConstants.EMPTY_BYTE_ARRAY;}} be removed? 
Could it be null after CellUtil.cloneQualifier()
{code:title=hbase-common/src/main/java/org/apache/hadoop/hbase/CellUtil.java|borderStyle=solid}
public static byte[] cloneQualifier(Cell cell){
  byte[] output = new byte[cell.getQualifierLength()];
  copyQualifierTo(cell, output, 0);
  return output;
}



  was:
In master branch,
{code:title=hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HRegion.java|borderStyle=solid}
// From line 2858
public void prepareDeleteTimestamps(Mutation mutation, Map 
familyMap,
  byte[] byteNow) throws IOException {
for (Map.Entry e : familyMap.entrySet()) {
  // ...
  for (int i=0; i < listSize; i++) {
// ...
if (cell.getTimestamp() == HConstants.LATEST_TIMESTAMP && 
CellUtil.isDeleteType(cell)) {
  byte[] qual = CellUtil.cloneQualifier(cell);
  if (qual == null) qual = HConstants.EMPTY_BYTE_ARRAY; // <-- here
  ...
{code}

The last statement {if (qual == null) qual = HConstants.EMPTY_BYTE_ARRAY;}



> Remove unnecessary null check after CellUtil.cloneQualifier()
> -
>
> Key: HBASE-18986
> URL: https://issues.apache.org/jira/browse/HBASE-18986
> Project: HBase
>  Issue Type: Improvement
>Reporter: Xiang Li
>Assignee: Xiang Li
>Priority: Minor
>
> In master branch,
> {code:title=hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HRegion.java|borderStyle=solid}
> // From line 2858
> public void prepareDeleteTimestamps(Mutation mutation, Map List> familyMap,
>   byte[] byteNow) throws IOException {
> for (Map.Entry e : familyMap.entrySet()) {
>   // ...
>   for (int i=0; i < listSize; i++) {
> // ...
> if (cell.getTimestamp() == HConstants.LATEST_TIMESTAMP && 
> CellUtil.isDeleteType(cell)) {
>   byte[] qual = CellUtil.cloneQualifier(cell);
>   if (qual == null) qual = HConstants.EMPTY_BYTE_ARRAY; // <-- here
>   ...
> {code}
> Might {{if (qual == null) qual = HConstants.EMPTY_BYTE_ARRAY;}} be removed? 
> Could it be null after CellUtil.cloneQualifier()
> {code:title=hbase-common/src/main/java/org/apache/hadoop/hbase/CellUtil.java|borderStyle=solid}
> public static byte[] cloneQualifier(Cell cell){
>   byte[] output = new byte[cell.getQualifierLength()];
>   copyQualifierTo(cell, output, 0);
>   return output;
> }



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)


[jira] [Updated] (HBASE-18986) Remove unnecessary null check after CellUtil.cloneQualifier()

2017-10-11 Thread Xiang Li (JIRA)

 [ 
https://issues.apache.org/jira/browse/HBASE-18986?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Xiang Li updated HBASE-18986:
-
Description: 
In master branch,
{code:title=hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HRegion.java|borderStyle=solid}
// From line 2858
public void prepareDeleteTimestamps(Mutation mutation, Map 
familyMap,
  byte[] byteNow) throws IOException {
for (Map.Entry e : familyMap.entrySet()) {
  // ...
  for (int i=0; i < listSize; i++) {
// ...
if (cell.getTimestamp() == HConstants.LATEST_TIMESTAMP && 
CellUtil.isDeleteType(cell)) {
  byte[] qual = CellUtil.cloneQualifier(cell);
  if (qual == null) qual = HConstants.EMPTY_BYTE_ARRAY; // <-- here
  ...
{code}

Might {{if (qual == null) qual = HConstants.EMPTY_BYTE_ARRAY;}} be removed? 
Could it be null after CellUtil.cloneQualifier()
{code:title=hbase-common/src/main/java/org/apache/hadoop/hbase/CellUtil.java|borderStyle=solid}
public static byte[] cloneQualifier(Cell cell){
  byte[] output = new byte[cell.getQualifierLength()];
  copyQualifierTo(cell, output, 0);
  return output;
}
{code}

  was:
In master branch,
{code:title=hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HRegion.java|borderStyle=solid}
// From line 2858
public void prepareDeleteTimestamps(Mutation mutation, Map 
familyMap,
  byte[] byteNow) throws IOException {
for (Map.Entry e : familyMap.entrySet()) {
  // ...
  for (int i=0; i < listSize; i++) {
// ...
if (cell.getTimestamp() == HConstants.LATEST_TIMESTAMP && 
CellUtil.isDeleteType(cell)) {
  byte[] qual = CellUtil.cloneQualifier(cell);
  if (qual == null) qual = HConstants.EMPTY_BYTE_ARRAY; // <-- here
  ...
{code}

Might {{if (qual == null) qual = HConstants.EMPTY_BYTE_ARRAY;}} be removed? 
Could it be null after CellUtil.cloneQualifier()
{code:title=hbase-common/src/main/java/org/apache/hadoop/hbase/CellUtil.java|borderStyle=solid}
public static byte[] cloneQualifier(Cell cell){
  byte[] output = new byte[cell.getQualifierLength()];
  copyQualifierTo(cell, output, 0);
  return output;
}




> Remove unnecessary null check after CellUtil.cloneQualifier()
> -
>
> Key: HBASE-18986
> URL: https://issues.apache.org/jira/browse/HBASE-18986
> Project: HBase
>  Issue Type: Improvement
>Reporter: Xiang Li
>Assignee: Xiang Li
>Priority: Minor
>
> In master branch,
> {code:title=hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HRegion.java|borderStyle=solid}
> // From line 2858
> public void prepareDeleteTimestamps(Mutation mutation, Map List> familyMap,
>   byte[] byteNow) throws IOException {
> for (Map.Entry e : familyMap.entrySet()) {
>   // ...
>   for (int i=0; i < listSize; i++) {
> // ...
> if (cell.getTimestamp() == HConstants.LATEST_TIMESTAMP && 
> CellUtil.isDeleteType(cell)) {
>   byte[] qual = CellUtil.cloneQualifier(cell);
>   if (qual == null) qual = HConstants.EMPTY_BYTE_ARRAY; // <-- here
>   ...
> {code}
> Might {{if (qual == null) qual = HConstants.EMPTY_BYTE_ARRAY;}} be removed? 
> Could it be null after CellUtil.cloneQualifier()
> {code:title=hbase-common/src/main/java/org/apache/hadoop/hbase/CellUtil.java|borderStyle=solid}
> public static byte[] cloneQualifier(Cell cell){
>   byte[] output = new byte[cell.getQualifierLength()];
>   copyQualifierTo(cell, output, 0);
>   return output;
> }
> {code}



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)


[jira] [Updated] (HBASE-18986) Remove unnecessary null check after CellUtil.cloneQualifier()

2017-10-11 Thread Xiang Li (JIRA)

 [ 
https://issues.apache.org/jira/browse/HBASE-18986?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Xiang Li updated HBASE-18986:
-
Description: 
In master branch,
{code:title=hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HRegion.java|borderStyle=solid}
// From line 2858
public void prepareDeleteTimestamps(Mutation mutation, Map 
familyMap,
  byte[] byteNow) throws IOException {
for (Map.Entry e : familyMap.entrySet()) {
  // ...
  for (int i=0; i < listSize; i++) {
// ...
if (cell.getTimestamp() == HConstants.LATEST_TIMESTAMP && 
CellUtil.isDeleteType(cell)) {
  byte[] qual = CellUtil.cloneQualifier(cell);
  if (qual == null) qual = HConstants.EMPTY_BYTE_ARRAY; // <-- here
  ...
{code}

The last statement {if (qual == null) qual = HConstants.EMPTY_BYTE_ARRAY;}


  was:
In master branch,
{code:title=hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HRegion.java|borderStyle=solid}
// From line 2858
public void prepareDeleteTimestamps(Mutation mutation, Map 
familyMap,
  byte[] byteNow) throws IOException {
for (Map.Entry e : familyMap.entrySet()) {

  byte[] family = e.getKey();
  List cells = e.getValue();
  assert cells instanceof RandomAccess;

  Map kvCount = new TreeMap<>(Bytes.BYTES_COMPARATOR);
  int listSize = cells.size();
  for (int i=0; i < listSize; i++) {
Cell cell = cells.get(i);
//  Check if time is LATEST, change to time of most recent addition if 
so
//  This is expensive.
if (cell.getTimestamp() == HConstants.LATEST_TIMESTAMP && 
CellUtil.isDeleteType(cell)) {
  byte[] qual = CellUtil.cloneQualifier(cell);
  if (qual == null) qual = HConstants.EMPTY_BYTE_ARRAY; // <-- here
  ...
{code}



> Remove unnecessary null check after CellUtil.cloneQualifier()
> -
>
> Key: HBASE-18986
> URL: https://issues.apache.org/jira/browse/HBASE-18986
> Project: HBase
>  Issue Type: Improvement
>Reporter: Xiang Li
>Assignee: Xiang Li
>Priority: Minor
>
> In master branch,
> {code:title=hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HRegion.java|borderStyle=solid}
> // From line 2858
> public void prepareDeleteTimestamps(Mutation mutation, Map List> familyMap,
>   byte[] byteNow) throws IOException {
> for (Map.Entry e : familyMap.entrySet()) {
>   // ...
>   for (int i=0; i < listSize; i++) {
> // ...
> if (cell.getTimestamp() == HConstants.LATEST_TIMESTAMP && 
> CellUtil.isDeleteType(cell)) {
>   byte[] qual = CellUtil.cloneQualifier(cell);
>   if (qual == null) qual = HConstants.EMPTY_BYTE_ARRAY; // <-- here
>   ...
> {code}
> The last statement {if (qual == null) qual = HConstants.EMPTY_BYTE_ARRAY;}



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)


[jira] [Updated] (HBASE-18986) Remove unnecessary null check after CellUtil.cloneQualifier()

2017-10-11 Thread Xiang Li (JIRA)

 [ 
https://issues.apache.org/jira/browse/HBASE-18986?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Xiang Li updated HBASE-18986:
-
Description: 
In master branch,
{code:title=hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HRegion.java|borderStyle=solid}
// From line 2858
public void prepareDeleteTimestamps(Mutation mutation, Map 
familyMap,
  byte[] byteNow) throws IOException {
for (Map.Entry e : familyMap.entrySet()) {

  byte[] family = e.getKey();
  List cells = e.getValue();
  assert cells instanceof RandomAccess;

  Map kvCount = new TreeMap<>(Bytes.BYTES_COMPARATOR);
  int listSize = cells.size();
  for (int i=0; i < listSize; i++) {
Cell cell = cells.get(i);
//  Check if time is LATEST, change to time of most recent addition if 
so
//  This is expensive.
if (cell.getTimestamp() == HConstants.LATEST_TIMESTAMP && 
CellUtil.isDeleteType(cell)) {
  byte[] qual = CellUtil.cloneQualifier(cell);
  if (qual == null) qual = HConstants.EMPTY_BYTE_ARRAY; // <-- here
  ...
{code}


  was:
In master branch,



> Remove unnecessary null check after CellUtil.cloneQualifier()
> -
>
> Key: HBASE-18986
> URL: https://issues.apache.org/jira/browse/HBASE-18986
> Project: HBase
>  Issue Type: Improvement
>Reporter: Xiang Li
>Assignee: Xiang Li
>Priority: Minor
>
> In master branch,
> {code:title=hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HRegion.java|borderStyle=solid}
> // From line 2858
> public void prepareDeleteTimestamps(Mutation mutation, Map List> familyMap,
>   byte[] byteNow) throws IOException {
> for (Map.Entry e : familyMap.entrySet()) {
>   byte[] family = e.getKey();
>   List cells = e.getValue();
>   assert cells instanceof RandomAccess;
>   Map kvCount = new TreeMap<>(Bytes.BYTES_COMPARATOR);
>   int listSize = cells.size();
>   for (int i=0; i < listSize; i++) {
> Cell cell = cells.get(i);
> //  Check if time is LATEST, change to time of most recent addition 
> if so
> //  This is expensive.
> if (cell.getTimestamp() == HConstants.LATEST_TIMESTAMP && 
> CellUtil.isDeleteType(cell)) {
>   byte[] qual = CellUtil.cloneQualifier(cell);
>   if (qual == null) qual = HConstants.EMPTY_BYTE_ARRAY; // <-- here
>   ...
> {code}



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)


[jira] [Updated] (HBASE-18986) Remove unnecessary null check after CellUtil.cloneQualifier()

2017-10-11 Thread Xiang Li (JIRA)

 [ 
https://issues.apache.org/jira/browse/HBASE-18986?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Xiang Li updated HBASE-18986:
-
Description: 
In master branch,


> Remove unnecessary null check after CellUtil.cloneQualifier()
> -
>
> Key: HBASE-18986
> URL: https://issues.apache.org/jira/browse/HBASE-18986
> Project: HBase
>  Issue Type: Improvement
>Reporter: Xiang Li
>Assignee: Xiang Li
>Priority: Minor
>
> In master branch,



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)