Examples of BSPPeerProtocol


Examples of org.apache.hama.ipc.BSPPeerProtocol

      try {
        BSPJob job = new BSPJob(hamaConf);
        job.setInputFormat(NullInputFormat.class);
        job.setOutputFormat(NullOutputFormat.class);

        final BSPPeerProtocol proto = (BSPPeerProtocol) RPC.getProxy(
            BSPPeerProtocol.class, HamaRPCProtocolVersion.versionID,
            new InetSocketAddress("127.0.0.1", port), hamaConf);

        BSPTask task = new BSPTask();
        task.setConf(job);

        LOG.info("Testing failure case in process - "
            + hamaConf.getInt(TEST_POINT, 0));

        Runtime.getRuntime().addShutdownHook(new Thread() {
          @Override
          public void run() {
            try {
              proto.close();
            } catch (Exception e) {
              // too late to log!
            }
          }
        });
View Full Code Here

Examples of org.apache.hama.ipc.BSPPeerProtocol

    LOG.info("Started RPC server");
    conf.setInt("bsp.groom.rpc.port", inetAddress.getPort());
    conf.setInt("bsp.peers.num", 1);

    BSPPeerProtocol umbilical = (BSPPeerProtocol) RPC.getProxy(
        BSPPeerProtocol.class, HamaRPCProtocolVersion.versionID, inetAddress,
        conf);
    LOG.info("Started the proxy connections");

    TaskAttemptID tid = new TaskAttemptID(new TaskID(new BSPJobID(
        "job_201110102255", 1), 1), 1);

    try {
      BSPJob job = new BSPJob(new HamaConfiguration(conf));
      job.setOutputPath(TestBSPMasterGroomServer.OUTPUT_PATH);
      job.setOutputFormat(TextOutputFormat.class);
      final BSPPeerProtocol proto = (BSPPeerProtocol) RPC.getProxy(
          BSPPeerProtocol.class, HamaRPCProtocolVersion.versionID,
          new InetSocketAddress("127.0.0.1", port), conf);

      BSPTask task = new BSPTask();
      task.setConf(job);
View Full Code Here

Examples of org.apache.hama.ipc.BSPPeerProtocol

      try {
        BSPJob job = new BSPJob(hamaConf);
        job.setInputFormat(NullInputFormat.class);
        job.setOutputFormat(NullOutputFormat.class);
       
        final BSPPeerProtocol proto = (BSPPeerProtocol) RPC.getProxy(
            BSPPeerProtocol.class, HamaRPCProtocolVersion.versionID,
            new InetSocketAddress("127.0.0.1", port), hamaConf);

        BSPTask task = new BSPTask();
        task.setConf(job);

        LOG.info("Testing failure case in process - "
            + hamaConf.getInt(TEST_POINT, 0));

        Runtime.getRuntime().addShutdownHook(new Thread() {
          @Override
          public void run() {
            try {
              proto.close();
            } catch (Exception e) {
              // too late to log!
            }
          }
        });
View Full Code Here

Examples of org.apache.hama.ipc.BSPPeerProtocol

      int port = Integer.parseInt(args[1]);
      InetSocketAddress address = new InetSocketAddress(host, port);
      TaskAttemptID taskid = TaskAttemptID.forName(args[2]);

      // //////////////////
      BSPPeerProtocol umbilical = (BSPPeerProtocol) RPC.getProxy(
          BSPPeerProtocol.class, HamaRPCProtocolVersion.versionID, address,
          defaultConf);

      final BSPTask task = (BSPTask) umbilical.getTask(taskid);
      int peerPort = umbilical.getAssignedPortNum(taskid);

      defaultConf.addResource(new Path(task.getJobFile()));
      BSPJob job = new BSPJob(task.getJobID(), task.getJobFile());

      defaultConf.set(Constants.PEER_HOST, args[3]);
      if (null != args && 5 == args.length) {
        defaultConf.setInt("bsp.checkpoint.port", Integer.parseInt(args[4]));
      }
      defaultConf.setInt(Constants.PEER_PORT, peerPort);

      try {
        // use job-specified working directory
        FileSystem.get(job.getConf()).setWorkingDirectory(
            job.getWorkingDirectory());

        // instantiate and init our peer
        @SuppressWarnings("rawtypes")
        final BSPPeerImpl<?, ?, ?, ?, ?> bspPeer = new BSPPeerImpl(job,
            defaultConf, taskid, umbilical, task.partition, task.splitClass,
            task.split, task.getCounters());

        task.run(job, bspPeer, umbilical); // run the task

      } catch (FSError e) {
        LOG.fatal("FSError from child", e);
        umbilical.fsError(taskid, e.getMessage());
        e.printStackTrace();
      } catch (SyncException e) {
        LOG.fatal("SyncError from child", e);
        umbilical.fatalError(taskid, e.toString());

        // Report back any failures, for diagnostic purposes
        ByteArrayOutputStream baos = new ByteArrayOutputStream();
        e.printStackTrace(new PrintStream(baos));
        e.printStackTrace();
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.