Package com.alibaba.otter.shared.etl.model

Examples of com.alibaba.otter.shared.etl.model.Identity


    /**
     * 返回结果为已处理成功的记录
     */
    public DbLoadContext load(RowBatch rowBatch, WeightController controller) {
        Assert.notNull(rowBatch);
        Identity identity = rowBatch.getIdentity();
        DbLoadContext context = buildContext(identity);

        try {
            List<EventData> datas = rowBatch.getDatas();
            context.setPrepareDatas(datas);
View Full Code Here


                            }

                            Channel channel = configClientService.findChannelByPipelineId(pipelineId);
                            RowBatch rowBatch = new RowBatch();
                            // 构造唯一标识
                            Identity identity = new Identity();
                            identity.setChannelId(channel.getId());
                            identity.setPipelineId(pipelineId);
                            identity.setProcessId(etlEventData.getProcessId());
                            rowBatch.setIdentity(identity);
                            // 进行数据合并
                            for (EventData data : eventData) {
                                rowBatch.merge(data);
                            }
View Full Code Here

    public void extract(DbBatch dbBatch) throws ExtractException {
        List<FileData> fileDatas = doFileExtract(dbBatch.getRowBatch());
        FileBatch fileBatch = new FileBatch();
        fileBatch.setFiles(fileDatas);
        Identity identity = new Identity();
        identity.setChannelId(dbBatch.getRowBatch().getIdentity().getChannelId());
        identity.setPipelineId(dbBatch.getRowBatch().getIdentity().getPipelineId());
        identity.setProcessId(dbBatch.getRowBatch().getIdentity().getProcessId());
        fileBatch.setIdentity(identity);
        dbBatch.setFileBatch(fileBatch);
    }
View Full Code Here

        return identityBuilder.build();
    }

    // 从proto对象构造回object
    private Identity build(BatchProto.Identity identityProto) {
        Identity identity = new Identity();
        identity.setChannelId(identityProto.getChannelId());
        identity.setPipelineId(identityProto.getPipelineId());
        identity.setProcessId(identityProto.getProcessId());
        return identity;
    }
View Full Code Here

    private ConfigClientService configClientService;

    @Test
    public void testWithOutRootDir() throws Exception {
        File rootDir = new File("/null");
        Identity id = buildIdentity(1L, 2L, 3L);
        FileBatch fileBatch = buildFileBatch(id);
        fileBatch.getFiles().addAll(buildFileDatas("ns_", EventType.INSERT, 0, 20, false));

        try {
            fileLoadAction.load(fileBatch, rootDir, null);
View Full Code Here

                returns(pipeline);

            }
        };

        Identity id = buildIdentity(1L, 2L, 3L);
        FileBatch fileBatch = buildFileBatch(id);
        fileBatch.getFiles().addAll(buildFileDatas(null, EventType.INSERT, fileDataStartIndex, fileDataCount, true));

        WeightController controller = new WeightController(1);
        FileLoadContext context = fileLoadAction.load(fileBatch, ROOT_DIR, controller);
View Full Code Here

        return files;
    }

    protected Identity buildIdentity(long channelId, long pipelineId, long processId) {
        Identity identity = new Identity();
        identity.setChannelId(channelId);
        identity.setPipelineId(pipelineId);
        identity.setProcessId(processId);
        return identity;
    }
View Full Code Here

                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) {
View Full Code Here

                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 = generatorEventDataForMysql(0, 20, EventType.INSERT);
        for (EventData eventData : eventDatas) {
View Full Code Here

                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));
View Full Code Here

TOP

Related Classes of com.alibaba.otter.shared.etl.model.Identity

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.