Package com.asakusafw.bulkloader.bean

Examples of com.asakusafw.bulkloader.bean.ExportTargetTableBean


        ExporterBean bean = new ExporterBean();
        bean.setJobflowSid("11");
        bean.setJobflowId("jobflow1");
        bean.setExecutionId("11-1");
        Map<String, ExportTargetTableBean> targetTable = new HashMap<String, ExportTargetTableBean>();
        targetTable.put("table1", new ExportTargetTableBean());
        targetTable.put("table2", new ExportTargetTableBean());
        bean.setExportTargetTable(targetTable);

        Properties p = ConfigurationLoader.getProperty();
        p.setProperty(Constants.PROP_KEY_EXPORT_TSV_DELETE, TsvDeleteType.TRUE.getSymbol());
        ConfigurationLoader.setProperty(p);
View Full Code Here


    public void checkExportParamTest03() throws Exception {
        JobFlowParamLoader loader = new JobFlowParamLoader();

        // 設定
        Map<String, ExportTargetTableBean> targetTable = new LinkedHashMap<String, ExportTargetTableBean>();
        ExportTargetTableBean table1 = new ExportTargetTableBean();
        // 重複チェックを行うか否か
        table1.setDuplicateCheck(true);
        // Export対象テーブルに対応する異常データテーブル
        table1.setErrorTableName("XXX_ERROR");
        // Export中間TSVファイルに対応するカラム名
        table1.setExportTsvColumns(null);
        // Export対象テーブルのカラム名
        table1.setExportTableColumns(Arrays.asList(new String[]{"TEXTDATA1", "INTDATA1"}));
        // 異常データテーブルのカラム名
        table1.setErrorTableColumns(Arrays.asList(new String[]{"INTDATA1"}));
        // キー項目のカラム名
        table1.setKeyColumns(Arrays.asList(new String[]{"TEXTDATA1"}));
        // エラーコードを格納するカラム名
        table1.setErrorCodeColumn("ERROR_CODE");
        // 重複チェックエラーのエラーコードの値
        table1.setErrorCode("ERR01");
        // Export対象テーブルに対応するJavaBeanのクラス名
        table1.setExportTargetType(this.getClass());
        // Export対象テーブルのデータをHDFS上に書き出す際のファイルパス
        List<String> list1 = new ArrayList<String>();
        list1.add("hdfs://localhost/user/asakusa/import/11/XXX_1");
        table1.setDfsFilePaths(list1);
        targetTable.put("EXP_TARGET1", table1);

        // テスト実行1
        boolean result = loader.checkExportParam(targetTable, targetName, "1", "dummyFileName");
        assertFalse(result);

        // 設定変更
        table1.setExportTsvColumns(Arrays.asList(new String[]{"TEXTDATA1", "INTDATA1", null}));

        // テスト実行2
        result = loader.checkExportParam(targetTable, "1", targetName, "dummyFileName");
        assertFalse(result);

        // 設定変更
        table1.setExportTsvColumns(Arrays.asList(new String[]{"TEXTDATA1", "INTDATA1", ""}));

        // テスト実行3
        result = loader.checkExportParam(targetTable, "1", targetName, "dummyFileName");
        assertFalse(result);

        // 設定変更
        table1.setExportTsvColumns(Arrays.asList(new String[]{}));

        // テスト実行4
        result = loader.checkExportParam(targetTable, "1", targetName, "dummyFileName");
        assertFalse(result);
    }
