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

SparkTask data type #1

Closed
adelbertc opened this issue Jun 27, 2015 · 0 comments
Closed

SparkTask data type #1

adelbertc opened this issue Jun 27, 2015 · 0 comments

Comments

@adelbertc
Copy link
Collaborator

.. or perhaps another name. It seems to be fairly common (based on my statistically significant sample size of like, 3) to define a Reader-y thing w/ SparkContext. I could imagine something like:

package object bec {
  type SparkTask[A] = Reader[SparkContext, A]
}

// or..

trait SparkTask[A] {
  def run(sc: SparkContext): A

  final def flatMap[B](f: A => SparkTask[B]): SparkTask[B] = ...
  final def map[B](f: A => B): SparkTask[B] = ...
}

object SparkTask {
  def pure[A](a: => A): SparkTask[A] = ...
}

The latter is what I've been using at $JOB. Would perhaps be of interest to add something like this to bec?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants