Search in sources :

Example 1 with GetJobDetails

use of uk.gov.gchq.gaffer.operation.impl.job.GetJobDetails in project Gaffer by gchq.

the class JcsJobTrackerIT method shouldAddJobIdToJobTrackerWhenExecute.

@Test
public void shouldAddJobIdToJobTrackerWhenExecute() throws OperationException, IOException, InterruptedException {
    // Given
    final OperationChain<JobDetail> opChain = new OperationChain.Builder().first(new GetAllEdges()).then(new GetJobDetails()).build();
    final User user = new User("user01");
    // When
    final JobDetail jobDetails = graph.execute(opChain, user);
    final String jobId = jobDetails.getJobId();
    final JobDetail expectedJobDetail = new JobDetail(jobId, user.getUserId(), opChain, JobStatus.RUNNING, null);
    expectedJobDetail.setStartTime(jobDetails.getStartTime());
    expectedJobDetail.setEndTime(jobDetails.getEndTime());
    // Then
    assertEquals(expectedJobDetail, jobDetails);
}
Also used : GetJobDetails(uk.gov.gchq.gaffer.operation.impl.job.GetJobDetails) JobDetail(uk.gov.gchq.gaffer.jobtracker.JobDetail) User(uk.gov.gchq.gaffer.user.User) GetAllEdges(uk.gov.gchq.gaffer.operation.impl.get.GetAllEdges) OperationChain(uk.gov.gchq.gaffer.operation.OperationChain) Test(org.junit.Test)

Example 2 with GetJobDetails

use of uk.gov.gchq.gaffer.operation.impl.job.GetJobDetails in project Gaffer by gchq.

the class ExportToGafferResultCacheExample method exportAndGetJobDetails.

public JobDetail exportAndGetJobDetails() {
    // ---------------------------------------------------------
    final OperationChain<JobDetail> exportOpChain = new OperationChain.Builder().first(new GetAllEdges()).then(new ExportToGafferResultCache()).then(new GetJobDetails()).build();
    // ---------------------------------------------------------
    jobDetail = runExample(exportOpChain);
    return jobDetail;
}
Also used : GetJobDetails(uk.gov.gchq.gaffer.operation.impl.job.GetJobDetails) JobDetail(uk.gov.gchq.gaffer.jobtracker.JobDetail) GetAllEdges(uk.gov.gchq.gaffer.operation.impl.get.GetAllEdges) ExportToGafferResultCache(uk.gov.gchq.gaffer.operation.impl.export.resultcache.ExportToGafferResultCache)

Example 3 with GetJobDetails

use of uk.gov.gchq.gaffer.operation.impl.job.GetJobDetails in project Gaffer by gchq.

the class GetGafferResultCacheExportExample method exportAndGetJobDetails.

public JobDetail exportAndGetJobDetails() {
    // ---------------------------------------------------------
    final OperationChain<JobDetail> exportOpChain = new OperationChain.Builder().first(new GetAllEdges()).then(new ExportToGafferResultCache()).then(new GetJobDetails()).build();
    // ---------------------------------------------------------
    jobDetail = runExample(exportOpChain);
    return jobDetail;
}
Also used : GetJobDetails(uk.gov.gchq.gaffer.operation.impl.job.GetJobDetails) JobDetail(uk.gov.gchq.gaffer.jobtracker.JobDetail) GetAllEdges(uk.gov.gchq.gaffer.operation.impl.get.GetAllEdges) ExportToGafferResultCache(uk.gov.gchq.gaffer.operation.impl.export.resultcache.ExportToGafferResultCache)

Example 4 with GetJobDetails

use of uk.gov.gchq.gaffer.operation.impl.job.GetJobDetails in project gaffer-doc by gchq.

the class ExportToGafferResultCacheExample method exportAndGetJobDetails.

