Examples of PlumeObject


Examples of com.tdunning.plume.local.lazy.MapRedExecutor.PlumeObject

            public void emit(Object v) {
              try {
                if(v instanceof Pair) {
                  Pair p = (Pair)v;
                  context.write(
                    new PlumeObject((WritableComparable)p.getKey(), channel),
                    new PlumeObject((WritableComparable)p.getValue(), channel)
                  );
                } else {
                  context.write(
                    new PlumeObject((WritableComparable)v, channel),
                    new PlumeObject((WritableComparable)v, channel)
                  );             
                }
              } catch (Exception e) {
                e.printStackTrace(); // TODO How to report this
              }
            }
          });
        }
      } else {
        if(op instanceof Flatten) {
          l = (LazyCollection)((Flatten)op).getDest();
        }
        int channel = mscr.getNumberedChannels().get(l);
        if(toProcess instanceof Pair) {
          context.write(new PlumeObject(key, channel), new PlumeObject(value, channel));
        } else {
          context.write(new PlumeObject(value, channel), new PlumeObject(value, channel));
        }
      }
    }
  }
View Full Code Here

Examples of com.tdunning.plume.local.lazy.MapRedExecutor.PlumeObject

      List<WritableComparable> vals = Lists.newArrayList();
      for(PlumeObject val: values) {
        vals.add(val.obj);
      }
      WritableComparable result = (WritableComparable) oC.combiner.getCombiner().combine(vals);
      context.write(arg0, new PlumeObject(result, arg0.sourceId));
    } else {
      // direct writing - write all key, value pairs
      for(PlumeObject val: values) {
        context.write(arg0, val);
      }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.