/**
* 转化FileBatch对象
*/
public Map<Class, BatchObject> transform(FileBatch fileBatch) {
final Identity identity = translateIdentity(fileBatch.getIdentity());
List<FileData> fileDatas = fileBatch.getFiles();
Map<Class, BatchObject> result = new HashMap<Class, BatchObject>();
// 初始化默认值
result.put(FileData.class, initBatchObject(identity, FileData.class));
for (FileData fileData : fileDatas) {
// 进行转化
Long tableId = fileData.getTableId();
Pipeline pipeline = configClientService.findPipeline(identity.getPipelineId());
// 针对每个同步数据,可能会存在多路复制的情况
List<DataMediaPair> dataMediaPairs = ConfigHelper.findDataMediaPairByMediaId(pipeline, tableId);
for (DataMediaPair pair : dataMediaPairs) {
if (!pair.getSource().getId().equals(tableId)) { // 过滤tableID不为源的同步
continue;