Package org.apache.hadoop.mapred

Examples of org.apache.hadoop.mapred.LocalJobRunner$Job


      @ResponseCode ( code = 403, condition = "Cannot create schedules for the specified file." ),
      @ResponseCode ( code = 500, condition = "An error occurred while creating a schedule." )
  } )
  public Response createJob( JobScheduleRequest scheduleRequest ) {
    try {
      Job job = schedulerService.createJob( scheduleRequest );
      return buildPlainTextOkResponse( job.getJobId() );
    } catch ( SchedulerException e ) {
      return buildServerErrorResponse( e.getCause().getMessage() );
    } catch ( IOException e ) {
      return buildServerErrorResponse( e.getCause().getMessage() );
    } catch ( SecurityException e ) {
View Full Code Here


      @ResponseCode ( code = 400, condition = "Invalid input." ),
      @ResponseCode ( code = 500, condition = "Invalid jobId." )
  } )
  public Response triggerNow( JobRequest jobRequest ) {
    try {
      Job job = schedulerService.triggerNow( jobRequest.getJobId() );
      return buildPlainTextOkResponse( job.getState().name() );
    } catch ( SchedulerException e ) {
      throw new RuntimeException( e );
    }
  }
View Full Code Here

  public Response removeJob( JobRequest jobRequest ) {
    try {
      if ( schedulerService.removeJob( jobRequest.getJobId() ) ) {
        return buildPlainTextOkResponse( "REMOVED" );
      }
      Job job = schedulerService.getJob( jobRequest.getJobId() );
      return buildPlainTextOkResponse( job.getState().name() );
    } catch ( SchedulerException e ) {
      throw new RuntimeException( e );
    }
  }
View Full Code Here

      @ResponseCode ( code = 200, condition = "Successful operation." ),
      @ResponseCode ( code = 401, condition = "User is not authorized to create blockout." )
  } )
  public Response addBlockout( JobScheduleRequest jobScheduleRequest ) {
    try {
      Job job = schedulerService.addBlockout( jobScheduleRequest );
      return buildPlainTextOkResponse( job.getJobId() );
    } catch ( IOException e ) {
      return buildStatusResponse( UNAUTHORIZED );
    } catch ( SchedulerException e ) {
      return buildStatusResponse( UNAUTHORIZED );
    } catch ( IllegalAccessException e ) {
View Full Code Here

      @ResponseCode ( code = 200, condition = "Successful operation." ),
      @ResponseCode ( code = 401, condition = "User is not authorized to update blockout." )
  } )
  public Response updateBlockout( @QueryParam ( "jobid" ) String jobId, JobScheduleRequest jobScheduleRequest ) {
    try {
      Job job = schedulerService.updateBlockout( jobId, jobScheduleRequest );
      return buildPlainTextOkResponse( job.getJobId() );
    } catch ( IOException e ) {
      return buildStatusResponse( Status.UNAUTHORIZED );
    } catch ( SchedulerException e ) {
      return buildStatusResponse( Status.UNAUTHORIZED );
    } catch ( IllegalAccessException e ) {
View Full Code Here

  @Test
  public void testCreateJob() throws Exception {
    JobScheduleRequest mockRequest = mock( JobScheduleRequest.class );

    Job mockJob = mock( Job.class );
    doReturn( mockJob ).when( schedulerResource.schedulerService ).createJob( mockRequest );

    String jobId = "jobId";
    doReturn( jobId ).when( mockJob ).getJobId();
View Full Code Here

    JobRequest mockJobRequest = mock( JobRequest.class );

    String jobId = "jobId";
    doReturn( jobId ).when( mockJobRequest ).getJobId();

    Job mockJob = mock( Job.class );
    doReturn( mockJob ).when( schedulerResource.schedulerService ).triggerNow( jobId );

    Job.JobState mockJobState = Job.JobState.BLOCKED;
    doReturn( mockJobState ).when( mockJob ).getState();
View Full Code Here

    verify( schedulerResource.schedulerService, times( 1 ) ).triggerNow( jobId );
  }

  @Test
  public void testGetContentCleanerJob() throws Exception {
    Job mockJob = mock( Job.class );
    doReturn( mockJob ).when( schedulerResource.schedulerService ).getContentCleanerJob();

    Job testJob = schedulerResource.getContentCleanerJob();
    assertEquals( mockJob, testJob );

    verify( schedulerResource.schedulerService, times( 1 ) ).getContentCleanerJob();
  }
View Full Code Here

    JobRequest mockJobRequest = mock( JobRequest.class );

    String jobId = "jobId";
    doReturn( jobId ).when( mockJobRequest ).getJobId();

    Job mockJob = mock( Job.class );
    doReturn( mockJob ).when( schedulerResource.schedulerService ).getJob( jobId );

    Job.JobState mockJobState = Job.JobState.BLOCKED;
    doReturn( mockJobState ).when( mockJob ).getState();
View Full Code Here

  @Test
  public void testGetJob() throws Exception {
    String jobId = "jobId";
    String asCronString = "asCronString";

    Job mockJob = mock( Job.class );
    doReturn( mockJob ).when( schedulerResource.schedulerService ).getJobInfo( jobId );

    Job testJob = schedulerResource.getJob( jobId, asCronString );
    assertEquals( mockJob, testJob );

    verify( schedulerResource.schedulerService, times( 1 ) ).getJobInfo( jobId );
  }
View Full Code Here

TOP

Related Classes of org.apache.hadoop.mapred.LocalJobRunner$Job

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.