public final class ChunkedWriter extends Object implements Closeable
Constructor and Description |
---|
ChunkedWriter(org.apache.hadoop.conf.Configuration conf,
int chunkSizeInMB,
org.apache.hadoop.fs.Path output) |
Modifier and Type | Method and Description |
---|---|
void |
close() |
void |
write(String key,
String value)
Writes a new key-value pair, creating a new sequence file if necessary.
|
public ChunkedWriter(org.apache.hadoop.conf.Configuration conf, int chunkSizeInMB, org.apache.hadoop.fs.Path output) throws IOException
conf
- needed by Hadoop to know what filesystem implementation to use.chunkSizeInMB
- approximate size of each file, in Megabytes.output
- directory where the sequence files will be created.IOException
public void write(String key, String value) throws IOException
IOException
public void close() throws IOException
close
in interface Closeable
close
in interface AutoCloseable
IOException
Copyright © 2008–2017 The Apache Software Foundation. All rights reserved.