Package org.apache.hadoop.mapreduce.protocol

Examples of org.apache.hadoop.mapreduce.protocol.ClientProtocol


    synchronized (frameworkLoader) {
      for (ClientProtocolProvider provider : frameworkLoader) {
        LOG.debug("Trying ClientProtocolProvider : "
            + provider.getClass().getName());
        ClientProtocol clientProtocol = null;
        try {
          if (jobTrackAddr == null) {
            clientProtocol = provider.create(conf);
          } else {
            clientProtocol = provider.create(jobTrackAddr, conf);
View Full Code Here


public class TestJob {
  @Test
  public void testJobToString() throws IOException, InterruptedException {
    Cluster cluster = mock(Cluster.class);
    ClientProtocol client = mock(ClientProtocol.class);
    when(cluster.getClient()).thenReturn(client);
    JobID jobid = new JobID("1014873536921", 6);
    JobStatus status = new JobStatus(jobid, 0.0f, 0.0f, 0.0f, 0.0f,
        State.FAILED, JobPriority.NORMAL, "root", "TestJobToString",
        "job file", "tracking url");
    when(client.getJobStatus(jobid)).thenReturn(status);
    when(client.getTaskReports(jobid, TaskType.MAP)).thenReturn(
        new TaskReport[0]);
    when(client.getTaskReports(jobid, TaskType.REDUCE)).thenReturn(
        new TaskReport[0]);
    when(client.getTaskCompletionEvents(jobid, 0, 10)).thenReturn(
        new TaskCompletionEvent[0]);
    Job job = Job.getInstance(cluster, status, new JobConf());
    Assert.assertNotNull(job.toString());
  }
View Full Code Here

   
    try {
      conf = new Configuration();
      conf.set(MRConfig.FRAMEWORK_NAME, MRConfig.YARN_FRAMEWORK_NAME);
      cluster = new Cluster(conf);
      ClientProtocol client = cluster.getClient();
      assertTrue("client is a YARNRunner", client instanceof YARNRunner);
    } catch (IOException e) {

    } finally {
      if (cluster != null) {
View Full Code Here

  }

  // runs a sample job as a user (ugi)
  RunningJob runJobAsUser(final JobConf job, UserGroupInformation ugi)
  throws Exception {
    ClientProtocol jobSubmitClient =
      TestSubmitJob.getJobSubmitClient(job, ugi);
    org.apache.hadoop.mapreduce.JobID id = jobSubmitClient.getNewJobID();
   
    InputSplit[] splits = computeJobSplit(JobID.downgrade(id), job);
    final Path jobSubmitDir = new Path(id.toString());
    FileSystem fs = ugi.doAs(new PrivilegedExceptionAction<FileSystem>() {
      public FileSystem run() throws IOException {
        return jobSubmitDir.getFileSystem(job);
      }
    });
    Path qJobSubmitDir = jobSubmitDir.makeQualified(fs);
    uploadJobFiles(JobID.downgrade(id), splits, qJobSubmitDir, ugi, job);
   
    jobSubmitClient.submitJob(id, qJobSubmitDir.toString(), null);
   
    JobClient jc = new JobClient(job);
    return jc.getJob(JobID.downgrade(id));
  }
View Full Code Here

      ClientProtocol.versionID, addr, ugi, conf,
      NetUtils.getSocketFactory(conf, ClientProtocol.class));
  }

  private ClientProtocol createClient(Configuration conf) throws IOException {
    ClientProtocol client;
    String tracker = conf.get("mapreduce.jobtracker.address", "local");
    if ("local".equals(tracker)) {
      conf.setInt("mapreduce.job.maps", 1);
      client = new LocalJobRunner(conf);
    } else {
View Full Code Here

    synchronized (frameworkLoader) {
      for (ClientProtocolProvider provider : frameworkLoader) {
        LOG.debug("Trying ClientProtocolProvider : "
            + provider.getClass().getName());
        ClientProtocol clientProtocol = null;
        try {
          if (jobTrackAddr == null) {
            clientProtocol = provider.create(conf);
          } else {
            clientProtocol = provider.create(jobTrackAddr, conf);
View Full Code Here

    try {
      conf = new Configuration();
      conf.set(MRConfig.FRAMEWORK_NAME, MRConfig.YARN_FRAMEWORK_NAME);
      cluster = new Cluster(conf);
      ClientProtocol client = cluster.getClient();
      assertTrue(client instanceof YARNRunner);
    } catch (IOException e) {

    } finally {
      if (cluster != null) {
View Full Code Here

    try {
      conf = new Configuration();
      conf.set(MRConfig.FRAMEWORK_NAME, MRConfig.YARN_FRAMEWORK_NAME);
      cluster = new Cluster(conf);
      ClientProtocol client = cluster.getClient();
      assertTrue(client instanceof YARNRunner);
    } catch (IOException e) {

    } finally {
      if (cluster != null) {
View Full Code Here

   
    try {
      conf = new Configuration();
      conf.set(MRConfig.FRAMEWORK_NAME, MRConfig.YARN_FRAMEWORK_NAME);
      cluster = new Cluster(conf);
      ClientProtocol client = cluster.getClient();
      assertTrue("client is a YARNRunner", client instanceof YARNRunner);
    } catch (IOException e) {

    } finally {
      if (cluster != null) {
View Full Code Here

    synchronized (frameworkLoader) {
      for (ClientProtocolProvider provider : frameworkLoader) {
        LOG.debug("Trying ClientProtocolProvider : "
            + provider.getClass().getName());
        ClientProtocol clientProtocol = null;
        try {
          if (jobTrackAddr == null) {
            clientProtocol = provider.create(conf);
          } else {
            clientProtocol = provider.create(jobTrackAddr, conf);
View Full Code Here

TOP

Related Classes of org.apache.hadoop.mapreduce.protocol.ClientProtocol

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.