Examples of ExporterBean


Examples of com.asakusafw.bulkloader.bean.ExporterBean

        TestUtils util = new TestUtils(testDataDir);
        // テストデータをセット
        util.storeToDatabase(false);

        // 処理の実行
        ExporterBean bean = new ExporterBean();
        bean.setExecutionId("JOB_FLOW01-002");
        bean.setJobflowId("JOBFLOW-02");
        bean.setBatchId("BATCH02");
        bean.setJobflowSid("12");
        Recoverer recoverer = new StubRecoverer(){
            /* (非 Javadoc)
             * @see com.asakusafw.bulkloader.recoverer.Recoverer#getExportTempTable(java.lang.String)
             */
            @Override
View Full Code Here

Examples of com.asakusafw.bulkloader.bean.ExporterBean

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

            // パラメータオブジェクトを作成
            ExporterBean bean = createBean(targetName, batchId, jobflowId, executionId);
            if (bean == null) {
                // パラメータのチェックでエラー
                LOG.error("TG-COLLECTOR-01006",
                        new Date(), targetName, batchId, jobflowId, executionId, user);
                return Constants.EXIT_CODE_ERROR;
View Full Code Here

Examples of com.asakusafw.bulkloader.bean.ExporterBean

     * @param jobFlowId ジョブフローID
     * @param jobnetInctanceId ジョブフロー実行ID
     * @return パラメータを保持するBean
     */
    private ExporterBean createBean(String targetName, String batchId, String jobFlowId, String jobnetInctanceId) {
        ExporterBean bean = new ExporterBean();
        // ターゲット名
        bean.setTargetName(targetName);
        // バッチID
        bean.setBatchId(batchId);
        // ジョブフローID
        bean.setJobflowId(jobFlowId);
        // ジョブフロー実行ID
        bean.setExecutionId(jobnetInctanceId);

        // DSLプロパティを読み込み
        JobFlowParamLoader dslLoader = createJobFlowParamLoader();
        if (!dslLoader.loadExportParam(bean.getTargetName(), bean.getBatchId(), bean.getJobflowId())) {
            return null;
        }
        bean.setExportTargetTable(dslLoader.getExportTargetTables());

        return bean;
    }
View Full Code Here

Examples of com.asakusafw.bulkloader.bean.ExporterBean

                stmt.setString(1, executionId);
            }
            rs = DBConnection.executeQuery(stmt, sql, new String[] { executionId });
            List<ExporterBean> beanList = new ArrayList<ExporterBean>();
            while (rs.next()) {
                ExporterBean bean = new ExporterBean();
                bean.setJobflowSid(rs.getString("JOBFLOW_SID"));
                bean.setBatchId(rs.getString("BATCH_ID"));
                bean.setJobflowId(rs.getString("JOBFLOW_ID"));
                bean.setTargetName(rs.getString("TARGET_NAME"));
                bean.setExecutionId(rs.getString("EXECUTION_ID"));
                beanList.add(bean);
            }
            return beanList;
        } catch (SQLException e) {
            if (hasCondition) {
View Full Code Here

Examples of com.asakusafw.bulkloader.bean.ExporterBean

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

            // パラメータオブジェクトを作成
            ExporterBean bean = createBean(targetName, batchId, jobflowId, executionId);
            if (bean == null) {
                // パラメータのチェックでエラー
                LOG.error("TG-EXPORTER-01006",
                        new Date(), targetName, batchId, jobflowId, executionId);
                return Constants.EXIT_CODE_ERROR;
            }

            if (RuntimeContext.get().isSimulation()) {
                // check only DB connection
                DBConnection.getConnection().close();
                return Constants.EXIT_CODE_SUCCESS;
            }

            // ジョブフロー実行IDの排他制御
            LOG.info("TG-EXPORTER-01018",
                    targetName, batchId, jobflowId, executionId);
            try {
                lockConn = DBConnection.getConnection();
                if (!DBAccessUtil.getJobflowInstanceLock(bean.getExecutionId(), lockConn)) {
                    LOG.error("TG-EXPORTER-01016",
                            new Date(), targetName, batchId, jobflowId, executionId);
                    return Constants.EXIT_CODE_ERROR;
                } else {
                    LOG.info("TG-EXPORTER-01019",
                            targetName, batchId, jobflowId, executionId);
                }
            } catch (BulkLoaderSystemException e) {
                LOG.log(e);
                LOG.error("TG-EXPORTER-01017",
                        new Date(), targetName, batchId, jobflowId, executionId);
                return Constants.EXIT_CODE_ERROR;
            }

            // ジョブフローSIDを取得する
            try {
                String jobflowSid = DBAccessUtil.selectJobFlowSid(bean.getExecutionId());
                bean.setJobflowSid(jobflowSid);
            } catch (BulkLoaderSystemException e) {
                LOG.log(e);
                LOG.error("TG-EXPORTER-01010",
                        new Date(), targetName, batchId, jobflowId, executionId);
                return Constants.EXIT_CODE_ERROR;
            }

            // 実行する処理を判断する
            JudgeExecProcess judge = createJudgeExecProcess();
            if (!judge.judge(bean)) {
                return Constants.EXIT_CODE_ERROR;
            }

            // TODO ファイル転送とDBロードをマルチスレッドで起動処理する

            // テンポラリテーブル削除処理を実行する
            if (judge.isExecTempTableDelete()) {
                LOG.info("TG-EXPORTER-01020",
                        targetName, batchId, jobflowId, executionId, bean.getJobflowSid());
                TempTableDelete tempDelete = createTempTableDelete();
                if (!tempDelete.delete(judge.getExportTempTableBean(), true)) {
                    LOG.error("TG-EXPORTER-01013",
                            new Date(), targetName, batchId, jobflowId, executionId, bean.getJobflowSid());
                    return Constants.EXIT_CODE_ERROR;
                } else {
                    LOG.info("TG-EXPORTER-01021",
                            targetName, batchId, jobflowId, executionId, bean.getJobflowSid());
                }
            }

            // Exportファイル受信処理処理を実行する
            if (judge.isExecReceive()) {
View Full Code Here

Examples of com.asakusafw.bulkloader.bean.ExporterBean

     * @param jobFlowId ジョブフローID
     * @param executionId ジョブフロー実行ID
     * @return Exporterで使用するパラメータを保持するオブジェクト
     */
    private ExporterBean createBean(String targetName, String batchId, String jobFlowId, String executionId) {
        ExporterBean bean = new ExporterBean();
        // ターゲット名
        bean.setTargetName(targetName);
        // バッチID
        bean.setBatchId(batchId);
        // ジョブフローID
        bean.setJobflowId(jobFlowId);
        // ジョブフロー実行ID
        bean.setExecutionId(executionId);

        // リトライ回数・リトライインターバル
        bean.setRetryCount(Integer.parseInt(
                ConfigurationLoader.getProperty(Constants.PROP_KEY_EXP_RETRY_COUNT)));
        bean.setRetryInterval(Integer.parseInt(
                ConfigurationLoader.getProperty(Constants.PROP_KEY_EXP_RETRY_INTERVAL)));

        // DSLプロパティを読み込み
        JobFlowParamLoader dslLoader = createJobFlowParamLoader();
        if (!dslLoader.loadExportParam(bean.getTargetName(), bean.getBatchId(), bean.getJobflowId())) {
            return null;
        }
        bean.setExportTargetTable(dslLoader.getExportTargetTables());
        if (!dslLoader.loadImportParam(bean.getTargetName(), bean.getBatchId(), bean.getJobflowId(), true)) {
            return null;
        }
        bean.setImportTargetTable(dslLoader.getImportTargetTables());

        return bean;
    }
View Full Code Here

Examples of com.asakusafw.bulkloader.bean.ExporterBean

        list2.add("src/test/data/collector3");
        table2.setDfsFilePaths(list2);
        table2.setExportTargetType(NullWritable.class);
        targetTable.put("EXP_TARGET2", table2);

        ExporterBean bean = new ExporterBean();
        bean.setExportTargetTable(targetTable);
        bean.setExecutionId(executionId);

        // テスト対象クラス実行
        DummyExportFileSend send = new DummyExportFileSend();
        boolean result = send.sendExportFile(bean, "hadoop");
View Full Code Here

Examples of com.asakusafw.bulkloader.bean.ExporterBean

        list2.add("/src/test/data/collector3");
        table2.setDfsFilePaths(list2);
        table2.setExportTargetType(NullWritable.class);
        targetTable.put("EXP_TARGET2", table2);

        ExporterBean bean = new ExporterBean();
        bean.setExportTargetTable(targetTable);
        bean.setExecutionId(executionId);

        // テスト対象クラス実行
        DummyExportFileSend send = new DummyExportFileSend() {

            /* (非 Javadoc)
View Full Code Here

Examples of com.asakusafw.bulkloader.bean.ExporterBean

        table2.setErrorTableName("IMPORT_TARGET2_ERROR");
        table2.setErrorTableColumns(Arrays.asList(new String[]{"TEXTDATA2", "INTDATA2", "DATEDATA2"}));
        table2.setErrorCodeColumn("ERROR_CODE");
        table2.setErrorCode("ERR02");
        targetTable.put("IMPORT_TARGET2", table2);
        ExporterBean bean = new ExporterBean();
        bean.setExportTargetTable(targetTable);
        bean.setJobflowSid("11");
        bean.setJobflowId(jobflowId);
        bean.setExecutionId(executionId);

        // テスト対象クラスを生成
        ExportDataCopy copy = new ExportDataCopy();

        // テスト対象クラス実行
View Full Code Here

Examples of com.asakusafw.bulkloader.bean.ExporterBean

        table1.setErrorTableName("IMPORT_TARGET1_ERROR");
        table1.setErrorTableColumns(Arrays.asList(new String[]{"TEXTDATA1", "INTDATA1", "DATEDATA1"}));
        table1.setErrorCodeColumn("ERROR_CODE");
        table1.setErrorCode("ERR01");
        targetTable.put("IMPORT_TARGET1", table1);
        ExporterBean bean = new ExporterBean();
        bean.setExportTargetTable(targetTable);
        bean.setJobflowSid("11");
        bean.setJobflowId(jobflowId);
        bean.setExecutionId(executionId);

        // テスト対象クラスを生成
        ExportDataCopy copy = new ExportDataCopy();

        // テスト対象クラス実行
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.