Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update deprecated usages of SequenceFile.createWriter() #2499

Open
wants to merge 8 commits into
base: integration
Choose a base branch
from
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
import org.apache.hadoop.fs.FileSystem;
import org.apache.hadoop.fs.Path;
import org.apache.hadoop.io.SequenceFile;
import org.apache.hadoop.io.SequenceFile.Writer;
import org.apache.hadoop.io.Text;
import org.apache.hadoop.mapreduce.OutputCommitter;
import org.apache.hadoop.mapreduce.RecordWriter;
Expand Down Expand Up @@ -594,7 +595,8 @@ public void close(TaskAttemptContext context) throws IOException, InterruptedExc
if (generateMapFileRowKeys && !shardMapFileRowKeys.isEmpty()) {
log.info("Writing mapFileRowKeys");
Path shardMapFilePath = new Path(workDir, getUniqueFile(context, "mapFileRowKeys", ".lst"));
try (SequenceFile.Writer output = SequenceFile.createWriter(fs, conf, shardMapFilePath, Text.class, Text.class)) {
try (Writer output = SequenceFile.createWriter(conf, Writer.file(shardMapFilePath), Writer.keyClass(Text.class),
Writer.valueClass(Text.class))) {
for (Map.Entry<String,Set<Text>> entry : shardMapFileRowKeys.entrySet()) {
Path path = shardMapFiles.get(entry.getKey());
Text pathText = new Text(path.getParent().getName() + "/" + path.getName());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
import org.apache.hadoop.fs.RawLocalFileSystem;
import org.apache.hadoop.io.LongWritable;
import org.apache.hadoop.io.SequenceFile;
import org.apache.hadoop.io.SequenceFile.Writer;
import org.apache.hadoop.io.Text;
import org.apache.hadoop.mapreduce.InputSplit;
import org.apache.hadoop.mapreduce.MapContext;
Expand Down Expand Up @@ -264,8 +265,8 @@ private void ingestTestData(Configuration conf, TestFileLoader loader) throws IO
private RawLocalFileSystem createSequenceFile(Configuration conf, Path path, TestFileLoader loader) throws IOException {
RawLocalFileSystem rfs = new RawLocalFileSystem();
rfs.setConf(conf);

try (SequenceFile.Writer seqWriter = new SequenceFile.Writer(rfs, conf, path, Text.class, RawRecordContainerImpl.class)) {
try (Writer seqWriter = SequenceFile.createWriter(conf, Writer.file(path), Writer.keyClass(Text.class),
Writer.valueClass(RawRecordContainerImpl.class))) {
loader.loadTestData(seqWriter);
return rfs;
}
Expand Down
Loading