Skip to content

Commit

Permalink
Merge pull request #316 from pcadabam/master
Browse files Browse the repository at this point in the history
Fix group in FsWriter
  • Loading branch information
pcadabam committed Sep 1, 2015
2 parents 6632b5b + 8c4d434 commit 292c270
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
import org.apache.commons.lang.StringUtils;
import org.apache.hadoop.conf.Configuration;
import org.apache.log4j.Logger;

import org.joda.time.DateTime;
import org.joda.time.DateTimeZone;

Expand Down
7 changes: 6 additions & 1 deletion gobblin-core/src/main/java/gobblin/writer/FsDataWriter.java
Original file line number Diff line number Diff line change
Expand Up @@ -122,9 +122,14 @@ public FsDataWriter(State properties, String fileName, int numBranches, int bran
this.stagingFileOutputStream = this.closer.register(this.fs.create(this.stagingFile, this.filePermission, true,
this.bufferSize, this.replicationFactor, this.blockSize, null));

this.group = Optional.fromNullable(properties.getProp(ConfigurationKeys.WRITER_GROUP_NAME));
this.group =
Optional.fromNullable(properties.getProp(ForkOperatorUtils.getPropertyNameForBranch(
ConfigurationKeys.WRITER_GROUP_NAME, numBranches, branchId)));

if (this.group.isPresent()) {
HadoopUtils.setGroup(this.fs, this.stagingFile, this.group.get());
} else {
LOG.warn("No group found for " + this.stagingFile);
}

// Create the parent directory of the output file if it does not exist
Expand Down

0 comments on commit 292c270

Please sign in to comment.