Class: Serializable

eclairjs. Serializable

A JSON Serializable object that can be serialized and "shipped" to spark workers over the network. This object mushed be used for spark serlization.

Constructor

new Serializable(jsObject)

Parameters:
Name Type Description
jsObject object JavaScript object, the properties of the object will be mixin to this object.
Source:
Example
var Serializable = require(EclairJS_Globals.NAMESPACE + '/Serializable');
var s = new Serializable();
 var result = pairRdd.aggregateByKey(s,
  function(hashSetA, b) {
     hashSetA[b] = hashSetA[b] ? hashSetA[b] + 1 : 1;
     return hashSetA;
 },
 function(setA, setB){
    for (var k in setA) {
       if (setB.hasOwnProperty(k)) {
            setA[k] += setB[k];
          }
     }
     return setA;
 });