Package com.google.appengine.tools.mapreduce.impl

Examples of com.google.appengine.tools.mapreduce.impl.WorkerShardState


        jobObject.put("mapper_spec", mapperSpec);

        JSONArray shardArray = new JSONArray();
        // Iterate in ascending order rather than the map's entrySet() order.
        for (int i = 0; i < state.getTotalTaskCount(); i++) {
          WorkerShardState shard = aggregateResult.getWorkerShardStates().get(i);
          JSONObject shardObject = new JSONObject();
          shardObject.put("shard_number", i);
          if (shard == null) {
            shardObject.put("active", false);
            shardObject.put("result_status", "initializing");
            shardObject.put("shard_description", ""); // TODO
          } else {
            boolean done = aggregateResult.getClosedWriters().get(i) != null;
            if (done) {
              shardObject.put("active", false);
              // result_status is only displayed if active is false.
              shardObject.put("result_status", "done");
            } else {
              shardObject.put("active", true);
            }
            shardObject.put("shard_description", ""); // TODO
            shardObject.put("updated_timestamp_ms", shard.getMostRecentUpdateTimeMillis());
            shardObject.put("last_work_item", shard.getLastWorkItem());
          }
          shardArray.put(shardObject);
        }
        jobObject.put("shards", shardArray);
      }
View Full Code Here

TOP

Related Classes of com.google.appengine.tools.mapreduce.impl.WorkerShardState

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.