Reputation: 4989
A HBase value is indexed by 4 keys: TableName
, RowKey
, ColumnKey
, Timestamp
.
Where:
TableName
is a stringRowKey
and ColumnKey
are binary values (Java type byte[])Timestamp
is a 64-bit integer (Java type long)Binary data is encoded in Base64 for transmission over the wire.
Why keys and values are stored using bytes instead of String?
Upvotes: 0
Views: 1280
Reputation: 219
Because you may need to store a binary data in qualifier and value. For example we have prefixed qualifiers like this: 'prefix[binary int64 id]' and serialized protobuf as value. You can use ColumnPrefixFilter to get these value. In other case we have a column family 'i' qualifier 'binary 64int id' and value binary value. So all qualifier in this column family are binary and you can scan just this family.
Upvotes: 2