You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@kylin.apache.org by sh...@apache.org on 2015/11/02 09:19:27 UTC
incubator-kylin git commit: support global dict in
HBaseClientKVIterator
Repository: incubator-kylin
Updated Branches:
refs/heads/KYLIN-1112 b4a16eb89 -> 65a337a4e
support global dict in HBaseClientKVIterator
Project: http://git-wip-us.apache.org/repos/asf/incubator-kylin/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-kylin/commit/65a337a4
Tree: http://git-wip-us.apache.org/repos/asf/incubator-kylin/tree/65a337a4
Diff: http://git-wip-us.apache.org/repos/asf/incubator-kylin/diff/65a337a4
Branch: refs/heads/KYLIN-1112
Commit: 65a337a4e295396240a0d6de417aa5085de6730a
Parents: b4a16eb
Author: shaofengshi <sh...@apache.org>
Authored: Mon Nov 2 16:19:08 2015 +0800
Committer: shaofengshi <sh...@apache.org>
Committed: Mon Nov 2 16:19:20 2015 +0800
----------------------------------------------------------------------
.../org/apache/kylin/invertedindex/model/IIKeyValueCodec.java | 2 +-
.../kylin/storage/hbase/cube/v1/HBaseClientKVIterator.java | 6 +++++-
2 files changed, 6 insertions(+), 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-kylin/blob/65a337a4/invertedindex/src/main/java/org/apache/kylin/invertedindex/model/IIKeyValueCodec.java
----------------------------------------------------------------------
diff --git a/invertedindex/src/main/java/org/apache/kylin/invertedindex/model/IIKeyValueCodec.java b/invertedindex/src/main/java/org/apache/kylin/invertedindex/model/IIKeyValueCodec.java
index eebf756..7e54a98 100644
--- a/invertedindex/src/main/java/org/apache/kylin/invertedindex/model/IIKeyValueCodec.java
+++ b/invertedindex/src/main/java/org/apache/kylin/invertedindex/model/IIKeyValueCodec.java
@@ -199,7 +199,7 @@ public class IIKeyValueCodec implements KeyValueCodec {
valueContainers[curCol] = c;
} else {
final ImmutableBytesWritable dictBytes = row.getDictionary();
- if (dictBytes.get() != null && dictBytes.getLength() != 0) {
+ if (dictBytes.getLength() != 0) {
final Dictionary<?> dictionary = DictionarySerializer.deserialize(new ByteArray(dictBytes.get(), dictBytes.getOffset(), dictBytes.getLength()));
CompressedValueContainer c = new CompressedValueContainer(dictionary.getSizeOfId(), dictionary.getMaxId() - dictionary.getMinId() + 1, 0);
c.fromBytes(row.getValue());
http://git-wip-us.apache.org/repos/asf/incubator-kylin/blob/65a337a4/storage-hbase/src/main/java/org/apache/kylin/storage/hbase/cube/v1/HBaseClientKVIterator.java
----------------------------------------------------------------------
diff --git a/storage-hbase/src/main/java/org/apache/kylin/storage/hbase/cube/v1/HBaseClientKVIterator.java b/storage-hbase/src/main/java/org/apache/kylin/storage/hbase/cube/v1/HBaseClientKVIterator.java
index b18d258..7920a8a 100644
--- a/storage-hbase/src/main/java/org/apache/kylin/storage/hbase/cube/v1/HBaseClientKVIterator.java
+++ b/storage-hbase/src/main/java/org/apache/kylin/storage/hbase/cube/v1/HBaseClientKVIterator.java
@@ -69,6 +69,7 @@ public class HBaseClientKVIterator implements Iterable<IIRow>, Closeable {
ImmutableBytesWritable value = new ImmutableBytesWritable();
ImmutableBytesWritable dict = new ImmutableBytesWritable();
IIRow pair = new IIRow(key, value, dict);
+ static final byte[] EMPTY_BYTES = new byte[0];
@Override
public boolean hasNext() {
@@ -82,8 +83,11 @@ public class HBaseClientKVIterator implements Iterable<IIRow>, Closeable {
key.set(c.getRowArray(), c.getRowOffset(), c.getRowLength());
value.set(c.getValueArray(), c.getValueOffset(), c.getValueLength());
c = r.getColumnLatestCell(IIDesc.HBASE_FAMILY_BYTES, IIDesc.HBASE_DICTIONARY_BYTES);
- if (c != null)
+ if (c != null) {
dict.set(c.getValueArray(), c.getValueOffset(), c.getValueLength());
+ } else {
+ dict.set(EMPTY_BYTES);
+ }
return pair;
}