MCPcopy Create free account
hub / github.com/apache/nutch / split

Method split

src/java/org/apache/nutch/util/Bytes.java:1200–1210  ·  view source on GitHub ↗

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 num Number of times to split range. Pass 1 if you want to split the range in two; i.e. o

(final byte[] a, final byte[] b, final int num)

Source from the content-addressed store, hash-verified

1198 * @return Array of dividing values
1199 */
1200 public static byte[][] split(final byte[] a, final byte[] b, final int num) {
1201 byte[][] ret = new byte[num + 2][];
1202 int i = 0;
1203 Iterable<byte[]> iter = iterateOnSplits(a, b, num);
1204 if (iter == null)
1205 return null;
1206 for (byte[] elem : iter) {
1207 ret[i++] = elem;
1208 }
1209 return ret;
1210 }
1211
1212 /**
1213 * Iterate over keys within the passed inclusive range.

Callers 15

filterMethod · 0.80
openMethod · 0.80
stripTagsMethod · 0.80
testEncodingDetectionMethod · 0.80
NormalizedURLMethod · 0.80
getPartsMethod · 0.80
HTMLLanguageParserClass · 0.80
parseLanguageMethod · 0.80
filterMethod · 0.80
normalizeMethod · 0.80
openMethod · 0.80

Calls 1

iterateOnSplitsMethod · 0.95

Tested by 3

testEncodingDetectionMethod · 0.64
NormalizedURLMethod · 0.64