Package cascading.tuple

Examples of cascading.tuple.Tuple


  }

  public Tuple getTuple() {
    if (this.values == null) {
      Object[] values = (Object[]) KryoService.deserialize(this.serialized);
      this.values = new Tuple(values);
    }
    return this.values;
  }
View Full Code Here


    }
    return this.values;
  }

  public void operate(FlowProcess flowProcess, FunctionCall functionCall) {
    functionCall.getOutputCollector().add(new Tuple(getTuple()));
  }
View Full Code Here

    if (!(object instanceof KryoInsert)) { return false; }
    if (!super.equals(object)) { return false; }

    KryoInsert insert = (KryoInsert) object;

    Tuple tuple = getTuple();

    return !(tuple != null ? !tuple.equals(insert.getTuple()) : insert.getTuple() != null);
  }
View Full Code Here

  public void prepare(FlowProcess flowProcess, OperationCall operationCall) {
    this.rand = new Random(seed + flowProcess.getCurrentSliceNum());
  }

  public void operate(FlowProcess flow_process, FunctionCall fn_call) {
    fn_call.getOutputCollector().add(new Tuple(rand.nextLong()));
  }
View Full Code Here

  }

  public static Tuple coerceToTuple(Object obj) {
    if (obj instanceof List) {
      Object[] arr = ((List) obj).toArray();
      return new Tuple(arr);
    } else {
      return new Tuple(obj);
    }
  }
View Full Code Here

    filter.prepare(flowProcess, operationCall);
  }

  public void operate(FlowProcess process, FunctionCall call) {
    boolean ret = !filter.isRemove(process, new FilterFunctionCall(call));
    call.getOutputCollector().add(new Tuple(ret));
  }
View Full Code Here

  public void aggregate(FlowProcess fp, AggregatorCall<Tuple> call) {
    ISeq fnArgs = RT.seq(Util.tupleToList(call.getArguments()));
    if (null != prepareFn) {
      fnArgs = RT.seq(Util.coerceToList(prepareFn.applyTo(fnArgs)));
    }
    Tuple context = call.getContext();

    if (null == context) {
      Tuple newContext = Tuple.size(1);
      newContext.set(0, fnArgs);
      call.setContext(newContext);
    } else {
      ISeq acc = (ISeq) context.getObject(0);
      ISeq ret = RT.seq(Util.coerceToList(combineFn.applyTo(Util.cat(acc, fnArgs))));
      context.set(0, ret);
View Full Code Here

  }

  @Override
  public void complete(FlowProcess flowProcess, AggregatorCall aggregatorCall) {
    int sum = (Integer) aggregatorCall.getContext();
    aggregatorCall.getOutputCollector().add(new Tuple(sum));
  }
View Full Code Here

      context.set(0, ret);
    }
  }

  public void complete(FlowProcess flowProcess, AggregatorCall<Tuple> call) {
    Tuple context = call.getContext();

    if (null == context) {
      throw new RuntimeException("ClojureMonoidAggregator completed with any aggregate calls");
    } else {
      ISeq finalValue = (ISeq) context.getObject(0);
      call.setContext(null);
      if (null != presentFn) {
        call.getOutputCollector().add(
            Util.coerceToTuple(presentFn.applyTo(finalValue)));
      } else {
View Full Code Here

  @Override
  public void operate(FlowProcess flowProcess, FunctionCall fnCall) {
    TupleEntry args = fnCall.getArguments();
    Number n = (Number) args.get(0);
    fnCall.getOutputCollector().add(new Tuple(Numbers.multiply(n, 2)));
  }
View Full Code Here

TOP

Related Classes of cascading.tuple.Tuple

Copyright © 2018 www.massapicom. 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.