Package com.asakusafw.vocabulary.external

Examples of com.asakusafw.vocabulary.external.FileExporterDescription


            exporterEnabled = DEFAULT_EXPORTER_ENABLED;
            valid = false;
        }
        boolean mr370applied = checkClassExists("org.apache.hadoop.mapreduce.lib.output.MultipleOutputs");
        for (OutputDescription output : outputs) {
            FileExporterDescription desc = extract(output);
            if (exporterEnabled == GenericOptionValue.DISABLED) {
                valid = false;
                getEnvironment().error(
                        "出力{0}を利用するにはコンパイルオプション\"{1}={2}\"の指定が必要です",
                        desc.getClass().getName(),
                        getEnvironment().getOptions().getExtraAttributeKeyName(OPTION_EXPORTER_ENABLED),
                        GenericOptionValue.ENABLED.getSymbol());
            } else if (mr370applied == false && exporterEnabled == GenericOptionValue.AUTO) {
                valid = false;
                getEnvironment().error(
                        "現在のディストリビューションは{1}に対応していません。"
                        + "別のディストリビューションを利用するか、{2}に置き換えてください (出力{0})。",
                        desc.getClass().getName(),
                        FileExporterDescription.class.getSimpleName(),
                        "DirectFileOutputDescription (directio)");
            }
            String pathPrefix = desc.getPathPrefix();
            if (pathPrefix == null) {
                valid = false;
                getEnvironment().error(
                        "{0}のパスが指定されていません",
                        desc.getClass().getName());
            } else {
                Location location = Location.fromPath(pathPrefix, '/');
                if (location.isPrefix() == false) {
                    valid = false;
                    getEnvironment().error(
                            "{0}はパスの接尾辞(-*)でなければなりません: {1}",
                            desc.getClass().getName(),
                            pathPrefix);
                }
                if (location.getParent() == null) {
                    valid = false;
                    getEnvironment().error(
                            "{0}には最低ひとつのディレクトリの指定が必要です: {1}",
                            desc.getClass().getName(),
                            pathPrefix);
                }
                if (VALID_OUTPUT_NAME.matcher(location.getName()).matches() == false) {
                    valid = false;
                    getEnvironment().error(
                            "{0}のファイル名(末尾のセグメント)は英数字のみ利用できます: {1}",
                            desc.getClass().getName(),
                            pathPrefix);
                }
            }
        }
        return valid;
View Full Code Here


                // 親パスまでが同じなので名前のみ比較
                return o1.getName().compareTo(o2.getName());
            }
        });
        for (Output output : context.getOutputs()) {
            FileExporterDescription desc = extract(output.getDescription());
            Location path = Location.fromPath(desc.getPathPrefix(), '/');
            Location parent = path.getParent();
            Maps.addToList(results, parent, toSlot(output, path.getName()));
        }
        return results;
    }
View Full Code Here

        source.write(value);
    }

    private List<Ex1> getList(Class<? extends FileExporterDescription> exporter) {
        try {
            FileExporterDescription instance = exporter.newInstance();
            Path path = new Path(Location.fromPath(instance.getPathPrefix(), '/').toString());
            FileSystem fs = path.getFileSystem(tester.configuration());
            FileStatus[] statuses = fs.globStatus(path);
            List<Ex1> results = new ArrayList<Ex1>();
            for (FileStatus status : statuses) {
                SequenceFile.Reader reader = new SequenceFile.Reader(fs, status.getPath(), tester.configuration());
View Full Code Here

TOP

Related Classes of com.asakusafw.vocabulary.external.FileExporterDescription

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.