public static class BCFile.Writer extends Object implements Closeable
Modifier and Type | Class and Description |
---|---|
class |
BCFile.Writer.BlockAppender
Access point to stuff data into a block.
|
Constructor and Description |
---|
BCFile.Writer(org.apache.hadoop.fs.FSDataOutputStream fout,
String compressionName,
org.apache.hadoop.conf.Configuration conf,
boolean trackDataBlocks)
Constructor
|
Modifier and Type | Method and Description |
---|---|
void |
close()
Close the BCFile Writer.
|
BCFile.Writer.BlockAppender |
prepareDataBlock()
Create a Data Block and obtain an output stream for adding data into the block.
|
BCFile.Writer.BlockAppender |
prepareMetaBlock(String name)
Create a Meta Block and obtain an output stream for adding data into the block.
|
BCFile.Writer.BlockAppender |
prepareMetaBlock(String name,
String compressionName)
Create a Meta Block and obtain an output stream for adding data into the block.
|
public BCFile.Writer(org.apache.hadoop.fs.FSDataOutputStream fout, String compressionName, org.apache.hadoop.conf.Configuration conf, boolean trackDataBlocks) throws IOException
fout
- FS output stream.compressionName
- Name of the compression algorithm, which will be used for all data blocks.IOException
Compression.getSupportedAlgorithms()
public void close() throws IOException
close
is not allowed and may lead to undetermined results.close
in interface Closeable
close
in interface AutoCloseable
IOException
public BCFile.Writer.BlockAppender prepareMetaBlock(String name, String compressionName) throws IOException, MetaBlockAlreadyExists
name
- The name of the Meta Block. The name must not conflict with existing Meta Blocks.compressionName
- The name of the compression algorithm to be used.IOException
MetaBlockAlreadyExists
- If the meta block with the name already exists.public BCFile.Writer.BlockAppender prepareMetaBlock(String name) throws IOException, MetaBlockAlreadyExists
name
- The name of the Meta Block. The name must not conflict with existing Meta Blocks.MetaBlockAlreadyExists
- If the meta block with the name already exists.IOException
public BCFile.Writer.BlockAppender prepareDataBlock() throws IOException
IOException
Copyright © 2012 The Apache Software Foundation. All Rights Reserved.