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 |
---|
Writer(org.apache.hadoop.fs.FSDataOutputStream fout,
RateLimiter writeLimiter,
String compressionName,
org.apache.hadoop.conf.Configuration conf,
CryptoService cryptoService)
Constructor
|
Modifier and Type | Method and Description |
---|---|
void |
close()
Close the BCFile Writer.
|
long |
getLength() |
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.
|
public Writer(org.apache.hadoop.fs.FSDataOutputStream fout, RateLimiter writeLimiter, String compressionName, org.apache.hadoop.conf.Configuration conf, CryptoService cryptoService) throws IOException
fout
- FS output stream.compressionName
- Name of the compression algorithm, which will be used for all data blocks.IOException
Compression.getSupportedAlgorithms()
public long getLength()
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) 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 © 2011–2019 The Apache Software Foundation. All rights reserved.