/** * Reading the length of next chunk. * * @throws java.io.IOException * when no more data is available. */ private void readLength() throws IOException { remain = Utils.readVInt(in); if (remain >= 0) { lastChunk = true; } else { remain = -remain; } }
public TFileIndexEntry(DataInput in) throws IOException { int len = Utils.readVInt(in); key = new byte[len]; in.readFully(key, 0, len); kvEntries = Utils.readVLong(in); }
/** * Read a String as a VInt n, followed by n Bytes in Text format. * * @param in * The input stream. * @return The string * @throws IOException */ public static String readString(DataInput in) throws IOException { int length = readVInt(in); if (length == -1) return null; byte[] buffer = new byte[length]; in.readFully(buffer); return Text.decode(buffer); }
public MetaIndex(DataInput in) throws IOException { int count = Utils.readVInt(in); index = new TreeMap<String, MetaIndexEntry>(); for (int nx = 0; nx < count; nx++) { MetaIndexEntry indexEntry = new MetaIndexEntry(in); index.put(indexEntry.getMetaName(), indexEntry); } }
public DataIndex(DataInput in) throws IOException { defaultCompressionAlgorithm = Compression.getCompressionAlgorithmByName(Utils.readString(in)); int n = Utils.readVInt(in); listRegions = new ArrayList<BlockRegion>(n); for (int i = 0; i < n; i++) { BlockRegion region = new BlockRegion(in); listRegions.add(region); } }
index = new ArrayList<TFileIndexEntry>(entryCount); recordNumIndex = new ArrayList<Long>(entryCount); int size = Utils.readVInt(in); // size for the first key entry. if (size > 0) { byte[] buffer = new byte[size]; new DataInputStream(new ByteArrayInputStream(buffer, 0, size)); int firstKeyLength = Utils.readVInt(firstKeyInputStream); firstKey = new ByteArray(new byte[firstKeyLength]); firstKeyInputStream.readFully(firstKey.buffer()); size = Utils.readVInt(in); if (buffer.length < size) { buffer = new byte[size];
/** * check whether we have already successfully obtained the key. It also * initializes the valueInputStream. */ void checkKey() throws IOException { if (klen >= 0) return; if (atEnd()) { throw new EOFException("No key-value to read"); } klen = -1; vlen = -1; valueChecked = false; klen = Utils.readVInt(blkReader); blkReader.readFully(keyBuffer, 0, klen); valueBufferInputStream.reset(blkReader); if (valueBufferInputStream.isLastChunk()) { vlen = valueBufferInputStream.getRemain(); } }
public TFileIndexEntry(DataInput in) throws IOException { int len = Utils.readVInt(in); key = new byte[len]; in.readFully(key, 0, len); kvEntries = Utils.readVLong(in); }
public TFileIndexEntry(DataInput in) throws IOException { int len = Utils.readVInt(in); key = new byte[len]; in.readFully(key, 0, len); kvEntries = Utils.readVLong(in); }
public TFileIndexEntry(DataInput in) throws IOException { int len = Utils.readVInt(in); key = new byte[len]; in.readFully(key, 0, len); kvEntries = Utils.readVLong(in); }
public MetaIndex(DataInput in) throws IOException { int count = Utils.readVInt(in); index = new TreeMap<String, MetaIndexEntry>(); for (int nx = 0; nx < count; nx++) { MetaIndexEntry indexEntry = new MetaIndexEntry(in); index.put(indexEntry.getMetaName(), indexEntry); } }
public MetaIndex(DataInput in) throws IOException { int count = Utils.readVInt(in); index = new TreeMap<String, MetaIndexEntry>(); for (int nx = 0; nx < count; nx++) { MetaIndexEntry indexEntry = new MetaIndexEntry(in); index.put(indexEntry.getMetaName(), indexEntry); } }
public MetaIndex(DataInput in) throws IOException { int count = Utils.readVInt(in); index = new TreeMap<String, MetaIndexEntry>(); for (int nx = 0; nx < count; nx++) { MetaIndexEntry indexEntry = new MetaIndexEntry(in); index.put(indexEntry.getMetaName(), indexEntry); } }
public MetaIndex(DataInput in) throws IOException { int count = Utils.readVInt(in); index = new TreeMap<String, MetaIndexEntry>(); for (int nx = 0; nx < count; nx++) { MetaIndexEntry indexEntry = new MetaIndexEntry(in); index.put(indexEntry.getMetaName(), indexEntry); } }
public MetaIndex(DataInput in) throws IOException { int count = Utils.readVInt(in); index = new TreeMap<String, MetaIndexEntry>(); for (int nx = 0; nx < count; nx++) { MetaIndexEntry indexEntry = new MetaIndexEntry(in); index.put(indexEntry.getMetaName(), indexEntry); } }
public DataIndex(DataInput in) throws IOException { defaultCompressionAlgorithm = Compression.getCompressionAlgorithmByName(Utils.readString(in)); int n = Utils.readVInt(in); listRegions = new ArrayList<BlockRegion>(n); for (int i = 0; i < n; i++) { BlockRegion region = new BlockRegion(in); listRegions.add(region); } }
public DataIndex(DataInput in) throws IOException { defaultCompressionAlgorithm = Compression.getCompressionAlgorithmByName(Utils.readString(in)); int n = Utils.readVInt(in); listRegions = new ArrayList<BlockRegion>(n); for (int i = 0; i < n; i++) { BlockRegion region = new BlockRegion(in); listRegions.add(region); } }
public DataIndex(DataInput in) throws IOException { defaultCompressionAlgorithm = Compression.getCompressionAlgorithmByName(Utils.readString(in)); int n = Utils.readVInt(in); listRegions = new ArrayList<BlockRegion>(n); for (int i = 0; i < n; i++) { BlockRegion region = new BlockRegion(in); listRegions.add(region); } }
public DataIndex(DataInput in) throws IOException { defaultCompressionAlgorithm = Compression.getCompressionAlgorithmByName(Utils.readString(in)); int n = Utils.readVInt(in); listRegions = new ArrayList<BlockRegion>(n); for (int i = 0; i < n; i++) { BlockRegion region = new BlockRegion(in); listRegions.add(region); } }
public DataIndex(DataInput in) throws IOException { defaultCompressionAlgorithm = Compression.getCompressionAlgorithmByName(Utils.readString(in)); int n = Utils.readVInt(in); listRegions = new ArrayList<BlockRegion>(n); for (int i = 0; i < n; i++) { BlockRegion region = new BlockRegion(in); listRegions.add(region); } }