use of com.alibaba.otter.shared.etl.model.Identity in project otter by alibaba.
the class FileBatchConflictDetectServiceIntegration method test_localFile.
@Test
public void test_localFile() {
final Pipeline pipeline = new Pipeline();
pipeline.setId(100L);
final Node currentNode = new Node();
currentNode.setId(1L);
new NonStrictExpectations() {
{
configClientService.currentNode();
returns(currentNode);
configClientService.findPipeline(anyLong);
returns(pipeline);
}
};
Identity identity = new Identity();
identity.setChannelId(100L);
identity.setPipelineId(100L);
identity.setProcessId(100L);
FileBatch fileBatch = new FileBatch();
fileBatch.setIdentity(identity);
fileBatch.getFiles().addAll(generatorLocalFileData("fileLoad", 10));
FileBatch result = fileBatchConflictDetectService.detect(fileBatch, 1L);
want.number(result.getFiles().size()).isEqualTo(0);
NioUtils.delete(new File(tmp + File.separator + OTTERLOAD));
}
use of com.alibaba.otter.shared.etl.model.Identity in project otter by alibaba.
the class DatabaseExtractorTest method setUp.
@BeforeMethod
public void setUp() {
identity = new Identity();
identity.setChannelId(100L);
identity.setPipelineId(100L);
identity.setProcessId(100L);
}
use of com.alibaba.otter.shared.etl.model.Identity in project otter by alibaba.
the class FreedomExtractorTest method setUp.
@BeforeMethod
public void setUp() {
identity = new Identity();
identity.setChannelId(100L);
identity.setPipelineId(100L);
identity.setProcessId(100L);
}
use of com.alibaba.otter.shared.etl.model.Identity in project otter by alibaba.
the class DbLoadActionTest method test_db_load_oracle.
@Test
public void test_db_load_oracle() {
ArbitrateConfigRegistry.regist(configClientService);
dbLoadAction = (DbLoadAction) TestedObject.getSpringBeanFactory().getBean("dbLoadAction");
final Channel channel = new Channel();
channel.setId(1L);
final Pipeline pipeline = new Pipeline();
pipeline.setId(100L);
List<DataMediaPair> pairs = generatorDataMediaPairForOracle(20);
pipeline.setPairs(pairs);
pipeline.getParameters().merge(new SystemParameter());
pipeline.getParameters().merge(new ChannelParameter());
// final Pipeline oppositePipeline = new Pipeline();
// oppositePipeline.setId(101L);
channel.setPipelines(Arrays.asList(pipeline));
final Node currentNode = new Node();
currentNode.setId(1L);
new NonStrictExpectations() {
{
configClientService.findChannel(anyLong);
returns(channel);
configClientService.findPipeline(anyLong);
returns(pipeline);
configClientService.currentNode();
returns(currentNode);
}
};
Identity identity = new Identity();
identity.setChannelId(100L);
identity.setPipelineId(100L);
identity.setProcessId(100L);
RowBatch rowBatch = new RowBatch();
rowBatch.setIdentity(identity);
List<EventData> eventDatas = generatorEventDataForOracle(0, 20, EventType.INSERT);
for (EventData eventData : eventDatas) {
rowBatch.merge(eventData);
}
eventDatas = generatorEventDataForOracle(10, 10, EventType.INSERT);
for (EventData eventData : eventDatas) {
rowBatch.merge(eventData);
}
eventDatas = generatorEventDataForOracle(19, 1, EventType.DELETE);
for (EventData eventData : eventDatas) {
rowBatch.merge(eventData);
}
WeightController controller = new WeightController(1);
dbLoadAction.load(rowBatch, controller);
}
use of com.alibaba.otter.shared.etl.model.Identity in project otter by alibaba.
the class OtterTransformerFactory method translateIdentity.
private Identity translateIdentity(Identity identity) {
Identity result = new Identity();
result.setChannelId(identity.getChannelId());
result.setPipelineId(identity.getPipelineId());
result.setProcessId(identity.getProcessId());
return result;
}
Aggregations