Search in sources :

Example 1 with ProcessInnerReporter

use of com.alibaba.datax.core.statistics.container.report.ProcessInnerReporter in project DataX by alibaba.

the class ProcessInnerReporterTest method testReportJobCommunication.

@Test
public void testReportJobCommunication() {
    Long jobId = 0L;
    Communication communication = new Communication();
    ProcessInnerReporter processInnerReporter = new ProcessInnerReporter();
    processInnerReporter.reportJobCommunication(jobId, communication);
    System.out.println("this function do noting");
}
Also used : ProcessInnerReporter(com.alibaba.datax.core.statistics.container.report.ProcessInnerReporter) Communication(com.alibaba.datax.core.statistics.communication.Communication) Test(org.junit.Test)

Example 2 with ProcessInnerReporter

use of com.alibaba.datax.core.statistics.container.report.ProcessInnerReporter in project DataX by alibaba.

the class ProcessInnerReporterTest method testReportTGCommunication.

@Test
public void testReportTGCommunication() throws NoSuchFieldException, IllegalAccessException {
    Integer taskGroupId = 1;
    Communication communication = new Communication();
    communication.setState(State.SUBMITTING);
    ConcurrentHashMap<Integer, Communication> map = new ConcurrentHashMap<Integer, Communication>();
    map.put(taskGroupId, communication);
    ReflectUtil.setField(new LocalTGCommunicationManager(), "taskGroupCommunicationMap", map);
    ProcessInnerReporter processInnerReporter = new ProcessInnerReporter();
    Communication updateCommunication = new Communication();
    updateCommunication.setState(State.WAITING);
    processInnerReporter.reportTGCommunication(taskGroupId, updateCommunication);
    Assert.assertEquals(map.get(taskGroupId).getState(), State.WAITING);
}
Also used : ProcessInnerReporter(com.alibaba.datax.core.statistics.container.report.ProcessInnerReporter) ConcurrentHashMap(java.util.concurrent.ConcurrentHashMap) LocalTGCommunicationManager(com.alibaba.datax.core.statistics.communication.LocalTGCommunicationManager) Communication(com.alibaba.datax.core.statistics.communication.Communication) Test(org.junit.Test)

Aggregations

Communication (com.alibaba.datax.core.statistics.communication.Communication)2 ProcessInnerReporter (com.alibaba.datax.core.statistics.container.report.ProcessInnerReporter)2 Test (org.junit.Test)2 LocalTGCommunicationManager (com.alibaba.datax.core.statistics.communication.LocalTGCommunicationManager)1 ConcurrentHashMap (java.util.concurrent.ConcurrentHashMap)1