View Full Code Here

    public void checkExportParamTest04() throws Exception {
        JobFlowParamLoader loader = new JobFlowParamLoader();

        // 設定
        Map<String, ExportTargetTableBean> targetTable = new LinkedHashMap<String, ExportTargetTableBean>();
        ExportTargetTableBean table1 = new ExportTargetTableBean();
        // 重複チェックを行うか否か
        table1.setDuplicateCheck(true);
        // Export対象テーブルに対応する異常データテーブル
        table1.setErrorTableName("XXX_ERROR");
        // Export中間TSVファイルに対応するカラム名
        table1.setExportTsvColumns(Arrays.asList(new String[]{"TEXTDATA1", "INTDATA1", "DATEDATA1"}));
        // Export対象テーブルのカラム名
        table1.setExportTableColumns(Arrays.asList(new String[]{}));
        // 異常データテーブルのカラム名
        table1.setErrorTableColumns(Arrays.asList(new String[]{"INTDATA1"}));
        // キー項目のカラム名
        table1.setKeyColumns(Arrays.asList(new String[]{"TEXTDATA1"}));
        // エラーコードを格納するカラム名
        table1.setErrorCodeColumn("ERROR_CODE");
        // 重複チェックエラーのエラーコードの値
        table1.setErrorCode("ERR01");
        // Export対象テーブルに対応するJavaBeanのクラス名
        table1.setExportTargetType(this.getClass());
        // Export対象テーブルのデータをHDFS上に書き出す際のファイルパス
        List<String> list1 = new ArrayList<String>();
        list1.add("hdfs://localhost/user/asakusa/import/11/XXX_1");
        table1.setDfsFilePaths(list1);
        targetTable.put("EXP_TARGET1", table1);

        // テスト実行1
        boolean result = loader.checkExportParam(targetTable, targetName, "1", "dummyFileName");
        assertFalse(result);

        // 設定変更
        table1.setExportTableColumns(Arrays.asList(new String[]{"TEXTDATA1", "INTDATA1", null}));

        // テスト実行2
        result = loader.checkExportParam(targetTable, targetName, "1", "dummyFileName");
        assertFalse(result);

        // 設定変更
        table1.setExportTableColumns(Arrays.asList(new String[]{"TEXTDATA1", "INTDATA1", ""}));

        // テスト実行3
        result = loader.checkExportParam(targetTable, targetName, "1", "dummyFileName");
        assertFalse(result);
    }
View Full Code Here

    public void checkExportParamTest05() throws Exception {
        JobFlowParamLoader loader = new JobFlowParamLoader();

        // 設定
        Map<String, ExportTargetTableBean> targetTable = new LinkedHashMap<String, ExportTargetTableBean>();
        ExportTargetTableBean table1 = new ExportTargetTableBean();
        // 重複チェックを行うか否か
        table1.setDuplicateCheck(true);
        // Export対象テーブルに対応する異常データテーブル
        table1.setErrorTableName("XXX_ERROR");
        // Export中間TSVファイルに対応するカラム名
        table1.setExportTsvColumns(Arrays.asList(new String[]{"TEXTDATA1", "INTDATA1", "DATEDATA1"}));
        // Export対象テーブルのカラム名
        table1.setExportTableColumns(Arrays.asList(new String[]{"TEXTDATA1", "INTDATA1"}));
        // 異常データテーブルのカラム名
        table1.setErrorTableColumns(Arrays.asList(new String[]{}));
        // キー項目のカラム名
        table1.setKeyColumns(Arrays.asList(new String[]{"TEXTDATA1"}));
        // エラーコードを格納するカラム名
        table1.setErrorCodeColumn("ERROR_CODE");
        // 重複チェックエラーのエラーコードの値
        table1.setErrorCode("ERR01");
        // Export対象テーブルに対応するJavaBeanのクラス名
        table1.setExportTargetType(this.getClass());
        // Export対象テーブルのデータをHDFS上に書き出す際のファイルパス
        List<String> list1 = new ArrayList<String>();
        list1.add("hdfs://localhost/user/asakusa/import/11/XXX_1");
        table1.setDfsFilePaths(list1);
        targetTable.put("EXP_TARGET1", table1);

        // テスト実行1
        boolean result = loader.checkExportParam(targetTable, targetName, "1", "dummyFileName");
        assertFalse(result);

        // 設定変更
        table1.setErrorTableColumns(Arrays.asList(new String[]{"TEXTDATA1", "INTDATA1", null}));

        // テスト実行2
        result = loader.checkExportParam(targetTable, targetName, "1", "dummyFileName");
        assertFalse(result);

        // 設定変更
        table1.setErrorTableColumns(Arrays.asList(new String[]{"TEXTDATA1", "INTDATA1", ""}));

        // テスト実行3
        result = loader.checkExportParam(targetTable, targetName, "1", "dummyFileName");
        assertFalse(result);
    }
