Package org.apache.hama.bsp

Examples of org.apache.hama.bsp.TaskAttemptID


    Map<String, String> env = setupEnvironment(peer.getConfiguration());
    List<String> cmd = setupCommand(peer.getConfiguration());

    // wrap the command in a stdout/stderr capture
    TaskAttemptID taskid = peer.getTaskId();
    File stdout = TaskLog.getTaskLogFile(taskid, TaskLog.LogName.STDOUT);
    File stderr = TaskLog.getTaskLogFile(taskid, TaskLog.LogName.STDERR);

    // Get the desired maximum length of task's logs.
    long logLength = TaskLog.getTaskLogLength(peer.getConfiguration());
View Full Code Here


  }

  public static TaskAttemptID deserializeTaskId(byte[] arr) {
    ByteArrayInputStream bis = new ByteArrayInputStream(arr);
    DataInputStream in = new DataInputStream(bis);
    TaskAttemptID id = new TaskAttemptID();
    try {
      id.readFields(in);
    } catch (IOException e) {
      LOG.error(e);
    } finally {
      try {
        in.close();
View Full Code Here

            .toArray(new String[0]);

        for (String s : allPeers) {
          byte[] data = zk.getData(
              "/" + taskId.getJobID().toString() + "/" + s, this, null);
          TaskAttemptID thatTask = deserializeTaskId(data);
          LOG.debug("TASK mapping from zookeeper: " + thatTask + " ID:"
              + thatTask.getTaskID().getId() + " : " + s);
          sortedMap.put(thatTask.getTaskID().getId(), s);
        }

      } catch (Exception e) {
        LOG.error(e);
        throw new RuntimeException("All peer names could not be retrieved!");
View Full Code Here

    conf.set(GraphJob.VERTEX_EDGE_VALUE_CLASS_ATTR,
        NullWritable.class.getName());
    conf.set(GraphJob.VERTEX_ID_CLASS_ATTR, Text.class.getName());
    conf.set(GraphJob.VERTEX_VALUE_CLASS_ATTR, DoubleWritable.class.getName());
    GraphJobRunner.<Text, NullWritable, DoubleWritable> initClasses(conf);
    TaskAttemptID attempt = new TaskAttemptID("omg", 1, 1, 0);
    try {
      ArrayList<PageRankVertex> list = new ArrayList<PageRankVertex>();

      for (int i = 0; i < 10; i++) {
        PageRankVertex v = new PageRank.PageRankVertex();
View Full Code Here

    conf.set(GraphJob.VERTEX_EDGE_VALUE_CLASS_ATTR,
        NullWritable.class.getName());
    conf.set(GraphJob.VERTEX_ID_CLASS_ATTR, Text.class.getName());
    conf.set(GraphJob.VERTEX_VALUE_CLASS_ATTR, DoubleWritable.class.getName());
    GraphJobRunner.<Text, NullWritable, DoubleWritable> initClasses(conf);
    TaskAttemptID attempt = new TaskAttemptID("123", 1, 1, 0);
    try {
      ArrayList<PageRankVertex> list = new ArrayList<PageRankVertex>();

      for (int i = 0; i < 10; i++) {
        PageRankVertex v = new PageRankVertex();
View Full Code Here

    InetSocketAddress peer = new InetSocketAddress(
        BSPNetUtils.getCanonicalHostname(), BSPNetUtils.getFreePort()
            + (increment++));
    BSPPeer<?, ?, ?, ?, IntWritable> dummyPeer = new BSPPeerImpl<NullWritable, NullWritable, NullWritable, NullWritable, IntWritable>(
        conf, FileSystem.get(conf), new Counters());
    TaskAttemptID id = new TaskAttemptID("1", 1, 1, 1);
    messageManager.init(id, dummyPeer, conf, peer);
    String peerName = peer.getHostName() + ":" + peer.getPort();

    messageManager.send(peerName, new IntWritable(1337));
View Full Code Here

    Map<String, String> env = setupEnvironment(peer.getConfiguration());
    List<String> cmd = setupCommand(peer.getConfiguration());

    // wrap the command in a stdout/stderr capture
    TaskAttemptID taskid = peer.getTaskId();
    File stdout = TaskLog.getTaskLogFile(taskid, TaskLog.LogName.STDOUT);
    File stderr = TaskLog.getTaskLogFile(taskid, TaskLog.LogName.STDERR);

    // Get the desired maximum length of task's logs.
    long logLength = TaskLog.getTaskLogLength(peer.getConfiguration());
View Full Code Here

    conf.set(Constants.PEER_HOST, Constants.DEFAULT_PEER_HOST);
    conf.setInt(Constants.PEER_PORT, Constants.DEFAULT_PEER_PORT);

    BSPPeer<?, ?, ?, ?, IntWritable> dummyPeer = new BSPPeerImpl<NullWritable, NullWritable, NullWritable, NullWritable, IntWritable>(
        conf, FileSystem.get(conf), new Counters());
    TaskAttemptID id = new TaskAttemptID("1", 1, 1, 1);
    messageManager.init(id, dummyPeer, conf, peer);
    peer = messageManager.getListenerAddress();
    String peerName = peer.getHostName() + ":" + peer.getPort();
    System.out.println("Peer is " + peerName);
    messageManager.send(peerName, new IntWritable(1337));
View Full Code Here

   */
  public void testTextSpillingQueue() throws Exception {

    String msg = "Testing the spillage of spilling buffer";
    Text text = new Text(msg);
    TaskAttemptID id = new TaskAttemptID(new TaskID("123", 1, 2), 0);
    SpillingQueue<Text> queue = new SpillingQueue<Text>();
    Configuration conf = new HamaConfiguration();

    String fileName = System.getProperty("java.io.tmpdir") + File.separatorChar
        + new BigInteger(128, new SecureRandom()).toString(32);
View Full Code Here

   */
  public void testObjectWritableSpillingQueue() throws Exception {

    String msg = "Testing the spillage of spilling buffer";
    Text text = new Text(msg);
    TaskAttemptID id = new TaskAttemptID(new TaskID("123", 1, 2), 0);
    SpillingQueue<Text> queue = new SpillingQueue<Text>();
    Configuration conf = new HamaConfiguration();

    String fileName = System.getProperty("java.io.tmpdir") + File.separatorChar
        + new BigInteger(128, new SecureRandom()).toString(32);
View Full Code Here

TOP

Related Classes of org.apache.hama.bsp.TaskAttemptID

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.