Examples of ImportBean


Examples of com.asakusafw.bulkloader.bean.ImportBean

        assert batchId != null;
        assert flowId != null;
        assert tableName != null;
        assert executionId != null;
        try {
            ImportBean bean = createBean(targetName, batchId, flowId, executionId, tableName);
            if (bean == null) {
                return Constants.EXIT_CODE_ERROR;
            }
            if (RuntimeContext.get().isSimulation()) {
                return Constants.EXIT_CODE_SUCCESS;
View Full Code Here

Examples of com.asakusafw.bulkloader.bean.ImportBean

        assert batchId != null;
        assert jobflowId != null;
        assert executionId != null;
        assert tableName != null;

        ImportBean bean = new ImportBean();
        bean.setPrimary(false);
        bean.setTargetName(targetName);
        bean.setBatchId(batchId);
        bean.setJobflowId(jobflowId);
        bean.setExecutionId(executionId);
        bean.setJobnetEndTime(new Date(System.currentTimeMillis() + TimeUnit.DAYS.toMillis(10)));
        bean.setRetryCount(Integer.parseInt(
                ConfigurationLoader.getProperty(Constants.PROP_KEY_IMP_RETRY_COUNT)));
        bean.setRetryInterval(Integer.parseInt(
                ConfigurationLoader.getProperty(Constants.PROP_KEY_IMP_RETRY_INTERVAL)));

        JobFlowParamLoader loader = new JobFlowParamLoader();
        if (loader.loadCacheBuildParam(targetName, batchId, jobflowId) == false) {
            return null;
        }
        ImportTargetTableBean table = null;
        for (Map.Entry<String, ImportTargetTableBean> entry : loader.getImportTargetTables().entrySet()) {
            if (entry.getKey().equals(tableName)) {
                table = entry.getValue();
                break;
            }
        }
        if (table == null) {
            LOG.error("TG-BUILDCACHE-01005", targetName, batchId, jobflowId, executionId, tableName);
            return null;
        }
        if (table.getCacheId() == null) {
            LOG.error("TG-BUILDCACHE-01006", targetName, batchId, jobflowId, executionId, tableName);
            return null;
        }
        bean.setTargetTable(Collections.singletonMap(tableName, table));
        return bean;
    }
View Full Code Here

Examples of com.asakusafw.bulkloader.bean.ImportBean

        tableBean2.setImportFile(importFile2);
        targetTable.put("IMPORT_TARGET2", tableBean2);
        ImportTargetTableBean tableBean3 = new ImportTargetTableBean();
        tableBean3.setImportFile(importFile3);
        targetTable.put("IMPORT_TARGET3", tableBean3);
        ImportBean bean = new ImportBean();
        bean.setTargetTable(targetTable);

        // テスト対象クラス実行
        ImportFileDelete delete = new ImportFileDelete();
        delete.deleteFile(bean);
View Full Code Here

Examples of com.asakusafw.bulkloader.bean.ImportBean

        tableBean2.setImportFile(importFile2);
        targetTable.put("IMPORT_TARGET2", tableBean2);
        ImportTargetTableBean tableBean3 = new ImportTargetTableBean();
        tableBean3.setImportFile(importFile3);
        targetTable.put("IMPORT_TARGET3", tableBean3);
        ImportBean bean = new ImportBean();
        bean.setTargetTable(targetTable);

        // テスト対象クラス実行
        ImportFileDelete delete = new ImportFileDelete();
        delete.deleteFile(bean);
View Full Code Here

Examples of com.asakusafw.bulkloader.bean.ImportBean

        tableBean2.setImportFile(importFile2);
        targetTable.put("IMPORT_TARGET2", tableBean2);
        ImportTargetTableBean tableBean3 = new ImportTargetTableBean();
        tableBean3.setImportFile(importFile3);
        targetTable.put("IMPORT_TARGET3", tableBean3);
        ImportBean bean = new ImportBean();
        bean.setTargetTable(targetTable);

        // テスト対象クラス実行
        ImportFileDelete delete = new ImportFileDelete();
        delete.deleteFile(bean);
View Full Code Here

Examples of com.asakusafw.bulkloader.bean.ImportBean

            tableBean2.setImportFile(importFile2);
            targetTable.put("IMPORT_TARGET2", tableBean2);
            ImportTargetTableBean tableBean3 = new ImportTargetTableBean();
            tableBean3.setImportFile(importFile3);
            targetTable.put("IMPORT_TARGET3", tableBean3);
            ImportBean bean = new ImportBean();
            bean.setTargetTable(targetTable);

            // テスト対象クラス実行
            ImportFileDelete delete = new ImportFileDelete();
            delete.deleteFile(bean);
        } finally {
View Full Code Here

Examples of com.asakusafw.bulkloader.bean.ImportBean

        targetTable.put("IMPORT_TARGET1", tableBean1);
        ImportTargetTableBean tableBean2 = new ImportTargetTableBean();
        tableBean2.setDfsFilePath("/asakusa/import/XXX");
        tableBean2.setImportTargetType(this.getClass());
        targetTable.put("IMPORT_TARGET2", tableBean2);
        ImportBean bean = new ImportBean();
        bean.setTargetTable(targetTable);
        bean.setExecutionId(executionId);

        // プロパティを修正
        Properties prop = ConfigurationLoader.getProperty();
        prop.setProperty(Constants.PROP_KEY_BASE_PATH, "INVALIDFS://");
View Full Code Here

Examples of com.asakusafw.bulkloader.bean.ImportBean

            // 開始ログ出力
            LOG.info("TG-IMPORTER-01001",
                    new Date(), importerType, targetName, batchId, jobflowId, executionId);

            // パラメータオブジェクトを作成
            ImportBean bean =
                createBean(importerType, targetName, batchId, jobflowId, executionId, endDate, recoveryTable);
            if (bean == null) {
                // パラメータのチェックでエラー
                LOG.error("TG-IMPORTER-01009",
                        new Date(), importerType, targetName, batchId, jobflowId, executionId);
View Full Code Here

Examples of com.asakusafw.bulkloader.bean.ImportBean

            String executionId,
            String strEndDate,
            String recoveryTable) {

        // 引数を分解
        ImportBean bean = new ImportBean();
        // Import処理区分
        ImportType importType = ImportType.find(importerType);
        if (ImportType.PRIMARY.equals(importType)) {
            bean.setPrimary(true);
        } else if (ImportType.SECONDARY.equals(importType)) {
            bean.setPrimary(false);
        } else {
            LOG.error("TG-IMPORTER-01008", "Import処理区分", importerType);
            return null;
        }
        // ターゲット名
        bean.setTargetName(targetName);
        // バッチID
        bean.setBatchId(batchId);
        // ジョブフローID
        bean.setJobflowId(jobflowId);
        // ジョブフロー実行ID
        bean.setExecutionId(executionId);
        // ジョブネットの終了予定時刻
        if (strEndDate.length() != 14) {
            LOG.error("TG-IMPORTER-01008", "ジョブネットの終了予定時刻", strEndDate);
            return null;
        }

        SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMddHHmmss");
        Date endDate = null;
        try {
            Long.parseLong(strEndDate);
            endDate = sdf.parse(strEndDate);
        } catch (NumberFormatException e) {
            LOG.error(e, "TG-IMPORTER-01008", "ジョブネットの終了予定時刻", strEndDate);
            return null;
        } catch (ParseException e) {
            Integer.parseInt(strEndDate);
            LOG.error(e, "TG-IMPORTER-01008", "ジョブネットの終了予定時刻", strEndDate);
            return null;
        }
        bean.setJobnetEndTime(endDate);

        // プロパティから値を取得
        // リトライ回数・リトライインターバル
        bean.setRetryCount(Integer.parseInt(
                ConfigurationLoader.getProperty(Constants.PROP_KEY_IMP_RETRY_COUNT)));
        bean.setRetryInterval(Integer.parseInt(
                ConfigurationLoader.getProperty(Constants.PROP_KEY_IMP_RETRY_INTERVAL)));

        // DSLプロパティを読み込み
        JobFlowParamLoader paramLoader = createJobFlowParamLoader();
        if (!paramLoader.loadImportParam(
                bean.getTargetName(), bean.getBatchId(), bean.getJobflowId(), bean.isPrimary())) {
            return null;
        }
        bean.setTargetTable(paramLoader.getImportTargetTables());

        return bean;
    }
View Full Code Here

Examples of com.asakusafw.bulkloader.bean.ImportBean

     * no local cache information.
     * @throws Exception if failed
     */
    @Test(timeout =  5000L)
    public void withoutCache() throws Exception {
        ImportBean bean = createBean();
        Map<String, ImportTargetTableBean> map = new HashMap<String, ImportTargetTableBean>();
        ImportTargetTableBean table = new ImportTargetTableBean();
        table.setDfsFilePath("normal");
        map.put("normal", table);
        bean.setTargetTable(map);

        GetCacheInfoLocal service = new Mock();
        Map<String, CacheInfo> results = service.get(bean);
        assertThat(results.size(), is(0));
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.