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

fix hadoop MR configuration so hadoop vm will work out of the box #63

Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -130,19 +130,19 @@ protected void map(LongWritable key, Text value, Context context) throws IOExcep
LOGGER.info("*********************************************************************");

try {
createSegment(_inputFilePath, schema, lineSplits[2]);
createSegment(_inputFilePath, schema, lineSplits[2],_properties);
LOGGER.info("finished segment creation job successfully");
} catch (Exception e) {
LOGGER.error("Got exceptions during creating segments!", e);
}

context.write(new LongWritable(Long.parseLong(lineSplits[2])),
new Text(FileSystem.get(new Configuration()).listStatus(new Path(_localHdfsSegmentTarPath + "/"))[0].getPath().getName()));
new Text(FileSystem.get(_properties).listStatus(new Path(_localHdfsSegmentTarPath + "/"))[0].getPath().getName()));
LOGGER.info("finished the job successfully");
}

private String createSegment(String dataFilePath, Schema schema, String seqId) throws Exception {
final FileSystem fs = FileSystem.get(new Configuration());
private String createSegment(String dataFilePath, Schema schema, String seqId, Configuration configuration) throws Exception {
final FileSystem fs = FileSystem.get(configuration);
final Path hdfsDataPath = new Path(dataFilePath);
final File dataPath = new File(_currentDiskWorkDir, "data");
if (dataPath.exists()) {
Expand Down