本文整理了Java中org.apache.kylin.common.util.Bytes.iterateOnSplits()
方法的一些代码示例,展示了Bytes.iterateOnSplits()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Bytes.iterateOnSplits()
方法的具体详情如下:
包路径:org.apache.kylin.common.util.Bytes
类名称:Bytes
方法名:iterateOnSplits
[英]Iterate over keys within the passed range, splitting at an [a,b) boundary.
[中]迭代传递范围内的键,在[a,b]边界处拆分。
代码示例来源:origin: apache/kylin
/**
* Iterate over keys within the passed range, splitting at an [a,b) boundary.
*/
public static Iterable<byte[]> iterateOnSplits(final byte[] a, final byte[] b, final int num) {
return iterateOnSplits(a, b, false, num);
}
代码示例来源:origin: apache/kylin
/**
* Split passed range. Expensive operation relatively. Uses BigInteger math.
* Useful splitting ranges for MapReduce jobs.
*
* @param a Beginning of range
* @param b End of range
* @param inclusive Whether the end of range is prefix-inclusive or is
* considered an exclusive boundary. Automatic splits are generally exclusive
* and manual splits with an explicit range utilize an inclusive end of range.
* @param num Number of times to split range. Pass 1 if you want to split
* the range in two; i.e. one split.
* @return Array of dividing values
*/
public static byte[][] split(final byte[] a, final byte[] b, boolean inclusive, final int num) {
byte[][] ret = new byte[num + 2][];
int i = 0;
Iterable<byte[]> iter = iterateOnSplits(a, b, inclusive, num);
if (iter == null)
return null;
for (byte[] elem : iter) {
ret[i++] = elem;
}
return ret;
}
代码示例来源:origin: org.apache.kylin/kylin-core-common
/**
* Iterate over keys within the passed range, splitting at an [a,b) boundary.
*/
public static Iterable<byte[]> iterateOnSplits(final byte[] a, final byte[] b, final int num) {
return iterateOnSplits(a, b, false, num);
}
代码示例来源:origin: org.apache.kylin/kylin-common
/**
* Iterate over keys within the passed range, splitting at an [a,b) boundary.
*/
public static Iterable<byte[]> iterateOnSplits(final byte[] a, final byte[] b, final int num) {
return iterateOnSplits(a, b, false, num);
}
代码示例来源:origin: org.apache.kylin/kylin-core-common
/**
* Split passed range. Expensive operation relatively. Uses BigInteger math.
* Useful splitting ranges for MapReduce jobs.
*
* @param a Beginning of range
* @param b End of range
* @param inclusive Whether the end of range is prefix-inclusive or is
* considered an exclusive boundary. Automatic splits are generally exclusive
* and manual splits with an explicit range utilize an inclusive end of range.
* @param num Number of times to split range. Pass 1 if you want to split
* the range in two; i.e. one split.
* @return Array of dividing values
*/
public static byte[][] split(final byte[] a, final byte[] b, boolean inclusive, final int num) {
byte[][] ret = new byte[num + 2][];
int i = 0;
Iterable<byte[]> iter = iterateOnSplits(a, b, inclusive, num);
if (iter == null)
return null;
for (byte[] elem : iter) {
ret[i++] = elem;
}
return ret;
}
代码示例来源:origin: org.apache.kylin/kylin-common
/**
* Split passed range. Expensive operation relatively. Uses BigInteger math.
* Useful splitting ranges for MapReduce jobs.
*
* @param a Beginning of range
* @param b End of range
* @param inclusive Whether the end of range is prefix-inclusive or is
* considered an exclusive boundary. Automatic splits are generally exclusive
* and manual splits with an explicit range utilize an inclusive end of range.
* @param num Number of times to split range. Pass 1 if you want to split
* the range in two; i.e. one split.
* @return Array of dividing values
*/
public static byte[][] split(final byte[] a, final byte[] b, boolean inclusive, final int num) {
byte[][] ret = new byte[num + 2][];
int i = 0;
Iterable<byte[]> iter = iterateOnSplits(a, b, inclusive, num);
if (iter == null)
return null;
for (byte[] elem : iter) {
ret[i++] = elem;
}
return ret;
}
内容来源于网络,如有侵权,请联系作者删除!