Package com.alibaba.otter.node.etl.load.loader.weight

Examples of com.alibaba.otter.node.etl.load.loader.weight.WeightController


        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);
        want.object(context.getChannel()).isEqualTo(channel);
        want.object(context.getPipeline()).isEqualTo(pipeline);
        want.object(context.getPrepareDatas()).isEqualTo(fileBatch.getFiles());
        want.number(context.getProcessedDatas().size()).isEqualTo(fileBatch.getFiles().size());
View Full Code Here


    @Test
    public void test_simple() {
        int thread = 10;
        int count = 10;
        WeightController controller = new WeightController(thread);
        CountDownLatch latch = new CountDownLatch(thread);
        WeightWorkerTest[] workers = new WeightWorkerTest[thread];
        for (int i = 0; i < thread; i++) {
            int[] weights = new int[count];
            for (int j = 0; j < count; j++) {
View Full Code Here

        eventDatas = generatorEventDataForOracle(19, 1, EventType.DELETE);
        for (EventData eventData : eventDatas) {
            rowBatch.merge(eventData);
        }

        WeightController controller = new WeightController(1);
        dbLoadAction.load(rowBatch, controller);
    }
View Full Code Here

        eventDatas = generatorEventDataForMysql(19, 1, EventType.DELETE);
        for (EventData eventData : eventDatas) {
            rowBatch.merge(eventData);
        }

        WeightController controller = new WeightController(1);
        dbLoadAction.load(rowBatch, controller);
    }
View Full Code Here

        FileBatch fileBatch = new FileBatch();
        fileBatch.setIdentity(identity);
        fileBatch.getFiles().addAll(generatorLocalFileData("fileLoad", 10));

        WeightController controller = new WeightController(1);
        fileLoadAction.load(fileBatch, new File(tmp + File.separator + OTTERLOAD), controller);

        File target = new File(tmp + File.separator + OTTERLOAD + "_loaded/");
        want.number(target.listFiles().length).isEqualTo(10);
        NioUtils.delete(target);
View Full Code Here

        if (existFileBatch) {
            count += 1;
        }

        WeightController controller = new WeightController(count);
        List<Future> futures = new ArrayList<Future>();
        ExecutorCompletionService completionService = new ExecutorCompletionService(executorService);

        if (existFileBatch) {
            submitFileBatch(futures, completionService, fileBatch, data.getRoot(), controller);
View Full Code Here

TOP

Related Classes of com.alibaba.otter.node.etl.load.loader.weight.WeightController

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.