Package com.asakusafw.compiler.flow

Examples of com.asakusafw.compiler.flow.Location


        String compilerWork = cmd.getOptionValue(OPT_COMPILERWORK.getOpt());
        String link = cmd.getOptionValue(OPT_LINK.getOpt());
        String plugin = cmd.getOptionValue(OPT_PLUGIN.getOpt());

        File outputDirectory = new File(output);
        Location hadoopWorkLocation = Location.fromPath(hadoopWork, '/');
        File compilerWorkDirectory = new File(compilerWork);
        List<File> linkingResources = Lists.create();
        if (link != null) {
            for (String s : link.split(File.pathSeparator)) {
                linkingResources.add(new File(s));
View Full Code Here


                shuffle.getPartitionerTypeName());
    }

    private List<Delivery> analyzeDeliveries(StageModel model) {
        assert model != null;
        Location base = environment.getStageLocation(model.getStageBlock().getStageNumber());
        List<Delivery> deliveries = Lists.create();
        for (StageModel.Sink sink : model.getStageResults()) {
            Location location = base.append(sink.getName()).asPrefix();
            deliveries.add(new Delivery(sink.getOutputs(), Collections.singleton(location)));
        }
        return deliveries;
    }
View Full Code Here

        assert jar != null;
        assert saw != null;
        Cursor cursor = repo.createCursor();
        try {
            while (cursor.next()) {
                Location location = cursor.getLocation();
                if (allowFrameworkInfo == false
                        && (FRAMEWORK_INFO.isPrefixOf(location) || MANIFEST_FILE.isPrefixOf(location))) {
                    LOG.debug("Skipped adding a framework info: {}", location);
                    continue;
                }
View Full Code Here

    private Map<String, List<String>> drain(Cursor cur) throws IOException {
        try {
            Map<String, List<String>> entries = new TreeMap<String, List<String>>();
            while (cur.next()) {
                Location location = cur.getLocation();
                InputStream input = cur.openResource();
                try {
                    List<String> contents = Lists.create();
                    Scanner scanner = new Scanner(input, "UTF-8");
                    while (scanner.hasNextLine()) {
                        String line = scanner.nextLine();
                        contents.add(line);
                    }
                    entries.put(location.toPath('/'), contents);
                    scanner.close();
                } finally {
                    input.close();
                }
            }
View Full Code Here

        String link = cmd.getOptionValue(OPT_LINK.getOpt());
        String plugin = cmd.getOptionValue(OPT_PLUGIN.getOpt());
        boolean skipError = cmd.hasOption(OPT_SKIPERROR.getOpt());

        File outputDirectory = new File(output);
        Location hadoopWorkLocation = Location.fromPath(hadoopWork, '/');
        File compilerWorkDirectory = new File(compilerWork);
        List<File> linkingResources = Lists.create();
        if (link != null) {
            for (String s : link.split(File.pathSeparator)) {
                linkingResources.add(new File(s));
            }
        }
        List<URL> pluginLocations = Lists.create();
        if (plugin != null) {
            for (String s : plugin.split(File.pathSeparator)) {
                if (s.trim().isEmpty()) {
                    continue;
                }
                try {
                    File file = new File(s);
                    if (file.exists() == false) {
                        throw new FileNotFoundException(file.getAbsolutePath());
                    }
                    URL url = file.toURI().toURL();
                    pluginLocations.add(url);
                } catch (IOException e) {
                    LOG.warn(MessageFormat.format(
                            "プラグイン{0}をロードできませんでした",
                            s),
                            e);
                }
            }
        }

        Set<String> errorBatches = Sets.create();
        boolean succeeded = true;
        try {
            ResourceRepository scanner = getScanner(new File(scanPath));
            Cursor cursor = scanner.createCursor();
            try {
                while (cursor.next()) {
                    Location location = cursor.getLocation();
                    Class<? extends BatchDescription> batchDescription = getBatchDescription(location);
                    if (batchDescription == null) {
                        continue;
                    }
                    boolean singleSucceeded = BatchCompilerDriver.compile(
View Full Code Here

    private Map<String, List<String>> drain(Cursor cur) throws IOException {
        try {
            Map<String, List<String>> entries = new TreeMap<String, List<String>>();
            while (cur.next()) {
                Location location = cur.getLocation();
                InputStream input = cur.openResource();
                try {
                    List<String> contents = Lists.create();
                    Scanner scanner = new Scanner(input, "UTF-8");
                    while (scanner.hasNextLine()) {
                        String line = scanner.nextLine();
                        contents.add(line);
                    }
                    entries.put(location.toPath('/'), contents);
                    scanner.close();
                } finally {
                    input.close();
                }
            }
View Full Code Here

                return o1.getName().compareTo(o2.getName());
            }
        });
        for (Output output : context.getOutputs()) {
            TemporaryOutputDescription 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

        assert file != null;
        if (file.isFile()) {
            results.add(new Resource(file, location));
        } else if (file.isDirectory()) {
            for (File child : file.listFiles()) {
                Location enter = new Location(location, child.getName());
                collect(results, enter, child);
            }
        } else {
            LOG.warn("不明なファイル {}", file);
        }
View Full Code Here

                    Models.toLiteral(factory, Naming.getCleanupStageName())));
            return results;
        }

        private MethodDeclaration createStageOutputPath() {
            Location location = environment.getTargetLocation();
            location = getCleanupTarget(location);
            String path = location.toPath(PATH_SEPARATOR);
            return createValueMethod(
                    AbstractCleanupStageClient.METHOD_CLEANUP_PATH,
                    t(String.class),
                    Models.toLiteral(factory, path));
        }
View Full Code Here

                    t(String.class),
                    Models.toLiteral(factory, path));
        }

        private Location getCleanupTarget(Location location) {
            Location candidate = location;
            Location current = location;
            while (current != null) {
                String name = current.getName();
                if (name.indexOf(StageConstants.EXPR_EXECUTION_ID) >= 0) {
                    candidate = current;
                }
                current = current.getParent();
            }
            return candidate;
        }
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.