Skip to content
This repository has been archived by the owner on Jan 20, 2022. It is now read-only.

Add some hadoop defaults to the builder API #359

Merged
merged 1 commit into from
Nov 12, 2013
Merged
Show file tree
Hide file tree
Changes from all commits
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
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,16 @@ case class ScaldingEnv(override val jobName: String, inargs: Array[String])

val scald = Scalding(name, opts)
.withRegistrars(ajob.registrars ++ builder.registrar.getRegistrars.asScala)
.withConfigUpdater {
// Set these before the user settings, so that the user
// can change them if needed

// Make sure we use block compression from mappers to reducers
_.put("mapred.output.compression.type", "BLOCK")
.put("io.compression.codec.lzo.compression.level", "3")
.put("mapred.output.compress", "true")
.put("mapred.compress.map.output", "true")
}
.withConfigUpdater{ c =>
c.updated(ajob.transformConfig(c.toMap))
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -534,6 +534,7 @@ class Scalding(
Scalding.logger.debug("Removes: {}", scaldingConfig.removes)
Scalding.logger.debug("Updates: {}", scaldingConfig.updates)

// now let the user do her thing:
val transformedConfig = transformConfig(scaldingConfig)

Scalding.logger.debug("User+Serialization config changes:")
Expand All @@ -544,6 +545,7 @@ class Scalding(
transformedConfig.updates.foreach(kv => conf.set(kv._1, kv._2.toString))
// Store the options used:
conf.set("summingbird.options", options.toString)
conf.set("summingbird.jobname", jobName)

def ifUnset(k: String, v: String) { if(null == conf.get(k)) { conf.set(k, v) } }
// Set the mapside cache size, this is important to not be too small
Expand Down