List of usage examples for org.apache.hadoop.io WritableComparator readVLong
public static long readVLong(byte[] bytes, int start) throws IOException
From source file:com.asakusafw.runtime.value.ByteArrayUtil.java
License:Apache License
static long readVLong(byte[] bytes, int offset) { try {// w w w . j a v a2 s . c o m return WritableComparator.readVLong(bytes, offset); } catch (IOException e) { throw new IllegalArgumentException(e); } }
From source file:org.apache.mrql.MR_long.java
License:Apache License
final public static int compare(byte[] x, int xs, int xl, byte[] y, int ys, int yl, int[] size) { try {/* ww w . jav a 2 s.co m*/ size[0] = 1 + WritableUtils.decodeVIntSize(x[xs]); long v = WritableComparator.readVLong(x, xs) - WritableComparator.readVLong(y, ys); return (v == 0) ? 0 : ((v > 0) ? 1 : -1); } catch (IOException e) { throw new Error(e); } }