Package com.asakusafw.windgate.core

Examples of com.asakusafw.windgate.core.ProfileContext


        Map<String, String> conf = new HashMap<String, String>();
        ResourceProfile resourceProfile = new ResourceProfile(
                "testing",
                HadoopFsProvider.class,
                new ProfileContext(getClass().getClassLoader(), new ParameterList()),
                conf);

        HadoopFsProfile profile = HadoopFsProfile.convert(hadoopConf, resourceProfile);
        assertThat(profile.getResourceName(), is("testing"));
        assertThat(profile.getBasePath().toUri().getScheme(), is("file"));
View Full Code Here


        Map<String, String> conf = new HashMap<String, String>();
        conf.put(HadoopFsProfile.KEY_BASE_PATH, current.toURI().toString());
        ResourceProfile resourceProfile = new ResourceProfile(
                "testing",
                HadoopFsProvider.class,
                new ProfileContext(getClass().getClassLoader(), new ParameterList()),
                conf);

        HadoopFsProfile profile = HadoopFsProfile.convert(hadoopConf, resourceProfile);
        assertThat(profile.getResourceName(), is("testing"));
        assertThat(profile.getBasePath(), is(new Path(current.toURI())));
View Full Code Here

        Map<String, String> conf = new HashMap<String, String>();
        conf.put(HadoopFsProfile.KEY_BASE_PATH, "target");
        ResourceProfile resourceProfile = new ResourceProfile(
                "testing",
                HadoopFsProvider.class,
                new ProfileContext(getClass().getClassLoader(), new ParameterList()),
                conf);

        HadoopFsProfile profile = HadoopFsProfile.convert(hadoopConf, resourceProfile);
        assertThat(profile.getResourceName(), is("testing"));
        assertThat(profile.getBasePath().getName(), is("target"));
View Full Code Here

        Map<String, String> env = new HashMap<String, String>();
        env.put("var", "replacement");
        ResourceProfile resourceProfile = new ResourceProfile(
                "testing",
                HadoopFsProvider.class,
                new ProfileContext(getClass().getClassLoader(), new ParameterList(env)),
                conf);

        HadoopFsProfile profile = HadoopFsProfile.convert(hadoopConf, resourceProfile);
        assertThat(profile.getResourceName(), is("testing"));
        assertThat(profile.getBasePath().getName(), is("replacement"));
View Full Code Here

        Map<String, String> conf = new HashMap<String, String>();
        conf.put(HadoopFsProfile.KEY_BASE_PATH, "${__UNDEFINED__}");
        ResourceProfile resourceProfile = new ResourceProfile(
                "testing",
                HadoopFsProvider.class,
                new ProfileContext(getClass().getClassLoader(), new ParameterList()),
                conf);

        HadoopFsProfile.convert(hadoopConf, resourceProfile);
    }
View Full Code Here

        Map<String, String> conf = new HashMap<String, String>();
        conf.put(HadoopFsProfile.KEY_BASE_PATH, "INVALIDFS:UNKNOWN");
        ResourceProfile resourceProfile = new ResourceProfile(
                "testing",
                HadoopFsProvider.class,
                new ProfileContext(getClass().getClassLoader(), new ParameterList()),
                conf);

        HadoopFsProfile.convert(hadoopConf, resourceProfile);
    }
View Full Code Here

        Map<String, String> conf = new HashMap<String, String>();
        conf.put(HadoopFsProfile.KEY_COMPRESSION, DefaultCodec.class.getName());
        ResourceProfile resourceProfile = new ResourceProfile(
                "testing",
                HadoopFsProvider.class,
                new ProfileContext(getClass().getClassLoader(), new ParameterList()),
                conf);

        HadoopFsProfile profile = HadoopFsProfile.convert(hadoopConf, resourceProfile);
        assertThat(profile.getResourceName(), is("testing"));
        // may occur warn log
View Full Code Here

        Configuration result = new Configuration();

        LOG.debug("Loading profile: {}", profile);
        try {
            ProfileContext context = ProfileContext.system(loader);
            URI uri = CommandLineUtil.toUri(profile);
            Properties properties = CommandLineUtil.loadProperties(uri, loader);
            result.profile = GateProfile.loadFrom(CommandLineUtil.toName(uri), properties, context);
        } catch (Exception e) {
            throw new IllegalArgumentException(MessageFormat.format(
View Full Code Here

                    Arrays.toString(ExecutionKind.values())));
        }

        LOG.debug("Loading profile: {}", profile);
        try {
            ProfileContext context = ProfileContext.system(loader);
            URI uri = CommandLineUtil.toUri(profile);
            Properties properties = CommandLineUtil.loadProperties(uri, loader);
            result.profile = GateProfile.loadFrom(CommandLineUtil.toName(uri), properties, context);
        } catch (Exception e) {
            throw new IllegalArgumentException(MessageFormat.format(
View Full Code Here

                    context.getFrameworkHomePath(),
                    MessageFormat.format(PATTERN_PROFILE, profile)).getAbsoluteFile();
            Map<String, String> variables = new HashMap<String, String>(context.getEnvironmentVariables());
            variables.put("WINDGATE_PROFILE", profile);
            ParameterList contextParameters = new ParameterList(variables);
            ProfileContext profileContext = new ProfileContext(classLoader, contextParameters);

            URI uri = profilePath.toURI();
            Properties properties = CommandLineUtil.loadProperties(uri, classLoader);
            return GateProfile.loadFrom(CommandLineUtil.toName(uri), properties, profileContext);
        } catch (Exception e) {
View Full Code Here

TOP

Related Classes of com.asakusafw.windgate.core.ProfileContext

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.