Examples of ReduceData


Examples of akka.first.app.java.messages.ReduceData

  private Map<String, Integer> finalReducedMap = new HashMap<String, Integer>();

  @Override
  public void onReceive(Object message) throws Exception {
    if (message instanceof ReduceData) {
      ReduceData reduceData = (ReduceData) message;
      aggregateInMemoryReduce(reduceData.getReduceDataList());
    } else if (message instanceof Result) {
      System.out.println(finalReducedMap.toString());
    } else
      unhandled(message);
  }
View Full Code Here

Examples of akka.first.app.java.messages.ReduceData

  @Override
  public void onReceive(Object message) throws Exception {
    if (message instanceof MapData) {
      MapData mapData = (MapData) message;
      // reduce the incoming data
      ReduceData reduceData = reduce(mapData.getDataList());
      // forward the result to aggregate actor
      aggregateActor.tell(reduceData);
    } else
      unhandled(message);
  }
View Full Code Here

Examples of akka.first.app.java.messages.ReduceData

        reducedMap.put(wordCount.getWord(), value);
      } else {
        reducedMap.put(wordCount.getWord(), Integer.valueOf(1));
      }
    }
    return new ReduceData(reducedMap);
  }
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.