Search in sources :

Example 16 with TaskExecutionInfo

use of org.apache.gobblin.rest.TaskExecutionInfo in project incubator-gobblin by apache.

the class DatabaseJobHistoryStoreTest method testUpdate.

@Test(dependsOnMethods = { "testInsert" })
public void testUpdate() throws IOException {
    for (JobExecutionInfo jobExecutionInfo : this.expectedJobExecutionInfos) {
        jobExecutionInfo.setEndTime(System.currentTimeMillis());
        jobExecutionInfo.setDuration(jobExecutionInfo.getEndTime() - jobExecutionInfo.getStartTime());
        jobExecutionInfo.setState(JobStateEnum.COMMITTED);
        jobExecutionInfo.setCompletedTasks(jobExecutionInfo.getLaunchedTasks());
        for (TaskExecutionInfo taskExecutionInfo : jobExecutionInfo.getTaskExecutions()) {
            taskExecutionInfo.setEndTime(jobExecutionInfo.getEndTime());
            taskExecutionInfo.setDuration(taskExecutionInfo.getEndTime() - taskExecutionInfo.getStartTime());
            taskExecutionInfo.setState(TaskStateEnum.COMMITTED);
        }
        this.jobHistoryStore.put(jobExecutionInfo);
    }
}
Also used : TaskExecutionInfo(org.apache.gobblin.rest.TaskExecutionInfo) JobExecutionInfo(org.apache.gobblin.rest.JobExecutionInfo) Test(org.testng.annotations.Test)

Aggregations

TaskExecutionInfo (org.apache.gobblin.rest.TaskExecutionInfo)16 StringMap (com.linkedin.data.template.StringMap)8 PreparedStatement (java.sql.PreparedStatement)7 Map (java.util.Map)7 AbstractMap (java.util.AbstractMap)6 JobExecutionInfo (org.apache.gobblin.rest.JobExecutionInfo)5 ResultSet (java.sql.ResultSet)4 Metric (org.apache.gobblin.rest.Metric)4 MetricArray (org.apache.gobblin.rest.MetricArray)4 Table (org.apache.gobblin.rest.Table)4 SQLException (java.sql.SQLException)3 TaskExecutionInfoArray (org.apache.gobblin.rest.TaskExecutionInfoArray)3 Test (org.testng.annotations.Test)3 Counter (com.codahale.metrics.Counter)1 Gauge (com.codahale.metrics.Gauge)1 Meter (com.codahale.metrics.Meter)1 IOException (java.io.IOException)1 Connection (java.sql.Connection)1 Timestamp (java.sql.Timestamp)1 TaskMetrics (org.apache.gobblin.runtime.util.TaskMetrics)1