Package com.asakusafw.bulkloader.exception

Examples of com.asakusafw.bulkloader.exception.BulkLoaderSystemException


            String executionId,
            String tableName) throws BulkLoaderSystemException {
        File fileDirectry = new File(ConfigurationLoader.getProperty(Constants.PROP_KEY_IMP_FILE_DIR));
        if (!prepareTemporaryDirectory(fileDirectry)) {
            // ディレクトリが存在しない場合は異常終了する。
            throw new BulkLoaderSystemException(CLASS, "TG-COMMON-00017",
                    fileDirectry.getAbsolutePath());
        }

        StringBuilder strFileName = new StringBuilder(Constants.IMPORT_FILE_PREFIX);
        strFileName.append(Constants.IMPORT_FILE_DELIMITER);
View Full Code Here


            } else {
                fs = FileSystem.get(basePath.toUri(), conf);
                basePath = fs.makeQualified(basePath);
            }
        } catch (IOException e) {
            throw new BulkLoaderSystemException(e, CLASS, "TG-COMMON-00019", rawPaths);
        }
        List<Path> results = new ArrayList<Path>();
        for (String rawPath : rawPaths) {
            String resolved = variables.parse(rawPath, false);
            Path fullPath;
View Full Code Here

        String strCompType = prop.getProperty(Constants.PROP_KEY_EXP_FILE_COMP_TYPE);
        FileCompType compType = FileCompType.find(strCompType);
        if (isEmpty(strCompType)) {
            prop.setProperty(Constants.PROP_KEY_EXP_FILE_COMP_TYPE, Constants.PROP_DEFAULT_EXP_FILE_COMP_TYPE);
        } else if (compType == null) {
            throw new BulkLoaderSystemException(CLASS, "TG-COMMON-00008",
                    "Exportファイルの圧縮有無が不正。値:" + null);
        }
        // エクスポート処理で中間TSVファイルを生成する際にTSVファイルの分割サイズ
        String loadMaxSize = prop.getProperty(Constants.PROP_KEY_EXP_LOAD_MAX_SIZE);
        if (isEmpty(loadMaxSize)) {
            prop.setProperty(
                    Constants.PROP_KEY_EXP_LOAD_MAX_SIZE,
                    Constants.PROP_DEFAULT_EXP_LOAD_MAX_SIZE);
        } else {
            if (!isNumber(loadMaxSize, 1)) {
                throw new BulkLoaderSystemException(CLASS, "TG-COMMON-00008",
                        "エクスポート処理中間TSVファイルを生成する際にTSVファイルを分割するサイズの設定が不正。設定値:" + loadMaxSize);
            }
        }

        // 出力ファイルの圧縮有無
View Full Code Here

        if (isEmpty(strCompType)) {
            prop.setProperty(
                    Constants.PROP_KEY_IMP_FILE_COMP_TYPE,
                    Constants.PROP_DEFAULT_IMP_FILE_COMP_TYPE);
        } else if (compType == null) {
            throw new BulkLoaderSystemException(CLASS, "TG-COMMON-00008",
                    "Importファイルの圧縮有無が不正。値:" + null);
        }
        // Importファイルの圧縮時のバッファサイズ
        String impBufSize = prop.getProperty(Constants.PROP_KEY_IMP_FILE_COMP_BUFSIZE);
        if (isEmpty(impBufSize)) {
            prop.setProperty(
                    Constants.PROP_KEY_IMP_FILE_COMP_BUFSIZE,
                    Constants.PROP_DEFAULT_IMP_FILE_COMP_BUFSIZE);
        } else {
            if (!isNumber(impBufSize, 1)) {
                throw new BulkLoaderSystemException(CLASS, "TG-COMMON-00008",
                        "Importファイルの圧縮時のバッファサイズの設定が不正。設定値:" + impBufSize);
            }
        }
        // Importerのリトライ回数
        String impRetryCount = prop.getProperty(Constants.PROP_KEY_IMP_RETRY_COUNT);
        if (isEmpty(impRetryCount)) {
            prop.setProperty(
                    Constants.PROP_KEY_IMP_RETRY_COUNT,
                    Constants.PROP_DEFAULT_IMP_RETRY_COUNT);
        } else {
            if (!isNumber(impRetryCount, 0)) {
                throw new BulkLoaderSystemException(CLASS, "TG-COMMON-00008",
                        "Importerのリトライ回数の設定が不正。設定値:" + impRetryCount);
            }
        }
        // Importerのリトライインターバル
        String impRetryInterval = prop.getProperty(Constants.PROP_KEY_IMP_RETRY_INTERVAL);
        if (isEmpty(impRetryInterval)) {
            prop.setProperty(
                    Constants.PROP_KEY_IMP_RETRY_INTERVAL,
                    Constants.PROP_DEFAULT_IMP_RETRY_INTERVAL);
        } else {
            if (!isNumber(impRetryInterval, 0)) {
                throw new BulkLoaderSystemException(CLASS, "TG-COMMON-00008",
                        "Importerのリトライインターバルの設定が不正。設定値:" + impRetryInterval);
            }
        }
        // Exportファイルの圧縮時のバッファサイズ
        String expBufSize = prop.getProperty(Constants.PROP_KEY_EXP_FILE_COMP_BUFSIZE);
        if (isEmpty(expBufSize)) {
            prop.setProperty(
                    Constants.PROP_KEY_EXP_FILE_COMP_BUFSIZE,
                    Constants.PROP_DEFAULT_EXP_FILE_COMP_BUFSIZE);
        } else {
            if (!isNumber(expBufSize, 1)) {
                throw new BulkLoaderSystemException(CLASS, "TG-COMMON-00008",
                        "Exportファイルの圧縮時のバッファサイズの設定が不正。設定値:" + expBufSize);
            }
        }
        // Exporterのリトライ回数
        String expRetryCount = prop.getProperty(Constants.PROP_KEY_EXP_RETRY_COUNT);
        if (isEmpty(expRetryCount)) {
            prop.setProperty(
                    Constants.PROP_KEY_EXP_RETRY_COUNT,
                    Constants.PROP_DEFAULT_EXP_RETRY_COUNT);
        } else {
            if (!isNumber(expRetryCount, 0)) {
                throw new BulkLoaderSystemException(CLASS, "TG-COMMON-00008",
                        "Exporterのリトライ回数の設定が不正。設定値:" + expRetryCount);
            }
        }
        // Exporterのリトライインターバル
        String expRetryInterval = prop.getProperty(Constants.PROP_KEY_EXP_RETRY_INTERVAL);
        if (isEmpty(expRetryInterval)) {
            prop.setProperty(
                    Constants.PROP_KEY_EXP_RETRY_INTERVAL,
                    Constants.PROP_DEFAULT_EXP_RETRY_INTERVAL);
        } else {
            if (!isNumber(expRetryInterval, 0)) {
                throw new BulkLoaderSystemException(CLASS, "TG-COMMON-00008",
                        "Exporterのリトライインターバルの設定が不正。設定値:" + expRetryInterval);
            }
        }
        // エクスポート処理でExport対象テーブルにデータをコピーする時の最大レコード数
        String copyMaxRecord = prop.getProperty(Constants.PROP_KEY_EXP_COPY_MAX_RECORD);
        if (isEmpty(copyMaxRecord)) {
            prop.setProperty(
                    Constants.PROP_KEY_EXP_COPY_MAX_RECORD,
                    Constants.PROP_DEFAULT_EXP_COPY_MAX_RECORD);
        } else {
            if (!isNumber(copyMaxRecord, 1)) {
                throw new BulkLoaderSystemException(CLASS, "TG-COMMON-00008",
                        "エクスポート処理でExport対象テーブルにデータをコピーする時の最大レコード数の設定が不正。設定値:" + copyMaxRecord);
            }
        }
        // インポート正常終了時のTSVファイル削除有無
        String deleteImportTsv = prop.getProperty(Constants.PROP_KEY_IMPORT_TSV_DELETE);
        TsvDeleteType delImpType = TsvDeleteType.find(deleteImportTsv);
        if (isEmpty(deleteImportTsv)) {
            prop.setProperty(
                    Constants.PROP_KEY_IMPORT_TSV_DELETE,
                    Constants.PROP_DEFAULT_IMPORT_TSV_DELETE);
        } else if (delImpType == null) {
            throw new BulkLoaderSystemException(CLASS, "TG-COMMON-00008",
                    "インポート正常終了時のTSVファイル削除有無が不正。値:" + deleteImportTsv);
        }
        // エクスポート正常終了時のTSVファイル削除有無
        String deleteExportTsv = prop.getProperty(Constants.PROP_KEY_EXPORT_TSV_DELETE);
        TsvDeleteType delExpType = TsvDeleteType.find(deleteExportTsv);
        if (isEmpty(deleteExportTsv)) {
            prop.setProperty(
                    Constants.PROP_KEY_EXPORT_TSV_DELETE,
                    Constants.PROP_DEFAULT_EXPORT_TSV_DELETE);
        } else if (delExpType == null) {
            throw new BulkLoaderSystemException(CLASS, "TG-COMMON-00008",
                    "エクスポート正常終了時のTSVファイル削除有無が不正。値:" + deleteExportTsv);
        }

        // 必須チェック
        // remote ASAKUSA_HOME
        if (isEmpty(prop.getProperty(Constants.PROP_PREFIX_HC_ENV + Constants.ASAKUSA_HOME))) {
            throw new BulkLoaderSystemException(CLASS, "TG-COMMON-00008",
                MessageFormat.format(
                        "Hadoopクライアントの環境変数{1}が設定されていません ({0}.{1})",
                        Constants.PROP_PREFIX_HC_ENV,
                        Constants.ASAKUSA_HOME));
        }
        // SSHのパス
        if (isEmpty(prop.getProperty(Constants.PROP_KEY_SSH_PATH))) {
            throw new BulkLoaderSystemException(CLASS, "TG-COMMON-00008",
                    "SSHのパスが設定されていません");
        }
        // HDFSのNameノードのIPアドレス又はホスト名
        if (isEmpty(prop.getProperty(Constants.PROP_KEY_NAMENODE_HOST))) {
            throw new BulkLoaderSystemException(CLASS, "TG-COMMON-00008",
                    "HDFSのNameノードのホスト名が設定されていません");
        }
        // HDFSのNameノードのユーザー名
        if (isEmpty(prop.getProperty(Constants.PROP_KEY_NAMENODE_USER))) {
            throw new BulkLoaderSystemException(CLASS, "TG-COMMON-00008",
                    "SSHのパスが設定されていません");
        }
        // Importファイルを置くディレクトリのトップディレクトリ
        if (isEmpty(prop.getProperty(Constants.PROP_KEY_IMP_FILE_DIR))) {
            throw new BulkLoaderSystemException(CLASS, "TG-COMMON-00008",
                    "Importファイルを置くディレクトリが設定されていません");
        }
        // エクスポートファイルを置くディレクトリのトップディレクトリ
        if (isEmpty(prop.getProperty(Constants.PROP_KEY_EXP_FILE_DIR))) {
            throw new BulkLoaderSystemException(CLASS, "TG-COMMON-00008",
                    "エクスポートファイルを置くディレクトリが設定されていません");
        }
    }
