Package org.apache.hadoop.io

Examples of org.apache.hadoop.io.MapWritable.containsKey()


    MapWritable msg = null;
    int userFeatureSize = 0;
    int itemFeatureSize = 0;
    while ((msg = peer.getCurrentMessage()) != null) {
      if (msg.containsKey(OnlineCF.Settings.MSG_INP_ITEM_FEATURES)) {
        // send item feature
        String itemId = ((Text)msg.get(OnlineCF.Settings.MSG_INP_ITEM_FEATURES)).toString();
        inpItemsFeatures.put(itemId, (VectorWritable)msg.get(OnlineCF.Settings.MSG_VALUE));
        itemFeatureSize = ((VectorWritable)msg.get(OnlineCF.Settings.MSG_VALUE)).getVector().getLength();
      } else if (msg.containsKey(OnlineCF.Settings.MSG_INP_USER_FEATURES)) {
View Full Code Here


      if (msg.containsKey(OnlineCF.Settings.MSG_INP_ITEM_FEATURES)) {
        // send item feature
        String itemId = ((Text)msg.get(OnlineCF.Settings.MSG_INP_ITEM_FEATURES)).toString();
        inpItemsFeatures.put(itemId, (VectorWritable)msg.get(OnlineCF.Settings.MSG_VALUE));
        itemFeatureSize = ((VectorWritable)msg.get(OnlineCF.Settings.MSG_VALUE)).getVector().getLength();
      } else if (msg.containsKey(OnlineCF.Settings.MSG_INP_USER_FEATURES)) {
        // send user feature
        String userId = ((Text)msg.get(OnlineCF.Settings.MSG_INP_USER_FEATURES)).toString();
        inpUsersFeatures.put(userId, (VectorWritable)msg.get(OnlineCF.Settings.MSG_VALUE));
        userFeatureSize = ((VectorWritable)msg.get(OnlineCF.Settings.MSG_VALUE)).getVector().getLength();
      }
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.