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 2016/02/05 09:19:07 UTC
kylin git commit: bytes split max length limit
Repository: kylin
Updated Branches:
refs/heads/2.x-staging 0e1893783 -> 5b636df32
bytes split max length limit
Signed-off-by: fengyu <zh...@corp.netease.com>
Project: http://git-wip-us.apache.org/repos/asf/kylin/repo
Commit: http://git-wip-us.apache.org/repos/asf/kylin/commit/5b636df3
Tree: http://git-wip-us.apache.org/repos/asf/kylin/tree/5b636df3
Diff: http://git-wip-us.apache.org/repos/asf/kylin/diff/5b636df3
Branch: refs/heads/2.x-staging
Commit: 5b636df32cd56876fe1e2da6d1c98b9854e0c532
Parents: 0e18937
Author: fengyu <zh...@corp.netease.com>
Authored: Thu Jan 7 12:06:33 2016 +0800
Committer: shaofengshi <sh...@apache.org>
Committed: Fri Feb 5 16:17:32 2016 +0800
----------------------------------------------------------------------
.../java/org/apache/kylin/common/util/BytesSplitter.java | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/kylin/blob/5b636df3/core-common/src/main/java/org/apache/kylin/common/util/BytesSplitter.java
----------------------------------------------------------------------
diff --git a/core-common/src/main/java/org/apache/kylin/common/util/BytesSplitter.java b/core-common/src/main/java/org/apache/kylin/common/util/BytesSplitter.java
index 9f819ac..fc547c6 100644
--- a/core-common/src/main/java/org/apache/kylin/common/util/BytesSplitter.java
+++ b/core-common/src/main/java/org/apache/kylin/common/util/BytesSplitter.java
@@ -62,8 +62,11 @@ public class BytesSplitter {
for (int i = 0; i < byteLen; i++) {
if (bytes[i] == delimiter) {
SplittedBytes split = this.splitBuffers[this.bufferSize++];
- split.length = length;
+ if(length > split.value.length) {
+ length = split.value.length;
+ }
System.arraycopy(bytes, offset, split.value, 0, length);
+ split.length = length;
offset = i + 1;
length = 0;
} else {
@@ -71,6 +74,9 @@ public class BytesSplitter {
}
}
SplittedBytes split = this.splitBuffers[this.bufferSize++];
+ if(length > split.value.length) {
+ length = split.value.length;
+ }
System.arraycopy(bytes, offset, split.value, 0, length);
split.length = length;