View Full Code Here

        // DBMSの接続情報を記述したプロパティファイルを読み込み
        String propName = targetName + Constants.JDBC_PROP_NAME;
        try {
            loadProperties(Arrays.asList(new String[] { propName }));
        } catch (IOException e) {
            throw new BulkLoaderSystemException(e, CLASS, "TG-COMMON-00012",
                    propName);
        }

        // 必須チェック
        // JDBCドライバ
        if (isEmpty(prop.getProperty(Constants.PROP_KEY_JDBC_DRIVER))) {
            throw new BulkLoaderSystemException(CLASS, "TG-COMMON-00011",
                    "JDBCドライバが設定されていません");
        }
        // DB接続URL
        if (isEmpty(prop.getProperty(Constants.PROP_KEY_DB_URL))) {
            throw new BulkLoaderSystemException(CLASS, "TG-COMMON-00011",
                    "DB接続URLが設定されていません");
        }
        // DB接続ユーザー
        if (isEmpty(prop.getProperty(Constants.PROP_KEY_DB_USER))) {
            throw new BulkLoaderSystemException(CLASS, "TG-COMMON-00011",
                    "DB接続ユーザーが設定されていません");
        }
        // DB接続ユーザーに対するパスワード
        if (isEmpty(prop.getProperty(Constants.PROP_KEY_DB_PASSWORD))) {
            throw new BulkLoaderSystemException(CLASS, "TG-COMMON-00011",
                    "DB接続ユーザーに対するパスワードが設定されていません");
        }
    }
