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

Make FileOutputCommiter as default #86

Merged
merged 3 commits into from
Aug 25, 2018
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -197,10 +197,8 @@ configure(allProjs) {
ignoreFailures = true
include '**/*.java', '**/*.scala'
exclude '**/org/apache/spark/ml/SparkDefaultParamsReadWrite.scala',
'**/com/salesforce/op/utils/io/DirectMapreduceOutputCommitter.scala',
'**/com/salesforce/op/test/TestSparkContext.scala',
'**/com/salesforce/op/test/TempDirectoryTest.scala',
'**/com/salesforce/op/utils/io/DirectOutputCommitter.scala',
'**/com/salesforce/op/stages/impl/tuning/OpCrossValidation.scala',
'**/com/salesforce/op/stages/impl/tuning/OpTrainValidationSplit.scala',
'**/com/salesforce/op/test/*.java',
Expand Down
10 changes: 10 additions & 0 deletions docs/installation/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,13 @@
* Clone the TransmogrifAI repo: `git clone https://github.com/salesforce/TransmogrifAI.git`
* Build the project: `cd TransmogrifAI && ./gradlew compileTestScala installDist`
* Start hacking

# (Optional) Configuration
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not aure if this belongs here or we need a new section. @snabar @leahmcguire wdyt?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we don't need to document output committer conf prominently since this is well documented for Hadoop and by extension for Spark itself. So probably not the time to modify index.md at this time either.


## Custom Output Committer's

Depending on the deployment approach, we can choose to implement/use customized OutputCommitter classes. Following properties can be configured to override default classes and use customized output committer classes.
* `spark.hadoop.mapred.output.committer.class`
* `spark.hadoop.spark.sql.sources.outputCommitterClass`

* [S3A Committer](https://hadoop.apache.org/docs/current3/hadoop-aws/tools/hadoop-aws/committers.html), [Cloud Integration](https://people.apache.org/~pwendell/spark-nightly/spark-master-docs/latest/cloud-integration.html#configuring) guides provide more details on the topic.
3 changes: 1 addition & 2 deletions gradle/spark.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,7 @@ task sparkSubmit(type: Exec, dependsOn: copyLog4jToSpark) {
"spark.hadoop.avro.output.codec=deflate",
"spark.hadoop.avro.mapred.deflate.level=6",
"spark.hadoop.validateOutputSpecs=false",
"spark.hadoop.mapred.output.committer.class=com.salesforce.op.utils.io.DirectOutputCommitter",
"spark.hadoop.spark.sql.sources.outputCommitterClass=com.salesforce.op.utils.io.DirectMapreduceOutputCommitter"
"spark.hadoop.mapreduce.fileoutputcommitter.algorithm.version=2"
].collect { ["--conf", it] }.flatten()

environment SPARK_HOME: sparkHome
Expand Down
3 changes: 1 addition & 2 deletions helloworld/gradle/spark.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,7 @@ task sparkSubmit(type: Exec, dependsOn: copyLog4jToSpark) {
"spark.hadoop.avro.output.codec=deflate",
"spark.hadoop.avro.mapred.deflate.level=6",
"spark.hadoop.validateOutputSpecs=false",
"spark.hadoop.mapred.output.committer.class=com.salesforce.op.utils.io.DirectOutputCommitter",
"spark.hadoop.spark.sql.sources.outputCommitterClass=com.salesforce.op.utils.io.DirectMapreduceOutputCommitter"
"spark.hadoop.mapreduce.fileoutputcommitter.algorithm.version=2"
].collect { ["--conf", it] }.flatten()

environment SPARK_HOME: sparkHome
Expand Down
3 changes: 1 addition & 2 deletions templates/simple/spark.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -197,8 +197,7 @@ task sparkSubmit(dependsOn: copyLog4jToSparkNoInstall) {
"spark.hadoop.avro.output.codec=deflate",
"spark.hadoop.avro.mapred.deflate.level=6",
"spark.hadoop.validateOutputSpecs=false",
"spark.hadoop.mapred.output.committer.class=com.salesforce.op.utils.io.DirectOutputCommitter",
"spark.hadoop.spark.sql.sources.outputCommitterClass=com.salesforce.op.utils.io.DirectMapreduceOutputCommitter"
"spark.hadoop.mapreduce.fileoutputcommitter.algorithm.version=2"
].collect { ["--conf", it] }.flatten()

def hadoopConfDir = System.env.HOME + "/.fake_hadoop_conf"
Expand Down

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ package com.salesforce.op.utils.io.avro

import java.net.URI

import com.salesforce.op.utils.io.DirectOutputCommitter
import com.salesforce.op.utils.spark.RichRDD._
import org.apache.avro.Schema
import org.apache.avro.generic.GenericRecord
Expand Down Expand Up @@ -156,7 +155,6 @@ object AvroInOut {

private def createJobConfFromContext(schema: String)(implicit sc: SparkSession) = {
val jobConf = new JobConf(sc.sparkContext.hadoopConfiguration)
jobConf.setOutputCommitter(classOf[DirectOutputCommitter])
AvroJob.setOutputSchema(jobConf, new Schema.Parser().parse(schema))
jobConf
}
Expand Down