Package com.asakusafw.compiler.flow

Examples of com.asakusafw.compiler.flow.Location


                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);
View Full Code Here


        ProcessScript<?> importer = getProcess(importerScript, "in1");
        assertThat(importer.getSourceScript().getResourceName(), is("dummy"));
        assertThat(importer.getDrainScript().getResourceName(), is(Constants.HADOOP_FILE_RESOURCE_NAME));
        String importerPath = importer.getDrainScript().getConfiguration().get(FileProcess.FILE.key());
        assertThat(importerPath, is(notNullValue()));
        Location importerLocation = Location.fromPath(importerPath, '/');

        // extract exporter source
        GateScript exporterScript = loadScript(info, "testing", false);
        assertThat(exporterScript.getProcesses().size(), is(1));
        ProcessScript<?> exporter = getProcess(exporterScript, "out1");
        assertThat(exporter.getSourceScript().getResourceName(), is(Constants.HADOOP_FILE_RESOURCE_NAME));
        assertThat(exporter.getDrainScript().getResourceName(), is("dummy"));
        String exporterPath = exporter.getSourceScript().getConfiguration().get(FileProcess.FILE.key());
        assertThat(exporterPath, is(notNullValue()));
        Location exporterLocation = Location.fromPath(exporterPath, '/');
        assertThat(exporterLocation.isPrefix(), is(true));

        ModelOutput<Simple> source = tester.openOutput(Simple.class, importerLocation);
        Simple model = new Simple();
        model.setValueAsString("Hello1, world!");
        source.write(model);
View Full Code Here

     */
    public <T extends Writable> TestInput<T> input(
            Class<T> type,
            String name,
            DataSize dataSize) throws IOException {
        Location path = hadoopDriver.toPath(path("input", JavaName.of(name).toMemberName()));
        return new TestInput<T>(type, name, path, dataSize);
    }
View Full Code Here

     * @throws IllegalArgumentException 引数に{@code null}が指定された場合
     */
    public <T extends Writable> TestOutput<T> output(
            Class<T> type,
            String name) throws IOException {
        Location path = hadoopDriver.toPath(testName, "output", name).asPrefix();
        return new TestOutput<T>(type, name, path);
    }
View Full Code Here

    public <T extends Writable> ModelOutput<T> openOutput(
            Class<T> type,
            Import importer) throws IOException {
        Iterator<Location> iter = importer.getInputInfo().getLocations().iterator();
        assert iter.hasNext();
        Location location = iter.next();
        return hadoopDriver.openOutput(type, location);
    }
View Full Code Here

     */
    public Location toPath(String...segments) {
        if (segments == null) {
            throw new IllegalArgumentException("segments must not be null"); //$NON-NLS-1$
        }
        Location path = Location.fromPath(RUNTIME_WORK_ROOT, '/');
        for (String segment : segments) {
            path = path.append(segment);
        }
        return path;
    }
View Full Code Here

    @Override
    public SourceInfo getInputInfo(InputDescription description) {
        DirectFileInputDescription desc = extract(description);
        if (isCacheTarget(desc)) {
            String outputName = getProcessedInputName(description);
            Location location = getEnvironment().getPrologueLocation(MODULE_NAME).append(outputName).asPrefix();
            return new SourceInfo(Collections.singleton(location), TemporaryInputFormat.class);
        } else {
            return getOriginalInputInfo(description);
        }
    }
View Full Code Here

     * @param driverContext ドライバコンテキスト。
     * @param name 入力データ名。
     * @return 入力データのリソース位置
     */
    public static Location createInputLocation(TestDriverContext driverContext, String name) {
        Location location = Location.fromPath(driverContext.getClusterWorkDir(), '/')
                .append(StageConstants.EXPR_EXECUTION_ID)
                .append("input")
                .append(normalize(name));
        return location;
    }
View Full Code Here

     * @param driverContext ドライバコンテキスト。
     * @param name 出力データ名。
     * @return 出力データのリソース位置
     */
    public static Location createOutputLocation(TestDriverContext driverContext, String name) {
        Location location = Location.fromPath(driverContext.getClusterWorkDir(), '/')
                .append(StageConstants.EXPR_EXECUTION_ID).append("output").append(normalize(name)).asPrefix();
        return location;
    }
View Full Code Here

     *
     * @param driverContext ドライバコンテキスト。
     * @return ワーキングのリソース位置
     */
    public static Location createWorkingLocation(TestDriverContext driverContext) {
        Location location = Location.fromPath(driverContext.getClusterWorkDir(), '/')
                .append(StageConstants.EXPR_EXECUTION_ID)
                .append("temp");
        return location;
    }
View Full Code Here

TOP

Related Classes of com.asakusafw.compiler.flow.Location

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.