Package org.apache.oozie.service

Examples of org.apache.oozie.service.URIHandlerService


            }
        }
    }

    private void registerForNotification(List<String> missingDeps, Configuration actionConf) {
        URIHandlerService uriService = Services.get().get(URIHandlerService.class);
        String user = actionConf.get(OozieClient.USER_NAME, OozieClient.USER_NAME);
        for (String missingDep : missingDeps) {
            try {
                URI missingURI = new URI(missingDep);
                URIHandler handler = uriService.getURIHandler(missingURI);
                handler.registerForNotification(missingURI, actionConf, user, actionId);
                    LOG.debug("Registered uri [{0}] for notifications", missingURI);
            }
            catch (Exception e) {
                LOG.warn("Exception while registering uri [{0}] for notifications", missingDep, e);
View Full Code Here


            }
        }
    }

    private void unregisterAvailableDependencies(List<String> availableDeps) {
        URIHandlerService uriService = Services.get().get(URIHandlerService.class);
        for (String availableDep : availableDeps) {
            try {
                URI availableURI = new URI(availableDep);
                URIHandler handler = uriService.getURIHandler(availableURI);
                if (handler.unregisterFromNotification(availableURI, actionId)) {
                    LOG.debug("Successfully unregistered uri [{0}] from notifications", availableURI);
                }
                else {
                    LOG.warn("Unable to unregister uri [{0}] from notifications", availableURI);
View Full Code Here

        }
    }

    public static void unregisterMissingDependencies(List<String> missingDeps, String actionId) {
        final XLog LOG = XLog.getLog(CoordPushDependencyCheckXCommand.class);
        URIHandlerService uriService = Services.get().get(URIHandlerService.class);
        for (String missingDep : missingDeps) {
            try {
                URI missingURI = new URI(missingDep);
                URIHandler handler = uriService.getURIHandler(missingURI);
                if (handler.unregisterFromNotification(missingURI, actionId)) {
                    LOG.debug("Successfully unregistered uri [{0}] from notifications", missingURI);
                }
                else {
                    LOG.warn("Unable to unregister uri [{0}] from notifications", missingURI);
View Full Code Here

    @Override
    protected void setUp() throws Exception {
        super.setUp();
        services = new Services();
        services.init();
        URIHandlerService uriService = services.get(URIHandlerService.class);
        uriHandlerFactory = new LauncherURIHandlerFactory(uriService.getLauncherConfig());
        conf = createJobConf();
    }
View Full Code Here

     * @return <code>true</code> if the uri exists, <code>false</code> if it does not.
     * @throws Exception
     */
    public static boolean hcat_exists(String uri) throws Exception {
        URI hcatURI = new URI(uri);
        URIHandlerService uriService = Services.get().get(URIHandlerService.class);
        URIHandler handler = uriService.getURIHandler(hcatURI);
        WorkflowJob workflow = DagELFunctions.getWorkflow();
        String user = workflow.getUser();
        return handler.exists(hcatURI, EMPTY_CONF, user);
    }
View Full Code Here

            }
        }
    }

    private void registerForNotification(List<String> missingDeps, Configuration actionConf) {
        URIHandlerService uriService = Services.get().get(URIHandlerService.class);
        String user = actionConf.get(OozieClient.USER_NAME, OozieClient.USER_NAME);
        for (String missingDep : missingDeps) {
            try {
                URI missingURI = new URI(missingDep);
                URIHandler handler = uriService.getURIHandler(missingURI);
                handler.registerForNotification(missingURI, actionConf, user, actionId);
                    LOG.debug("Registered uri [{0}] for notifications", missingURI);
            }
            catch (Exception e) {
                LOG.warn("Exception while registering uri [{0}] for notifications", missingDep, e);
View Full Code Here

            }
        }
    }

    private void unregisterAvailableDependencies(List<String> availableDeps) {
        URIHandlerService uriService = Services.get().get(URIHandlerService.class);
        for (String availableDep : availableDeps) {
            try {
                URI availableURI = new URI(availableDep);
                URIHandler handler = uriService.getURIHandler(availableURI);
                if (handler.unregisterFromNotification(availableURI, actionId)) {
                    LOG.debug("Successfully unregistered uri [{0}] from notifications", availableURI);
                }
                else {
                    LOG.warn("Unable to unregister uri [{0}] from notifications", availableURI);
View Full Code Here

        }
    }

    public static void unregisterMissingDependencies(List<String> missingDeps, String actionId) {
        final XLog LOG = XLog.getLog(CoordPushDependencyCheckXCommand.class);
        URIHandlerService uriService = Services.get().get(URIHandlerService.class);
        for (String missingDep : missingDeps) {
            try {
                URI missingURI = new URI(missingDep);
                URIHandler handler = uriService.getURIHandler(missingURI);
                if (handler.unregisterFromNotification(missingURI, actionId)) {
                    LOG.debug("Successfully unregistered uri [{0}] from notifications", missingURI);
                }
                else {
                    LOG.warn("Unable to unregister uri [{0}] from notifications", missingURI);
View Full Code Here

        super.tearDown();
    }

    @Test
    public void testGetAuthorityWithScheme() throws Exception {
        URIHandlerService uriService = new URIHandlerService();
        URI uri = uriService.getAuthorityWithScheme("hdfs://nn1:8020/dataset/${YEAR}/${MONTH}");
        assertEquals("hdfs://nn1:8020", uri.toString());
        uri = uriService.getAuthorityWithScheme("hdfs://nn1:8020");
        assertEquals("hdfs://nn1:8020", uri.toString());
        uri = uriService.getAuthorityWithScheme("hdfs://nn1:8020/");
        assertEquals("hdfs://nn1:8020", uri.toString());
        uri = uriService.getAuthorityWithScheme("hdfs://///tmp/file");
        assertEquals("hdfs:///", uri.toString());
        uri = uriService.getAuthorityWithScheme("hdfs:///tmp/file");
        assertEquals("hdfs:///", uri.toString());
        uri = uriService.getAuthorityWithScheme("/tmp/file");
        assertEquals("/", uri.toString());
    }
View Full Code Here

        assertEquals("/", uri.toString());
    }

    @Test
    public void testGetURIHandler() throws Exception {
        URIHandlerService uriService = services.get(URIHandlerService.class);
        URI uri = uriService.getAuthorityWithScheme("/tmp/file");
        URIHandler uriHandler = uriService.getURIHandler(uri);
        assertTrue(uriHandler instanceof FSURIHandler);
    }
View Full Code Here

TOP

Related Classes of org.apache.oozie.service.URIHandlerService

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.