[jira] [Updated] (HBASE-21617) HBase Bytes.putBigDecimal error

2019-10-14 Thread apcahephoenix (Jira)


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

apcahephoenix updated HBASE-21617:
--
Fix Version/s: 2.0.0
 Release Note: The patch affects only the Bytes.putBigDecimal() method.
   Resolution: Fixed
   Status: Resolved  (was: Patch Available)

The patch affects only the Bytes.putBigDecimal() method.

> HBase Bytes.putBigDecimal error
> ---
>
> Key: HBASE-21617
> URL: https://issues.apache.org/jira/browse/HBASE-21617
> Project: HBase
>  Issue Type: Bug
>  Components: util
>Affects Versions: 2.1.0, 2.0.0, 2.1.1
> Environment: JDK 1.8
>Reporter: apcahephoenix
>Priority: Major
> Fix For: 2.0.0
>
> Attachments: HBASE-21617.master.v2.patch
>
>
> *hbase-common/*
> *org.apache.hadoop.hbase.util.Bytes:*
> public static int putBigDecimal(byte[] bytes, int offset, BigDecimal val) {
>   if (bytes == null){
>     return offset;
>   }
>   byte[] valueBytes = val.unscaledValue().toByteArray();
>   byte[] result = new byte[valueBytes.length + SIZEOF_INT];
>   offset = putInt(result, offset, val.scale());
> {color:#d04437}return putBytes(result, offset, valueBytes, 0, 
> valueBytes.length); // this one, bytes is not used{color}
>  }
> *Test:*
>  byte[] bytes = new byte[64];
>  BigDecimal bigDecimal = new BigDecimal("100.10");
>  Bytes.putBigDecimal(bytes, 4, bigDecimal);
>  System.out.println(Arrays.toString(bytes)); // invalid
> *Suggest:*
>  public static int putBigDecimal(byte[] bytes, int offset, BigDecimal val) {
>   byte[] valueBytes = toBytes(val);
>   return putBytes(bytes, offset, valueBytes, 0, valueBytes.length);
>  }



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Updated] (HBASE-21617) HBase Bytes.putBigDecimal error

2019-01-29 Thread apcahephoenix (JIRA)


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

apcahephoenix updated HBASE-21617:
--
Attachment: (was: TestBytes_HBASE_21617.patch)

> HBase Bytes.putBigDecimal error
> ---
>
> Key: HBASE-21617
> URL: https://issues.apache.org/jira/browse/HBASE-21617
> Project: HBase
>  Issue Type: Bug
>  Components: util
>Affects Versions: 2.1.0, 2.0.0, 2.1.1
> Environment: JDK 1.8
>Reporter: apcahephoenix
>Priority: Major
> Attachments: HBASE-21617.master.v2.patch
>
>
> *hbase-common/*
> *org.apache.hadoop.hbase.util.Bytes:*
> public static int putBigDecimal(byte[] bytes, int offset, BigDecimal val) {
>   if (bytes == null){
>     return offset;
>   }
>   byte[] valueBytes = val.unscaledValue().toByteArray();
>   byte[] result = new byte[valueBytes.length + SIZEOF_INT];
>   offset = putInt(result, offset, val.scale());
> {color:#d04437}return putBytes(result, offset, valueBytes, 0, 
> valueBytes.length); // this one, bytes is not used{color}
>  }
> *Test:*
>  byte[] bytes = new byte[64];
>  BigDecimal bigDecimal = new BigDecimal("100.10");
>  Bytes.putBigDecimal(bytes, 4, bigDecimal);
>  System.out.println(Arrays.toString(bytes)); // invalid
> *Suggest:*
>  public static int putBigDecimal(byte[] bytes, int offset, BigDecimal val) {
>   byte[] valueBytes = toBytes(val);
>   return putBytes(bytes, offset, valueBytes, 0, valueBytes.length);
>  }



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Updated] (HBASE-21617) HBase Bytes.putBigDecimal error

2019-01-29 Thread apcahephoenix (JIRA)


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

apcahephoenix updated HBASE-21617:
--
Attachment: HBASE-21617.master.v2.patch

> HBase Bytes.putBigDecimal error
> ---
>
> Key: HBASE-21617
> URL: https://issues.apache.org/jira/browse/HBASE-21617
> Project: HBase
>  Issue Type: Bug
>  Components: util
>Affects Versions: 2.1.0, 2.0.0, 2.1.1
> Environment: JDK 1.8
>Reporter: apcahephoenix
>Priority: Major
> Attachments: HBASE-21617.master.v2.patch
>
>
> *hbase-common/*
> *org.apache.hadoop.hbase.util.Bytes:*
> public static int putBigDecimal(byte[] bytes, int offset, BigDecimal val) {
>   if (bytes == null){
>     return offset;
>   }
>   byte[] valueBytes = val.unscaledValue().toByteArray();
>   byte[] result = new byte[valueBytes.length + SIZEOF_INT];
>   offset = putInt(result, offset, val.scale());
> {color:#d04437}return putBytes(result, offset, valueBytes, 0, 
> valueBytes.length); // this one, bytes is not used{color}
>  }
> *Test:*
>  byte[] bytes = new byte[64];
>  BigDecimal bigDecimal = new BigDecimal("100.10");
>  Bytes.putBigDecimal(bytes, 4, bigDecimal);
>  System.out.println(Arrays.toString(bytes)); // invalid
> *Suggest:*
>  public static int putBigDecimal(byte[] bytes, int offset, BigDecimal val) {
>   byte[] valueBytes = toBytes(val);
>   return putBytes(bytes, offset, valueBytes, 0, valueBytes.length);
>  }



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Updated] (HBASE-21617) HBase Bytes.putBigDecimal error

2019-01-29 Thread apcahephoenix (JIRA)


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

apcahephoenix updated HBASE-21617:
--
Attachment: (was: Bytes_HBASE_21617.patch)

> HBase Bytes.putBigDecimal error
> ---
>
> Key: HBASE-21617
> URL: https://issues.apache.org/jira/browse/HBASE-21617
> Project: HBase
>  Issue Type: Bug
>  Components: util
>Affects Versions: 2.1.0, 2.0.0, 2.1.1
> Environment: JDK 1.8
>Reporter: apcahephoenix
>Priority: Major
> Attachments: HBASE-21617.master.v2.patch
>
>
> *hbase-common/*
> *org.apache.hadoop.hbase.util.Bytes:*
> public static int putBigDecimal(byte[] bytes, int offset, BigDecimal val) {
>   if (bytes == null){
>     return offset;
>   }
>   byte[] valueBytes = val.unscaledValue().toByteArray();
>   byte[] result = new byte[valueBytes.length + SIZEOF_INT];
>   offset = putInt(result, offset, val.scale());
> {color:#d04437}return putBytes(result, offset, valueBytes, 0, 
> valueBytes.length); // this one, bytes is not used{color}
>  }
> *Test:*
>  byte[] bytes = new byte[64];
>  BigDecimal bigDecimal = new BigDecimal("100.10");
>  Bytes.putBigDecimal(bytes, 4, bigDecimal);
>  System.out.println(Arrays.toString(bytes)); // invalid
> *Suggest:*
>  public static int putBigDecimal(byte[] bytes, int offset, BigDecimal val) {
>   byte[] valueBytes = toBytes(val);
>   return putBytes(bytes, offset, valueBytes, 0, valueBytes.length);
>  }



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (HBASE-21617) HBase Bytes.putBigDecimal error

2019-01-29 Thread apcahephoenix (JIRA)


[ 
https://issues.apache.org/jira/browse/HBASE-21617?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16754807#comment-16754807
 ] 

apcahephoenix commented on HBASE-21617:
---

The patch name has been modified as required. [~openinx]

{color:red}why do you put the max_value & min_value to the head/tail of the 
byte array ?{color}
*Reply*: Just to test whether the offset parameter of the method is correct, 
only use one obvious value at both ends for easy viewing.

> HBase Bytes.putBigDecimal error
> ---
>
> Key: HBASE-21617
> URL: https://issues.apache.org/jira/browse/HBASE-21617
> Project: HBase
>  Issue Type: Bug
>  Components: util
>Affects Versions: 2.1.0, 2.0.0, 2.1.1
> Environment: JDK 1.8
>Reporter: apcahephoenix
>Priority: Major
> Attachments: Bytes_HBASE_21617.patch, TestBytes_HBASE_21617.patch
>
>
> *hbase-common/*
> *org.apache.hadoop.hbase.util.Bytes:*
> public static int putBigDecimal(byte[] bytes, int offset, BigDecimal val) {
>   if (bytes == null){
>     return offset;
>   }
>   byte[] valueBytes = val.unscaledValue().toByteArray();
>   byte[] result = new byte[valueBytes.length + SIZEOF_INT];
>   offset = putInt(result, offset, val.scale());
> {color:#d04437}return putBytes(result, offset, valueBytes, 0, 
> valueBytes.length); // this one, bytes is not used{color}
>  }
> *Test:*
>  byte[] bytes = new byte[64];
>  BigDecimal bigDecimal = new BigDecimal("100.10");
>  Bytes.putBigDecimal(bytes, 4, bigDecimal);
>  System.out.println(Arrays.toString(bytes)); // invalid
> *Suggest:*
>  public static int putBigDecimal(byte[] bytes, int offset, BigDecimal val) {
>   byte[] valueBytes = toBytes(val);
>   return putBytes(bytes, offset, valueBytes, 0, valueBytes.length);
>  }



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Updated] (HBASE-21617) HBase Bytes.putBigDecimal error

2018-12-20 Thread apcahephoenix (JIRA)


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

apcahephoenix updated HBASE-21617:
--
Attachment: (was: TestBytes.java)

> HBase Bytes.putBigDecimal error
> ---
>
> Key: HBASE-21617
> URL: https://issues.apache.org/jira/browse/HBASE-21617
> Project: HBase
>  Issue Type: Bug
>  Components: util
>Affects Versions: 2.1.0, 2.0.0, 2.1.1
> Environment: JDK 1.8
>Reporter: apcahephoenix
>Priority: Major
> Attachments: Bytes_HBASE_21617.patch, TestBytes_HBASE_21617.patch
>
>
> *hbase-common/*
> *org.apache.hadoop.hbase.util.Bytes:*
> public static int putBigDecimal(byte[] bytes, int offset, BigDecimal val) {
>   if (bytes == null){
>     return offset;
>   }
>   byte[] valueBytes = val.unscaledValue().toByteArray();
>   byte[] result = new byte[valueBytes.length + SIZEOF_INT];
>   offset = putInt(result, offset, val.scale());
> {color:#d04437}return putBytes(result, offset, valueBytes, 0, 
> valueBytes.length); // this one, bytes is not used{color}
>  }
> *Test:*
>  byte[] bytes = new byte[64];
>  BigDecimal bigDecimal = new BigDecimal("100.10");
>  Bytes.putBigDecimal(bytes, 4, bigDecimal);
>  System.out.println(Arrays.toString(bytes)); // invalid
> *Suggest:*
>  public static int putBigDecimal(byte[] bytes, int offset, BigDecimal val) {
>   byte[] valueBytes = toBytes(val);
>   return putBytes(bytes, offset, valueBytes, 0, valueBytes.length);
>  }



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Comment Edited] (HBASE-21617) HBase Bytes.putBigDecimal error

2018-12-20 Thread apcahephoenix (JIRA)


[ 
https://issues.apache.org/jira/browse/HBASE-21617?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16725720#comment-16725720
 ] 

apcahephoenix edited comment on HBASE-21617 at 12/20/18 9:50 AM:
-

Thanks Zheng Hu, reviews link is [https://reviews.apache.org/r/69611/]


was (Author: apcahephoenix):
Thanks Zheng Hu, reviews link is 
[https://reviews.apache.org/r/69611/][^Bytes_HBASE_21617.patch]

> HBase Bytes.putBigDecimal error
> ---
>
> Key: HBASE-21617
> URL: https://issues.apache.org/jira/browse/HBASE-21617
> Project: HBase
>  Issue Type: Bug
>  Components: util
>Affects Versions: 2.1.0, 2.0.0, 2.1.1
> Environment: JDK 1.8
>Reporter: apcahephoenix
>Priority: Major
> Attachments: Bytes.java, Bytes_HBASE_21617.patch, TestBytes.java, 
> TestBytes_HBASE_21617.patch
>
>
> *hbase-common/*
> *org.apache.hadoop.hbase.util.Bytes:*
> public static int putBigDecimal(byte[] bytes, int offset, BigDecimal val) {
>   if (bytes == null){
>     return offset;
>   }
>   byte[] valueBytes = val.unscaledValue().toByteArray();
>   byte[] result = new byte[valueBytes.length + SIZEOF_INT];
>   offset = putInt(result, offset, val.scale());
> {color:#d04437}return putBytes(result, offset, valueBytes, 0, 
> valueBytes.length); // this one, bytes is not used{color}
>  }
> *Test:*
>  byte[] bytes = new byte[64];
>  BigDecimal bigDecimal = new BigDecimal("100.10");
>  Bytes.putBigDecimal(bytes, 4, bigDecimal);
>  System.out.println(Arrays.toString(bytes)); // invalid
> *Suggest:*
>  public static int putBigDecimal(byte[] bytes, int offset, BigDecimal val) {
>   byte[] valueBytes = toBytes(val);
>   return putBytes(bytes, offset, valueBytes, 0, valueBytes.length);
>  }



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Updated] (HBASE-21617) HBase Bytes.putBigDecimal error

2018-12-20 Thread apcahephoenix (JIRA)


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

apcahephoenix updated HBASE-21617:
--
Attachment: (was: Bytes.java)

> HBase Bytes.putBigDecimal error
> ---
>
> Key: HBASE-21617
> URL: https://issues.apache.org/jira/browse/HBASE-21617
> Project: HBase
>  Issue Type: Bug
>  Components: util
>Affects Versions: 2.1.0, 2.0.0, 2.1.1
> Environment: JDK 1.8
>Reporter: apcahephoenix
>Priority: Major
> Attachments: Bytes_HBASE_21617.patch, TestBytes_HBASE_21617.patch
>
>
> *hbase-common/*
> *org.apache.hadoop.hbase.util.Bytes:*
> public static int putBigDecimal(byte[] bytes, int offset, BigDecimal val) {
>   if (bytes == null){
>     return offset;
>   }
>   byte[] valueBytes = val.unscaledValue().toByteArray();
>   byte[] result = new byte[valueBytes.length + SIZEOF_INT];
>   offset = putInt(result, offset, val.scale());
> {color:#d04437}return putBytes(result, offset, valueBytes, 0, 
> valueBytes.length); // this one, bytes is not used{color}
>  }
> *Test:*
>  byte[] bytes = new byte[64];
>  BigDecimal bigDecimal = new BigDecimal("100.10");
>  Bytes.putBigDecimal(bytes, 4, bigDecimal);
>  System.out.println(Arrays.toString(bytes)); // invalid
> *Suggest:*
>  public static int putBigDecimal(byte[] bytes, int offset, BigDecimal val) {
>   byte[] valueBytes = toBytes(val);
>   return putBytes(bytes, offset, valueBytes, 0, valueBytes.length);
>  }



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (HBASE-21617) HBase Bytes.putBigDecimal error

2018-12-20 Thread apcahephoenix (JIRA)


[ 
https://issues.apache.org/jira/browse/HBASE-21617?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16725720#comment-16725720
 ] 

apcahephoenix commented on HBASE-21617:
---

Thanks Zheng Hu, reviews link is 
[https://reviews.apache.org/r/69611/][^Bytes_HBASE_21617.patch]

> HBase Bytes.putBigDecimal error
> ---
>
> Key: HBASE-21617
> URL: https://issues.apache.org/jira/browse/HBASE-21617
> Project: HBase
>  Issue Type: Bug
>  Components: util
>Affects Versions: 2.1.0, 2.0.0, 2.1.1
> Environment: JDK 1.8
>Reporter: apcahephoenix
>Priority: Major
> Attachments: Bytes.java, Bytes_HBASE_21617.patch, TestBytes.java, 
> TestBytes_HBASE_21617.patch
>
>
> *hbase-common/*
> *org.apache.hadoop.hbase.util.Bytes:*
> public static int putBigDecimal(byte[] bytes, int offset, BigDecimal val) {
>   if (bytes == null){
>     return offset;
>   }
>   byte[] valueBytes = val.unscaledValue().toByteArray();
>   byte[] result = new byte[valueBytes.length + SIZEOF_INT];
>   offset = putInt(result, offset, val.scale());
> {color:#d04437}return putBytes(result, offset, valueBytes, 0, 
> valueBytes.length); // this one, bytes is not used{color}
>  }
> *Test:*
>  byte[] bytes = new byte[64];
>  BigDecimal bigDecimal = new BigDecimal("100.10");
>  Bytes.putBigDecimal(bytes, 4, bigDecimal);
>  System.out.println(Arrays.toString(bytes)); // invalid
> *Suggest:*
>  public static int putBigDecimal(byte[] bytes, int offset, BigDecimal val) {
>   byte[] valueBytes = toBytes(val);
>   return putBytes(bytes, offset, valueBytes, 0, valueBytes.length);
>  }



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Updated] (HBASE-21617) HBase Bytes.putBigDecimal error

2018-12-20 Thread apcahephoenix (JIRA)


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

apcahephoenix updated HBASE-21617:
--
Attachment: TestBytes_HBASE_21617.patch
Bytes_HBASE_21617.patch

> HBase Bytes.putBigDecimal error
> ---
>
> Key: HBASE-21617
> URL: https://issues.apache.org/jira/browse/HBASE-21617
> Project: HBase
>  Issue Type: Bug
>  Components: util
>Affects Versions: 2.1.0, 2.0.0, 2.1.1
> Environment: JDK 1.8
>Reporter: apcahephoenix
>Priority: Major
> Attachments: Bytes.java, Bytes_HBASE_21617.patch, TestBytes.java, 
> TestBytes_HBASE_21617.patch
>
>
> *hbase-common/*
> *org.apache.hadoop.hbase.util.Bytes:*
> public static int putBigDecimal(byte[] bytes, int offset, BigDecimal val) {
>   if (bytes == null){
>     return offset;
>   }
>   byte[] valueBytes = val.unscaledValue().toByteArray();
>   byte[] result = new byte[valueBytes.length + SIZEOF_INT];
>   offset = putInt(result, offset, val.scale());
> {color:#d04437}return putBytes(result, offset, valueBytes, 0, 
> valueBytes.length); // this one, bytes is not used{color}
>  }
> *Test:*
>  byte[] bytes = new byte[64];
>  BigDecimal bigDecimal = new BigDecimal("100.10");
>  Bytes.putBigDecimal(bytes, 4, bigDecimal);
>  System.out.println(Arrays.toString(bytes)); // invalid
> *Suggest:*
>  public static int putBigDecimal(byte[] bytes, int offset, BigDecimal val) {
>   byte[] valueBytes = toBytes(val);
>   return putBytes(bytes, offset, valueBytes, 0, valueBytes.length);
>  }



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (HBASE-21617) HBase Bytes.putBigDecimal error

2018-12-19 Thread apcahephoenix (JIRA)


[ 
https://issues.apache.org/jira/browse/HBASE-21617?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16725526#comment-16725526
 ] 

apcahephoenix commented on HBASE-21617:
---

I don't know how to with a UT, please let me know if you have any requirements. 
My problems and modifications have been explained in the description, now I 
will add the modified files and unit test files.

 

{color:#d04437}*src files in the hbase-common/*{color}

*Bytes.putBigDecimal()*

*TestBytes.testPutBigDecimal()*

> HBase Bytes.putBigDecimal error
> ---
>
> Key: HBASE-21617
> URL: https://issues.apache.org/jira/browse/HBASE-21617
> Project: HBase
>  Issue Type: Bug
>  Components: util
>Affects Versions: 2.1.0, 2.0.0, 2.1.1
> Environment: JDK 1.8
>Reporter: apcahephoenix
>Priority: Major
> Attachments: Bytes.java, TestBytes.java
>
>
> *hbase-common/*
> *org.apache.hadoop.hbase.util.Bytes:*
> public static int putBigDecimal(byte[] bytes, int offset, BigDecimal val) {
>   if (bytes == null){
>     return offset;
>   }
>   byte[] valueBytes = val.unscaledValue().toByteArray();
>   byte[] result = new byte[valueBytes.length + SIZEOF_INT];
>   offset = putInt(result, offset, val.scale());
> {color:#d04437}return putBytes(result, offset, valueBytes, 0, 
> valueBytes.length); // this one, bytes is not used{color}
>  }
> *Test:*
>  byte[] bytes = new byte[64];
>  BigDecimal bigDecimal = new BigDecimal("100.10");
>  Bytes.putBigDecimal(bytes, 4, bigDecimal);
>  System.out.println(Arrays.toString(bytes)); // invalid
> *Suggest:*
>  public static int putBigDecimal(byte[] bytes, int offset, BigDecimal val) {
>   byte[] valueBytes = toBytes(val);
>   return putBytes(bytes, offset, valueBytes, 0, valueBytes.length);
>  }



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Updated] (HBASE-21617) HBase Bytes.putBigDecimal error

2018-12-19 Thread apcahephoenix (JIRA)


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

apcahephoenix updated HBASE-21617:
--
Attachment: Bytes.java

> HBase Bytes.putBigDecimal error
> ---
>
> Key: HBASE-21617
> URL: https://issues.apache.org/jira/browse/HBASE-21617
> Project: HBase
>  Issue Type: Bug
>  Components: util
>Affects Versions: 2.1.0, 2.0.0, 2.1.1
> Environment: JDK 1.8
>Reporter: apcahephoenix
>Priority: Major
> Attachments: Bytes.java, TestBytes.java
>
>
> *hbase-common/*
> *org.apache.hadoop.hbase.util.Bytes:*
> public static int putBigDecimal(byte[] bytes, int offset, BigDecimal val) {
>   if (bytes == null){
>     return offset;
>   }
>   byte[] valueBytes = val.unscaledValue().toByteArray();
>   byte[] result = new byte[valueBytes.length + SIZEOF_INT];
>   offset = putInt(result, offset, val.scale());
> {color:#d04437}return putBytes(result, offset, valueBytes, 0, 
> valueBytes.length); // this one, bytes is not used{color}
>  }
> *Test:*
>  byte[] bytes = new byte[64];
>  BigDecimal bigDecimal = new BigDecimal("100.10");
>  Bytes.putBigDecimal(bytes, 4, bigDecimal);
>  System.out.println(Arrays.toString(bytes)); // invalid
> *Suggest:*
>  public static int putBigDecimal(byte[] bytes, int offset, BigDecimal val) {
>   byte[] valueBytes = toBytes(val);
>   return putBytes(bytes, offset, valueBytes, 0, valueBytes.length);
>  }



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Updated] (HBASE-21617) HBase Bytes.putBigDecimal error

2018-12-19 Thread apcahephoenix (JIRA)


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

apcahephoenix updated HBASE-21617:
--
Attachment: TestBytes.java

> HBase Bytes.putBigDecimal error
> ---
>
> Key: HBASE-21617
> URL: https://issues.apache.org/jira/browse/HBASE-21617
> Project: HBase
>  Issue Type: Bug
>  Components: util
>Affects Versions: 2.1.0, 2.0.0, 2.1.1
> Environment: JDK 1.8
>Reporter: apcahephoenix
>Priority: Major
> Attachments: TestBytes.java
>
>
> *hbase-common/*
> *org.apache.hadoop.hbase.util.Bytes:*
> public static int putBigDecimal(byte[] bytes, int offset, BigDecimal val) {
>   if (bytes == null){
>     return offset;
>   }
>   byte[] valueBytes = val.unscaledValue().toByteArray();
>   byte[] result = new byte[valueBytes.length + SIZEOF_INT];
>   offset = putInt(result, offset, val.scale());
> {color:#d04437}return putBytes(result, offset, valueBytes, 0, 
> valueBytes.length); // this one, bytes is not used{color}
>  }
> *Test:*
>  byte[] bytes = new byte[64];
>  BigDecimal bigDecimal = new BigDecimal("100.10");
>  Bytes.putBigDecimal(bytes, 4, bigDecimal);
>  System.out.println(Arrays.toString(bytes)); // invalid
> *Suggest:*
>  public static int putBigDecimal(byte[] bytes, int offset, BigDecimal val) {
>   byte[] valueBytes = toBytes(val);
>   return putBytes(bytes, offset, valueBytes, 0, valueBytes.length);
>  }



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Created] (HBASE-21617) HBase Bytes.putBigDecimal error

2018-12-18 Thread apcahephoenix (JIRA)
apcahephoenix created HBASE-21617:
-

 Summary: HBase Bytes.putBigDecimal error
 Key: HBASE-21617
 URL: https://issues.apache.org/jira/browse/HBASE-21617
 Project: HBase
  Issue Type: Bug
  Components: util
Affects Versions: 2.1.1, 2.0.0, 2.1.0
 Environment: JDK 1.8
Reporter: apcahephoenix


*hbase-common/*

*org.apache.hadoop.hbase.util.Bytes:*

public static int putBigDecimal(byte[] bytes, int offset, BigDecimal val) {
  if (bytes == null){

    return offset;

  }

  byte[] valueBytes = val.unscaledValue().toByteArray();
  byte[] result = new byte[valueBytes.length + SIZEOF_INT];
  offset = putInt(result, offset, val.scale());
{color:#d04437}return putBytes(result, offset, valueBytes, 0, 
valueBytes.length); // this one, bytes is not used{color}
 }

*Test:*
 byte[] bytes = new byte[64];
 BigDecimal bigDecimal = new BigDecimal("100.10");
 Bytes.putBigDecimal(bytes, 4, bigDecimal);
 System.out.println(Arrays.toString(bytes)); // invalid

*Suggest:*
 public static int putBigDecimal(byte[] bytes, int offset, BigDecimal val) {
  byte[] valueBytes = toBytes(val);
  return putBytes(bytes, offset, valueBytes, 0, valueBytes.length);
 }



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Created] (HBASE-21049) RUNNABLE:SERVER_CRASH_START; ServerCrashProcedure

2018-08-14 Thread apcahephoenix (JIRA)
apcahephoenix created HBASE-21049:
-

 Summary: RUNNABLE:SERVER_CRASH_START; ServerCrashProcedure
 Key: HBASE-21049
 URL: https://issues.apache.org/jira/browse/HBASE-21049
 Project: HBase
  Issue Type: Bug
  Components: master
Affects Versions: 2.1.0
Reporter: apcahephoenix


Power off and restart(Hadoop and HBase), Master is initializing - Hbase 
ServerManager: but crash processing already in progress

command jps, HMaster and HRegionServer is live

 

LOG:

core file size (blocks, -c) 0
data seg size (kbytes, -d) unlimited
scheduling priority (-e) 0
file size (blocks, -f) unlimited
pending signals (-i) 64091
max locked memory (kbytes, -l) 64
max memory size (kbytes, -m) unlimited
open files (-n) 1024
pipe size (512 bytes, -p) 8
POSIX message queues (bytes, -q) 819200
real-time priority (-r) 0
stack size (kbytes, -s) 8192
cpu time (seconds, -t) unlimited
max user processes (-u) 64091
virtual memory (kbytes, -v) unlimited
file locks (-x) unlimited
2018-08-14 17:25:00,173 INFO [main] master.HMaster: STARTING service HMaster
2018-08-14 17:25:00,174 INFO [main] util.VersionInfo: HBase 2.1.0
2018-08-14 17:25:00,174 INFO [main] util.VersionInfo: Source code repository 
revision=4531d1c947a25b28a9a994b60c791a112c12a2b4
2018-08-14 17:25:00,174 INFO [main] util.VersionInfo: Compiled by hbase on Wed 
Aug 1 11:25:59 2018
2018-08-14 17:25:00,174 INFO [main] util.VersionInfo: From source with checksum 
fc32566f7e030ff71458fbf6dc77bce9
2018-08-14 17:25:00,516 INFO [main] util.ServerCommandLine: hbase.tmp.dir: 
/tmp/hbase-root
2018-08-14 17:25:00,516 INFO [main] util.ServerCommandLine: hbase.rootdir: 
hdfs://192.168.101.114:9000/hbase
2018-08-14 17:25:00,516 INFO [main] util.ServerCommandLine: 
hbase.cluster.distributed: true
2018-08-14 17:25:00,516 INFO [main] util.ServerCommandLine: 
hbase.zookeeper.quorum: 192.168.101.114:2181
2018-08-14 17:25:00,517 INFO [main] util.ServerCommandLine: 
env:PATH=/opt/apache-phoenix-5.0.0-HBase-2.0-bin/bin:/opt/hbase-2.1.0/bin:/opt/hadoop-2.8.4/bin:/opt/jdk1.8.0_172/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/root/bin
2018-08-14 17:25:00,517 INFO [main] util.ServerCommandLine: 
env:HADOOP_CONF_DIR=/opt/hadoop-2.8.4/etc/hadoop
2018-08-14 17:25:00,517 INFO [main] util.ServerCommandLine: 
env:HISTCONTROL=ignoredups
2018-08-14 17:25:00,517 INFO [main] util.ServerCommandLine: 
env:JAVA_LIBRARY_PATH=/opt/hadoop-2.8.4/lib/native::/opt/hadoop-2.8.4/lib/native:
2018-08-14 17:25:00,517 INFO [main] util.ServerCommandLine: 
env:HBASE_REGIONSERVER_OPTS= -Xdebug -Xnoagent -Djava.compiler=NONE 
-Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=8071
2018-08-14 17:25:00,517 INFO [main] util.ServerCommandLine: 
env:HBASE_CONF_DIR=/opt/hbase-2.1.0/conf
2018-08-14 17:25:00,517 INFO [main] util.ServerCommandLine: 
env:HDFS_DATANODE_SECURE_USER=root
2018-08-14 17:25:00,517 INFO [main] util.ServerCommandLine: 
env:MAIL=/var/spool/mail/root
2018-08-14 17:25:00,517 INFO [main] util.ServerCommandLine: 
env:PHOENIX_HOME=/opt/apache-phoenix-5.0.0-HBase-2.0-bin
2018-08-14 17:25:00,517 INFO [main] util.ServerCommandLine: 
env:LD_LIBRARY_PATH=:/opt/hadoop-2.8.4/lib/native::/opt/hadoop-2.8.4/lib/native:
2018-08-14 17:25:00,517 INFO [main] util.ServerCommandLine: env:LOGNAME=root
2018-08-14 17:25:00,518 INFO [main] util.ServerCommandLine: env:HBASE_REST_OPTS=
2018-08-14 17:25:00,518 INFO [main] util.ServerCommandLine: 
env:PWD=/opt/hbase-2.1.0/bin
2018-08-14 17:25:00,518 INFO [main] util.ServerCommandLine: 
env:HADOOP_PREFIX=/opt/hadoop-2.8.4
2018-08-14 17:25:00,518 INFO [main] util.ServerCommandLine: 
env:HADOOP_INSTALL=/opt/hadoop-2.8.4
2018-08-14 17:25:00,518 INFO [main] util.ServerCommandLine: 
env:HBASE_ROOT_LOGGER=INFO,RFA
2018-08-14 17:25:00,518 INFO [main] util.ServerCommandLine: 
env:LESSOPEN=||/usr/bin/lesspipe.sh %s
2018-08-14 17:25:00,518 INFO [main] util.ServerCommandLine: env:SHELL=/bin/bash
2018-08-14 17:25:00,518 INFO [main] util.ServerCommandLine: 
env:SELINUX_USE_CURRENT_RANGE=
2018-08-14 17:25:00,518 INFO [main] util.ServerCommandLine: 
env:YARN_CONF_DIR=/opt/hadoop-2.8.4/etc/hadoop
2018-08-14 17:25:00,518 INFO [main] util.ServerCommandLine: 
env:HBASE_ENV_INIT=true
2018-08-14 17:25:00,518 INFO [main] util.ServerCommandLine: 
env:HADOOP_YARN_HOME=/opt/hadoop-2.8.4
2018-08-14 17:25:00,518 INFO [main] util.ServerCommandLine: 
env:HBASE_MASTER_OPTS= -Xdebug 
-Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=8070
2018-08-14 17:25:00,518 INFO [main] util.ServerCommandLine: 
env:HBASE_MANAGES_ZK=false
2018-08-14 17:25:00,518 INFO [main] util.ServerCommandLine: 
env:HADOOP_HOME=/opt/hadoop-2.8.4
2018-08-14 17:25:00,518 INFO [main] util.ServerCommandLine: env:HBASE_NICENESS=0
2018-08-14 17:25:00,518 INFO [main] util.ServerCommandLine: env:HBASE_OPTS= 
-XX:+UseConcMarkSweepGC -Xdebug 
-Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=8070 
-Dhbase.log.di