View Full Code Here

    public void checkExportParamTest06() throws Exception {
        JobFlowParamLoader loader = new JobFlowParamLoader();

        // 設定
        Map<String, ExportTargetTableBean> targetTable = new LinkedHashMap<String, ExportTargetTableBean>();
        ExportTargetTableBean table1 = new ExportTargetTableBean();
        // 重複チェックを行うか否か
        table1.setDuplicateCheck(true);
        // Export対象テーブルに対応する異常データテーブル
        table1.setErrorTableName("XXX_ERROR");
        // Export中間TSVファイルに対応するカラム名
        table1.setExportTsvColumns(Arrays.asList(new String[]{"TEXTDATA1", "INTDATA1", "DATEDATA1"}));
        // Export対象テーブルのカラム名
        table1.setExportTableColumns(Arrays.asList(new String[]{"TEXTDATA1", "INTDATA1"}));
        // 異常データテーブルのカラム名
        table1.setErrorTableColumns(Arrays.asList(new String[]{"INTDATA1"}));
        // キー項目のカラム名
        table1.setKeyColumns(Arrays.asList(new String[]{}));
        // エラーコードを格納するカラム名
        table1.setErrorCodeColumn("ERROR_CODE");
        // 重複チェックエラーのエラーコードの値
        table1.setErrorCode("ERR01");
        // Export対象テーブルに対応するJavaBeanのクラス名
        table1.setExportTargetType(this.getClass());
        // Export対象テーブルのデータをHDFS上に書き出す際のファイルパス
        List<String> list1 = new ArrayList<String>();
        list1.add("hdfs://localhost/user/asakusa/import/11/XXX_1");
        table1.setDfsFilePaths(list1);
        targetTable.put("EXP_TARGET1", table1);

        // テスト実行1
        boolean result = loader.checkExportParam(targetTable, targetName, "1", "dummyFileName");
        assertFalse(result);

        // 設定変更
        table1.setKeyColumns(Arrays.asList(new String[]{"TEXTDATA1", "INTDATA1", null}));

        // テスト実行2
        result = loader.checkExportParam(targetTable, targetName, "1", "dummyFileName");
        assertFalse(result);

        // 設定変更
        table1.setKeyColumns(Arrays.asList(new String[]{"TEXTDATA1", "INTDATA1", ""}));

        // テスト実行3
        result = loader.checkExportParam(targetTable, targetName, "1", "dummyFileName");
        assertFalse(result);
    }
View Full Code Here

    public void checkExportParamTest07() throws Exception {
        JobFlowParamLoader loader = new JobFlowParamLoader();

        // 設定
        Map<String, ExportTargetTableBean> targetTable = new LinkedHashMap<String, ExportTargetTableBean>();
        ExportTargetTableBean table1 = new ExportTargetTableBean();
        // 重複チェックを行うか否か
        table1.setDuplicateCheck(true);
        // Export対象テーブルに対応する異常データテーブル
        table1.setErrorTableName("XXX_ERROR");
        // Export中間TSVファイルに対応するカラム名
        table1.setExportTsvColumns(Arrays.asList(new String[]{"TEXTDATA1", "INTDATA1", "DATEDATA1"}));
        // Export対象テーブルのカラム名
        table1.setExportTableColumns(Arrays.asList(new String[]{"TEXTDATA1", "INTDATA1"}));
        // 異常データテーブルのカラム名
        table1.setErrorTableColumns(Arrays.asList(new String[]{"INTDATA1"}));
        // キー項目のカラム名
        table1.setKeyColumns(Arrays.asList(new String[]{"TEXTDATA1"}));
        // エラーコードを格納するカラム名
        table1.setErrorCodeColumn(null);
        // 重複チェックエラーのエラーコードの値
        table1.setErrorCode("ERR01");
        // Export対象テーブルに対応するJavaBeanのクラス名
        table1.setExportTargetType(this.getClass());
        // Export対象テーブルのデータをHDFS上に書き出す際のファイルパス
        List<String> list1 = new ArrayList<String>();
        list1.add("hdfs://localhost/user/asakusa/import/11/XXX_1");
        table1.setDfsFilePaths(list1);
        targetTable.put("EXP_TARGET1", table1);

        // テスト実行1
        boolean result = loader.checkExportParam(targetTable, targetName, "1", "dummyFileName");
        assertFalse(result);

        // 設定変更
        table1.setErrorCodeColumn("");

        // テスト実行2
        result = loader.checkExportParam(targetTable, targetName, "1", "dummyFileName");
        assertFalse(result);
    }
