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

expose flow object to mutate function #501

Merged
merged 1 commit into from
May 12, 2014
Merged
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 @@ -16,6 +16,7 @@

package com.twitter.summingbird.scalding

import cascading.flow.Flow
import com.twitter.algebird.{ Monoid, Semigroup, Monad }
import com.twitter.algebird.{
Universe,
Expand Down Expand Up @@ -630,7 +631,12 @@ class Scalding(

def run(state: WaitingState[Interval[Timestamp]],
mode: Mode,
pf: PipeFactory[Any]): WaitingState[Interval[Timestamp]] = {
pf: PipeFactory[Any]): WaitingState[Interval[Timestamp]] = run(state, mode, pf, (f: Flow[_]) => Unit)

def run(state: WaitingState[Interval[Timestamp]],
mode: Mode,
pf: PipeFactory[Any],
mutate: Flow[_] => Unit): WaitingState[Interval[Timestamp]] = {

mode match {
case Hdfs(_, conf) =>
Expand All @@ -647,6 +653,7 @@ class Scalding(
case Left(errs) =>
prepareState.fail(FlowPlanException(errs))
case Right((ts,flow)) =>
mutate(flow)
prepareState.willAccept(ts) match {
case Right(runningState) =>
try {
Expand Down