public class HBaseEncoderUtil extends Object
Object to Byte encoding. This class is used to ensure that HBase
keys have the same size, and provides an uniformized API to encode strings and EReference.| Modifier and Type | Field and Description |
|---|---|
static int |
UUID_LENGTH
Expected length (in
bytes) of stored elements. |
static char |
VALUE_SEPERATOR_DEFAULT
The default separator used to serialize
Collections. |
| Constructor and Description |
|---|
HBaseEncoderUtil() |
| Modifier and Type | Method and Description |
|---|---|
static byte[] |
toBytes(String[] strings)
Encodes an array of
Strings into an array of bytes that can be stored in the database. |
static byte[] |
toBytesReferences(String[] strings)
Encodes the provided
String array into an array of bytes that can be stored in the database. |
static String[] |
toStrings(byte[] bytes)
Decodes an array of
bytes into an array of Strings. |
static String[] |
toStringsReferences(byte[] value)
|
public static final int UUID_LENGTH
bytes) of stored elements.public static final char VALUE_SEPERATOR_DEFAULT
Collections.public static String[] toStringsReferences(byte[] value)
value - the HBase value to decodeStrings representing the EReferences decoded from the databaseNullPointerException - if the given value is nullIllegalArgumentException - if the length of value is not a multiple of UUID_LENGTHtoBytesReferences(String[])public static byte[] toBytesReferences(String[] strings)
String array into an array of bytes that can be stored in the database.strings - an array of Strings representing the EReferences to encode.bytesNullPointerException - if the value to encode is nulltoStringsReferences(byte[])public static byte[] toBytes(String[] strings)
Strings into an array of bytes that can be stored in the database.strings - the array to encodebyte arraytoStrings(byte[])public static String[] toStrings(byte[] bytes)
bytes into an array of Strings.bytes - the byte array to decodeString arrayNullPointerException - if the given array is nulltoBytes(String[])Copyright © 2013–2017 Atlanmod INRIA LINA Mines Nantes. All rights reserved.