private Integer getLgid(MutableByteSequence mbs, ColumnUpdate cu) { mbs.setArray(cu.getColumnFamily(), 0, cu.getColumnFamily().length); Integer lgid = colfamToLgidMap.get(mbs); if (lgid == null) lgid = groups.length; return lgid; } }
private static void read(DataInput in, MutableByteSequence mbseqDestination, int len) throws IOException { if (mbseqDestination.getBackingArray().length < len) { mbseqDestination.setArray(new byte[UnsynchronizedBuffer.nextArraySize(len)], 0, 0); } in.readFully(mbseqDestination.getBackingArray(), 0, len); mbseqDestination.setLength(len); }
private static void readPrefix(DataInput in, MutableByteSequence dest, ByteSequence prefixSource) throws IOException { int prefixLen = WritableUtils.readVInt(in); int remainingLen = WritableUtils.readVInt(in); int len = prefixLen + remainingLen; if (dest.getBackingArray().length < len) { dest.setArray(new byte[UnsynchronizedBuffer.nextArraySize(len)], 0, 0); } if (prefixSource.isBackedByArray()) { System.arraycopy(prefixSource.getBackingArray(), prefixSource.offset(), dest.getBackingArray(), 0, prefixLen); } else { byte[] prefixArray = prefixSource.toArray(); System.arraycopy(prefixArray, 0, dest.getBackingArray(), 0, prefixLen); } // read remaining in.readFully(dest.getBackingArray(), prefixLen, remainingLen); dest.setLength(len); }
private Integer getLgid(MutableByteSequence mbs, ColumnUpdate cu) { mbs.setArray(cu.getColumnFamily(), 0, cu.getColumnFamily().length); Integer lgid = colfamToLgidMap.get(mbs); if (lgid == null) lgid = groups.length; return lgid; } }
private static void read(DataInput in, MutableByteSequence mbseqDestination, int len) throws IOException { if (mbseqDestination.getBackingArray().length < len) { mbseqDestination.setArray(new byte[UnsynchronizedBuffer.nextArraySize(len)], 0, 0); } in.readFully(mbseqDestination.getBackingArray(), 0, len); mbseqDestination.setLength(len); }
private static void readPrefix(DataInput in, MutableByteSequence dest, ByteSequence prefixSource) throws IOException { int prefixLen = WritableUtils.readVInt(in); int remainingLen = WritableUtils.readVInt(in); int len = prefixLen + remainingLen; if (dest.getBackingArray().length < len) { dest.setArray(new byte[UnsynchronizedBuffer.nextArraySize(len)], 0, 0); } if (prefixSource.isBackedByArray()) { System.arraycopy(prefixSource.getBackingArray(), prefixSource.offset(), dest.getBackingArray(), 0, prefixLen); } else { byte[] prefixArray = prefixSource.toArray(); System.arraycopy(prefixArray, 0, dest.getBackingArray(), 0, prefixLen); } // read remaining in.readFully(dest.getBackingArray(), prefixLen, remainingLen); dest.setLength(len); }