use of com.qlangtech.tis.fullbuild.taskflow.TestParamContext in project tis by qlangtech.
the class TestIndexSwapTaskflowLauncher method createRangeChainContext.
//
public static DefaultChainContext createRangeChainContext(String collectionName, FullbuildPhase start, FullbuildPhase end, String... pts) throws Exception {
TestParamContext params = new TestParamContext();
params.set(IFullBuildContext.KEY_APP_SHARD_COUNT, String.valueOf(shardCount));
params.set(IFullBuildContext.KEY_APP_NAME, collectionName);
params.set(IFullBuildContext.KEY_WORKFLOW_NAME, "totalpay");
params.set(IFullBuildContext.KEY_WORKFLOW_ID, WF_ID);
params.set(IExecChainContext.COMPONENT_START, start.getName());
params.set(IExecChainContext.COMPONENT_END, end.getName());
final DefaultChainContext chainContext = new DefaultChainContext(params);
ExecutePhaseRange range = chainContext.getExecutePhaseRange();
Assert.assertEquals(start, range.getStart());
Assert.assertEquals(end, range.getEnd());
Map<IDumpTable, ITabPartition> dateParams = Maps.newHashMap();
chainContext.setAttribute(ExecChainContextUtils.PARTITION_DATA_PARAMS, new TabPartitions(dateParams));
chainContext.setAttribute(IExecChainContext.KEY_TASK_ID, TASK_ID);
// final PluginStore<IndexBuilderTriggerFactory> buildTriggerFactory = TIS.getPluginStore(IndexBuilderTriggerFactory.class);
// assertNotNull(buildTriggerFactory.getPlugin());
// if (pts.length > 0) {
// chainContext.setPs(pts[0]);
// } else {
// SimpleDateFormat format = new SimpleDateFormat("yyyyMMddHHmmss");
// String pt = format.format(new Date());
// chainContext.setPs(pt);
// }
chainContext.setMdcParamContext(() -> {
});
return chainContext;
}
use of com.qlangtech.tis.fullbuild.taskflow.TestParamContext in project tis by qlangtech.
the class TestIndexSwapTaskflowLauncherWithDataXTrigger method createRangeChainContext.
public static DefaultChainContext createRangeChainContext(FullbuildPhase start, FullbuildPhase end) throws Exception {
TestParamContext params = new TestParamContext();
params.set(IFullBuildContext.KEY_APP_NAME, DATAX_NAME);
params.set(IExecChainContext.COMPONENT_START, start.getName());
params.set(IExecChainContext.COMPONENT_END, end.getName());
final DefaultChainContext chainContext = new DefaultChainContext(params);
ExecutePhaseRange range = chainContext.getExecutePhaseRange();
Assert.assertEquals(start, range.getStart());
Assert.assertEquals(end, range.getEnd());
chainContext.setAttribute(IExecChainContext.KEY_TASK_ID, TASK_ID);
chainContext.setMdcParamContext(() -> {
});
return chainContext;
}
Aggregations