View Full Code Here

        importFile2.createNewFile();
        importFile3.createNewFile();

        // ExporterBeanを生成
        Map<String, ExportTargetTableBean> targetTable = new LinkedHashMap<String, ExportTargetTableBean>();
        ExportTargetTableBean bean1 = new ExportTargetTableBean();
        bean1.addExportFile(importFile1);
        bean1.addExportFile(importFile2);
        targetTable.put("IMPORT_TARGET1", bean1);
        ExportTargetTableBean bean2 = new ExportTargetTableBean();
        bean2.addExportFile(importFile3);
        targetTable.put("IMPORT_TARGET2", bean2);

        ExporterBean bean = new ExporterBean();
        bean.setExportTargetTable(targetTable);
View Full Code Here

        File importFile2 = new File(dumpDir, "EXP_IMPORT_TARGET2.tsv");
        File importFile3 = new File(dumpDir, "EXP_IMPORT_TARGET3.tsv");

        // ExporterBeanを生成
        Map<String, ExportTargetTableBean> targetTable = new LinkedHashMap<String, ExportTargetTableBean>();
        ExportTargetTableBean bean1 = new ExportTargetTableBean();
        bean1.addExportFile(importFile1);
        bean1.addExportFile(importFile2);
        targetTable.put("IMPORT_TARGET1", bean1);
        ExportTargetTableBean bean2 = new ExportTargetTableBean();
        bean2.addExportFile(importFile3);
        targetTable.put("IMPORT_TARGET2", bean2);

        ExporterBean bean = new ExporterBean();
        bean.setExportTargetTable(targetTable);
View Full Code Here

    public void checkExportParamTest08() throws Exception {
        JobFlowParamLoader loader = new JobFlowParamLoader();

        // 設定
        Map<String, ExportTargetTableBean> targetTable = new LinkedHashMap<String, ExportTargetTableBean>();
        ExportTargetTableBean table1 = new ExportTargetTableBean();
        // 重複チェックを行うか否か
        table1.setDuplicateCheck(true);
        // Export対象テーブルに対応する異常データテーブル
        table1.setErrorTableName("XXX_ERROR");
        // Export中間TSVファイルに対応するカラム名
        table1.setExportTsvColumns(Arrays.asList(new String[]{"TEXTDATA1", "INTDATA1", "DATEDATA1"}));
        // Export対象テーブルのカラム名
        table1.setExportTableColumns(Arrays.asList(new String[]{"TEXTDATA1", "INTDATA1", "ERROR_CODE"}));
        // 異常データテーブルのカラム名
        table1.setErrorTableColumns(Arrays.asList(new String[]{"INTDATA1"}));
        // キー項目のカラム名
        table1.setKeyColumns(Arrays.asList(new String[]{"TEXTDATA1"}));
        // エラーコードを格納するカラム名
        table1.setErrorCodeColumn("ERROR_CODE");
        // 重複チェックエラーのエラーコードの値
        table1.setErrorCode("ERR01");
        // Export対象テーブルに対応するJavaBeanのクラス名
        table1.setExportTargetType(this.getClass());
        // Export対象テーブルのデータをHDFS上に書き出す際のファイルパス
        List<String> list1 = new ArrayList<String>();
        list1.add("hdfs://localhost/user/asakusa/import/11/XXX_1");
        table1.setDfsFilePaths(list1);
        targetTable.put("EXP_TARGET1", table1);

        // テスト実行
        boolean result = loader.checkExportParam(targetTable, targetName, "1", "dummyFileName");
        assertFalse(result);
View Full Code Here

        File importFile2 = null;
        File importFile3 = null;

        // ExporterBeanを生成
        Map<String, ExportTargetTableBean> targetTable = new LinkedHashMap<String, ExportTargetTableBean>();
        ExportTargetTableBean bean1 = new ExportTargetTableBean();
        bean1.addExportFile(importFile1);
        bean1.addExportFile(importFile2);
        targetTable.put("IMPORT_TARGET1", bean1);
        ExportTargetTableBean bean2 = new ExportTargetTableBean();
        bean2.addExportFile(importFile3);
        targetTable.put("IMPORT_TARGET2", bean2);

        ExporterBean bean = new ExporterBean();
        bean.setExportTargetTable(targetTable);
View Full Code Here

TOP

Related Classes of com.asakusafw.bulkloader.bean.ExportTargetTableBean

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.