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); } }
for (Iterator<MetaIndexEntry> it = metaBlks.iterator(); it.hasNext();) { MetaIndexEntry e = it.next(); metaSize += e.getRegion().getCompressedSize(); metaSizeUncompressed += e.getRegion().getRawSize(); if (e.getCompressionAlgorithm() != Compression.Algorithm.NONE) { calculateCompression = true; metaBlkEntrySet.iterator(); it.hasNext();) { Map.Entry<String, MetaIndexEntry> e = it.next(); String blkName = e.getValue().getMetaName(); BlockRegion region = e.getValue().getRegion(); String blkCompression = e.getValue().getCompressionAlgorithm().getName(); out.printf("%s %s %s %s %s%n", Align.format(blkName, nameWidth, Align.LEFT), Align.format(region.getOffset(), offsetWidth,
public void write(DataOutput out) throws IOException { Utils.writeVInt(out, index.size()); for (MetaIndexEntry indexEntry : index.values()) { indexEntry.write(out); } } }
for (Iterator<MetaIndexEntry> it = metaBlks.iterator(); it.hasNext();) { MetaIndexEntry e = it.next(); metaSize += e.getRegion().getCompressedSize(); metaSizeUncompressed += e.getRegion().getRawSize(); if (e.getCompressionAlgorithm() != Compression.Algorithm.NONE) { calculateCompression = true; metaBlkEntrySet.iterator(); it.hasNext();) { Map.Entry<String, MetaIndexEntry> e = it.next(); String blkName = e.getValue().getMetaName(); BlockRegion region = e.getValue().getRegion(); String blkCompression = e.getValue().getCompressionAlgorithm().getName(); out.printf("%s %s %s %s %s%n", Align.format(blkName, nameWidth, Align.LEFT), Align.format(region.getOffset(), offsetWidth,
for (Iterator<MetaIndexEntry> it = metaBlks.iterator(); it.hasNext();) { MetaIndexEntry e = it.next(); metaSize += e.getRegion().getCompressedSize(); metaSizeUncompressed += e.getRegion().getRawSize(); if (e.getCompressionAlgorithm() != Compression.Algorithm.NONE) { calculateCompression = true; metaBlkEntrySet.iterator(); it.hasNext();) { Map.Entry<String, MetaIndexEntry> e = it.next(); String blkName = e.getValue().getMetaName(); BlockRegion region = e.getValue().getRegion(); String blkCompression = e.getValue().getCompressionAlgorithm().getName(); out.printf("%s %s %s %s %s%n", Align.format(blkName, nameWidth, Align.LEFT), Align.format(region.getOffset(), offsetWidth,
for (Iterator<MetaIndexEntry> it = metaBlks.iterator(); it.hasNext();) { MetaIndexEntry e = it.next(); metaSize += e.getRegion().getCompressedSize(); metaSizeUncompressed += e.getRegion().getRawSize(); if (e.getCompressionAlgorithm() != Compression.Algorithm.NONE) { calculateCompression = true; metaBlkEntrySet.iterator(); it.hasNext();) { Map.Entry<String, MetaIndexEntry> e = it.next(); String blkName = e.getValue().getMetaName(); BlockRegion region = e.getValue().getRegion(); String blkCompression = e.getValue().getCompressionAlgorithm().getName(); out.printf("%s %s %s %s %s\n", Align.format(blkName, nameWidth, Align.LEFT), Align.format(region.getOffset(), offsetWidth,
for (Iterator<MetaIndexEntry> it = metaBlks.iterator(); it.hasNext();) { MetaIndexEntry e = it.next(); metaSize += e.getRegion().getCompressedSize(); metaSizeUncompressed += e.getRegion().getRawSize(); if (e.getCompressionAlgorithm() != Compression.Algorithm.NONE) { calculateCompression = true; metaBlkEntrySet.iterator(); it.hasNext();) { Map.Entry<String, MetaIndexEntry> e = it.next(); String blkName = e.getValue().getMetaName(); BlockRegion region = e.getValue().getRegion(); String blkCompression = e.getValue().getCompressionAlgorithm().getName(); out.printf("%s %s %s %s %s%n", Align.format(blkName, nameWidth, Align.LEFT), Align.format(region.getOffset(), offsetWidth,
for (Iterator<MetaIndexEntry> it = metaBlks.iterator(); it.hasNext();) { MetaIndexEntry e = it.next(); metaSize += e.getRegion().getCompressedSize(); metaSizeUncompressed += e.getRegion().getRawSize(); if (e.getCompressionAlgorithm() != Compression.Algorithm.NONE) { calculateCompression = true; metaBlkEntrySet.iterator(); it.hasNext();) { Map.Entry<String, MetaIndexEntry> e = it.next(); String blkName = e.getValue().getMetaName(); BlockRegion region = e.getValue().getRegion(); String blkCompression = e.getValue().getCompressionAlgorithm().getName(); out.printf("%s %s %s %s %s%n", Align.format(blkName, nameWidth, Align.LEFT), Align.format(region.getOffset(), offsetWidth,
/** * Stream access to a Meta Block. * * @param name * meta block name * @return BlockReader input stream for reading the meta block. * @throws IOException * @throws MetaBlockDoesNotExist * The Meta Block with the given name does not exist. */ public BlockReader getMetaBlock(String name) throws IOException, MetaBlockDoesNotExist { MetaIndexEntry imeBCIndex = metaIndex.getMetaByName(name); if (imeBCIndex == null) { throw new MetaBlockDoesNotExist("name=" + name); } BlockRegion region = imeBCIndex.getRegion(); return createReader(imeBCIndex.getCompressionAlgorithm(), region); }
/** * Stream access to a Meta Block. * * @param name * meta block name * @return BlockReader input stream for reading the meta block. * @throws IOException * @throws MetaBlockDoesNotExist * The Meta Block with the given name does not exist. */ public BlockReader getMetaBlock(String name) throws IOException, MetaBlockDoesNotExist { MetaIndexEntry imeBCIndex = metaIndex.getMetaByName(name); if (imeBCIndex == null) { throw new MetaBlockDoesNotExist("name=" + name); } BlockRegion region = imeBCIndex.getRegion(); return createReader(imeBCIndex.getCompressionAlgorithm(), region); }
/** * Stream access to a Meta Block. * * @param name * meta block name * @return BlockReader input stream for reading the meta block. * @throws IOException * @throws MetaBlockDoesNotExist * The Meta Block with the given name does not exist. */ public BlockReader getMetaBlock(String name) throws IOException, MetaBlockDoesNotExist { MetaIndexEntry imeBCIndex = metaIndex.getMetaByName(name); if (imeBCIndex == null) { throw new MetaBlockDoesNotExist("name=" + name); } BlockRegion region = imeBCIndex.getRegion(); return createReader(imeBCIndex.getCompressionAlgorithm(), region); }
/** * Stream access to a Meta Block. * * @param name * meta block name * @return BlockReader input stream for reading the meta block. * @throws IOException * @throws MetaBlockDoesNotExist * The Meta Block with the given name does not exist. */ public BlockReader getMetaBlock(String name) throws IOException, MetaBlockDoesNotExist { MetaIndexEntry imeBCIndex = metaIndex.getMetaByName(name); if (imeBCIndex == null) { throw new MetaBlockDoesNotExist("name=" + name); } BlockRegion region = imeBCIndex.getRegion(); return createReader(imeBCIndex.getCompressionAlgorithm(), region); }
/** * Stream access to a Meta Block. * * @param name * meta block name * @return BlockReader input stream for reading the meta block. * @throws IOException * @throws MetaBlockDoesNotExist * The Meta Block with the given name does not exist. */ public BlockReader getMetaBlock(String name) throws IOException, MetaBlockDoesNotExist { MetaIndexEntry imeBCIndex = metaIndex.getMetaByName(name); if (imeBCIndex == null) { throw new MetaBlockDoesNotExist("name=" + name); } BlockRegion region = imeBCIndex.getRegion(); return createReader(imeBCIndex.getCompressionAlgorithm(), region); }
public void addEntry(MetaIndexEntry indexEntry) { index.put(indexEntry.getMetaName(), indexEntry); }
public void addEntry(MetaIndexEntry indexEntry) { index.put(indexEntry.getMetaName(), indexEntry); }
public void addEntry(MetaIndexEntry indexEntry) { index.put(indexEntry.getMetaName(), indexEntry); }
@Override public void register(long raw, long begin, long end) { metaIndex.addEntry(new MetaIndexEntry(name, compressAlgo, new BlockRegion(begin, end - begin, raw))); } }
public void register(long raw, long begin, long end) { metaIndex.addEntry(new MetaIndexEntry(name, compressAlgo, new BlockRegion(begin, end - begin, raw))); } }
public void write(DataOutput out) throws IOException { Utils.writeVInt(out, index.size()); for (MetaIndexEntry indexEntry : index.values()) { indexEntry.write(out); } } }
public void write(DataOutput out) throws IOException { Utils.writeVInt(out, index.size()); for (MetaIndexEntry indexEntry : index.values()) { indexEntry.write(out); } } }