public static class BCFile.Reader extends Object implements Closeable
Modifier and Type | Class and Description |
---|---|
static class |
BCFile.Reader.BlockReader
Access point to read a block.
|
Constructor and Description |
---|
Reader(byte[] serializedMetadata,
InputStreamType fin,
org.apache.hadoop.conf.Configuration conf,
CryptoService cryptoService) |
Reader(InputStreamType fin,
long fileLength,
org.apache.hadoop.conf.Configuration conf,
CryptoService cryptoService) |
Modifier and Type | Method and Description |
---|---|
void |
close()
Finishing reading the BCFile.
|
int |
getBlockCount()
Get the number of data blocks.
|
BCFile.Reader.BlockReader |
getDataBlock(int blockIndex)
Stream access to a Data Block.
|
BCFile.Reader.BlockReader |
getDataBlock(long offset,
long compressedSize,
long rawSize) |
long |
getDataBlockRawSize(int blockIndex) |
BCFile.Reader.BlockReader |
getMetaBlock(String name)
Stream access to a Meta Block.
|
long |
getMetaBlockRawSize(String name) |
byte[] |
serializeMetadata(int maxSize) |
public Reader(InputStreamType fin, long fileLength, org.apache.hadoop.conf.Configuration conf, CryptoService cryptoService) throws IOException
IOException
public Reader(byte[] serializedMetadata, InputStreamType fin, org.apache.hadoop.conf.Configuration conf, CryptoService cryptoService) throws IOException
IOException
public byte[] serializeMetadata(int maxSize)
public void close()
close
in interface Closeable
close
in interface AutoCloseable
public int getBlockCount()
public BCFile.Reader.BlockReader getMetaBlock(String name) throws IOException, MetaBlockDoesNotExist
name
- meta block nameMetaBlockDoesNotExist
- The Meta Block with the given name does not exist.IOException
public long getMetaBlockRawSize(String name) throws IOException, MetaBlockDoesNotExist
IOException
MetaBlockDoesNotExist
public BCFile.Reader.BlockReader getDataBlock(int blockIndex) throws IOException
blockIndex
- 0-based data block index.IOException
public BCFile.Reader.BlockReader getDataBlock(long offset, long compressedSize, long rawSize) throws IOException
IOException
public long getDataBlockRawSize(int blockIndex)
Copyright © 2011–2019 The Apache Software Foundation. All rights reserved.