public JobDetail exportAndGetJobDetails() {
    // ---------------------------------------------------------
    final OperationChain<JobDetail> exportOpChain = new OperationChain.Builder().first(new GetAllElements()).then(new ExportToGafferResultCache<>()).then(new DiscardOutput()).then(new GetJobDetails()).build();
    // ---------------------------------------------------------
    jobDetail = runExample(exportOpChain, null);
    return jobDetail;
}
Also used : JobDetail(uk.gov.gchq.gaffer.jobtracker.JobDetail) GetJobDetails(uk.gov.gchq.gaffer.operation.impl.job.GetJobDetails) OperationChain(uk.gov.gchq.gaffer.operation.OperationChain) GetAllElements(uk.gov.gchq.gaffer.operation.impl.get.GetAllElements) ExportToGafferResultCache(uk.gov.gchq.gaffer.operation.impl.export.resultcache.ExportToGafferResultCache) DiscardOutput(uk.gov.gchq.gaffer.operation.impl.DiscardOutput)

Example 5 with GetJobDetails

use of uk.gov.gchq.gaffer.operation.impl.job.GetJobDetails in project gaffer-doc by gchq.

the class GetJobResultsExample method runExamples.

@Override
public void runExamples() {
    try {
        final OperationChain<JobDetail> opChain = new OperationChain.Builder().first(new GetAllElements()).then(new ExportToGafferResultCache<>()).then(new DiscardOutput()).then(new GetJobDetails()).build();
        final JobDetail jobDetails = getGraph().execute(opChain, new User("user01"));
        jobId = jobDetails.getJobId();
    } catch (final OperationException e) {
        throw new RuntimeException(e);
    }
    getJobResults();
}
Also used : JobDetail(uk.gov.gchq.gaffer.jobtracker.JobDetail) GetJobDetails(uk.gov.gchq.gaffer.operation.impl.job.GetJobDetails) User(uk.gov.gchq.gaffer.user.User) OperationChain(uk.gov.gchq.gaffer.operation.OperationChain) GetAllElements(uk.gov.gchq.gaffer.operation.impl.get.GetAllElements) ExportToGafferResultCache(uk.gov.gchq.gaffer.operation.impl.export.resultcache.ExportToGafferResultCache) DiscardOutput(uk.gov.gchq.gaffer.operation.impl.DiscardOutput) OperationException(uk.gov.gchq.gaffer.operation.OperationException)

Aggregations

GetJobDetails (uk.gov.gchq.gaffer.operation.impl.job.GetJobDetails)17 JobDetail (uk.gov.gchq.gaffer.jobtracker.JobDetail)12 Test (org.junit.jupiter.api.Test)7 ExportToGafferResultCache (uk.gov.gchq.gaffer.operation.impl.export.resultcache.ExportToGafferResultCache)6 User (uk.gov.gchq.gaffer.user.User)6 OperationChain (uk.gov.gchq.gaffer.operation.OperationChain)5 DiscardOutput (uk.gov.gchq.gaffer.operation.impl.DiscardOutput)5 GetAllEdges (uk.gov.gchq.gaffer.operation.impl.get.GetAllEdges)5 GetAllElements (uk.gov.gchq.gaffer.operation.impl.get.GetAllElements)5 OperationTest (uk.gov.gchq.gaffer.operation.OperationTest)4 OperationException (uk.gov.gchq.gaffer.operation.OperationException)3 Context (uk.gov.gchq.gaffer.store.Context)3 Store (uk.gov.gchq.gaffer.store.Store)3 Test (org.junit.Test)2 JobTracker (uk.gov.gchq.gaffer.jobtracker.JobTracker)2 CloseableIterable (uk.gov.gchq.gaffer.commonutil.iterable.CloseableIterable)1 GroupCounts (uk.gov.gchq.gaffer.data.GroupCounts)1 Element (uk.gov.gchq.gaffer.data.element.Element)1 EntityId (uk.gov.gchq.gaffer.data.element.id.EntityId)1 Builder (uk.gov.gchq.gaffer.operation.OperationChain.Builder)1