Package akka.first.app.java.messages

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


  }

  @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


  @Override
  public void onReceive(Object message) throws Exception {
    if (message instanceof String) {
      String work = (String) message;
      // map the words in the sentence
      MapData data = evaluateExpression(work);
      // send the result to ReduceActor
      reduceActor.tell(data);
    } else
      unhandled(message);
  }
View Full Code Here

      String word = parser.nextToken().toLowerCase();
      if (!STOP_WORDS_LIST.contains(word)) {
        dataList.add(new WordCount(word,Integer.valueOf(1)));
      }
    }
    return new MapData(dataList);
  }
View Full Code Here

TOP

Related Classes of akka.first.app.java.messages.MapData

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.