ComputationHandler and GeospaceHandler

This change adds the concept of a ComputationHandler, designed to perform computations for computed columns from one or more source columns during ingress / upserts.   It also adds a handler for Geospace / geo region coding of point columns that are ingressed.
Yes, good point.  Will correct.


On Wed, Jun 18, 2014 at 4:45 PM, Marc Slemko <notifications@github.com>
wrote:

> In
> soda-fountain-lib/src/main/scala/com/socrata/soda/server/highlevel/ComputationHandler.scala:
>
> > +trait ComputationHandler {
> > +  // The type of computation this handler handles.  Should be unique.
> > +  val computationType: String
> > +
> > +  /**
> > +   * Handles the actual computation.  Should be lazy if possible, otherwise will introduce
> > +   * significant latency.  IE, try not to convert the Iterator to a regular Seq or Array.
> > +   *
> > +   * @param sourceIt an Iterator of source rows, each row is a JValue (actually an JObject
> > +   *                 of key-value pairs, where the key is the column name).  Anything other
> > +   *                 than a JObject is not for upserts and can be ignored.
> > +   * @param column a ColumnRecord describing the computation and parameters
> > +   * @return an Iterator[JValue] for the output rows.  The JValue must be a JObject containing
> > +   *        a key matching column.name with the computed value.
> > +   */
> > +  def compute(sourceIt: Iterator[JValue], column: MinimalColumnRecord): Iterator[JValue]
>
> And note that it isn't just that it "should" be lazy, but it must be... if
> it isn't then it will blow up soda fountain OOM on large upserts.
>
> —
> Reply to this email directly or view it on GitHub
> <https://github.com/socrata/soda-fountain/pull/5/files#r13947030>.
>



-- 
Evan Chan   |   Principal Engineer, Socrata     |    @evanfchan
*Socrata <http://www.socrata.com/> *| The Data Experience Company™
*What does Socrata do? <https://www.youtube.com/watch?v=yyz86MlkriQ> *(watch
our 2 min video)