View Full Code Here

                protected DeleteCacheStorageLocal getClient() {
                    return new DeleteCacheStorageLocal() {
                        @Override
                        public Map<String, Kind> delete(List<LocalCacheInfo> list, String targetName)
                                throws BulkLoaderSystemException {
                            throw new BulkLoaderSystemException(getClass(), "TG-GCCACHE-03008", "testing");
                        }
                    };
                }
            }.execute("dummy", testExecutionId);
View Full Code Here

        try {
            FileList.Writer writer;
            try {
                writer = FileList.createWriter(output, compType == FileCompType.DEFLATED);
            } catch (IOException e) {
                throw new BulkLoaderSystemException(e, getClass(), "TG-COLLECTOR-02001",
                        "Exporterと接続するチャネルを開けませんでした");
            }
            Configuration conf = new Configuration();
            List<String> l = bean.getExportTargetTableList();
            for (String tableName : l) {
View Full Code Here

            } else {
                assert count == 0;
                return -1;
            }
        } catch (IOException e) {
            throw new BulkLoaderSystemException(e, getClass(), "TG-COLLECTOR-02001",
                    MessageFormat.format(
                            "HDFSのディレクトリ:{0} 送信ファイル名:{1}",
                            filePath,
                            fileName));
        } catch (URISyntaxException e) {
            throw new BulkLoaderSystemException(e, getClass(), "TG-COLLECTOR-02001",
                    MessageFormat.format(
                            "HDFSのパスが不正。HDFSのディレクトリ:{0}",
                            filePath));
        } finally {
            if (fs != null) {
                try {
                    fs.close();
                } catch (IOException e) {
                    throw new BulkLoaderSystemException(
                            e,
                            this.getClass(),
                            "TG-COLLECTOR-02001",
                            MessageFormat.format(
                                    "HDFSのファイルシステムのクローズに失敗。URI:{0}",
View Full Code Here

             * @see com.asakusafw.bulkloader.recoverer.Recoverer#selectRunningJobFlow(java.lang.String)
             */
            @Override
            protected List<ExporterBean> selectRunningJobFlow(
                    String executionId) throws BulkLoaderSystemException {
                throw new BulkLoaderSystemException(this.getClass(), "TG-RECOVERER-01001");
            }

        };
        int result = recoverer.execute(args);

View Full Code Here

             * @see com.asakusafw.bulkloader.recoverer.Recoverer#getExportTempTable(java.lang.String)
             */
            @Override
            protected List<ExportTempTableBean> getExportTempTable(String jobflowSid)
                    throws BulkLoaderSystemException {
                throw new BulkLoaderSystemException(this.getClass(), "TG-RECOVERER-01001");
            }
        };
        try {
            recoverer.judgeRollBack(bean);
            fail();
View Full Code Here

TOP

Related Classes of com.asakusafw.bulkloader.exception.BulkLoaderSystemException

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.