Package org.apache.hadoop.fs

Examples of org.apache.hadoop.fs.FsUrlStreamHandlerFactory


    if (registerJvmUrl) {
      try {
        // force UGI init to prevent infinite loop - see SHDP-92
        UserGroupInformation.setConfiguration(internalConfig);
        URL.setURLStreamHandlerFactory(new FsUrlStreamHandlerFactory(getObject()));
        log.info("Registered HDFS URL stream handler");
      } catch (Error err) {
        log.warn("Cannot register Hadoop URL stream handler - one is already registered");
      }
    }
View Full Code Here


     */
    public static synchronized void register() {
        if (registered) {
            return;
        }
        FsUrlStreamHandlerFactory factory = new FsUrlStreamHandlerFactory();
        try {
            URL.setURLStreamHandlerFactory(factory);
        } catch (Error e) {
            if (e.getClass().equals(Error.class)) {
                // ok.
View Full Code Here

        return hdfsEndpoint;
    }

    protected void initHdfs() {
        try {
            URL.setURLStreamHandlerFactory(new FsUrlStreamHandlerFactory());
        } catch (Throwable e) {
            // ignore as its most likely already set
            LOG.debug("Cannot set URLStreamHandlerFactory due " + e.getMessage() + ". This exception will be ignored.", e);
        }
    }
View Full Code Here

    if (registerJvmUrl) {
      try {
        // force UGI init to prevent infinite loop - see SHDP-92
        UserGroupInformation.setConfiguration(internalConfig);
        ugiCalled = true;
        URL.setURLStreamHandlerFactory(new FsUrlStreamHandlerFactory(getObject()));
        log.info("Registered HDFS URL stream handler");
      } catch (Error err) {
        log.warn("Cannot register Hadoop URL stream handler - one is already registered");
      }
    }
View Full Code Here

  @SuppressWarnings("deprecation")
  @Test
  public void testResolve() throws Exception {
    Resource resource = loader.getResource("/test");
    try {
      URL.setURLStreamHandlerFactory(new FsUrlStreamHandlerFactory(fs.getConf()));
    } catch (Error err) {
      //somebody already registered an URL handler...
      // get out
    }
View Full Code Here

        return hdfsEndpoint;
    }

    protected void initHdfs() {
        try {
            URL.setURLStreamHandlerFactory(new FsUrlStreamHandlerFactory());
        } catch (Throwable e) {
            // ignore as its most likely already set
            LOG.debug("Cannot set URLStreamHandlerFactory due " + e.getMessage() + ". This exception will be ignored.", e);
        }
    }
View Full Code Here

        return hdfsEndpoint;
    }

    protected void initHdfs() {
        try {
            URL.setURLStreamHandlerFactory(new FsUrlStreamHandlerFactory());
        } catch (Throwable e) {
            // ignore as its most likely already set
            LOG.debug("Cannot set URLStreamHandlerFactory due " + e.getMessage() + ". This exception will be ignored.", e);
        }
    }
View Full Code Here

        return hdfsEndpoint;
    }

    protected void initHdfs() {
        try {
            URL.setURLStreamHandlerFactory(new FsUrlStreamHandlerFactory());
        } catch (Throwable e) {
            // ignore as its most likely already set
            LOG.debug("Cannot set URLStreamHandlerFactory due " + e.getMessage() + ". This exception will be ignored.", e);
        }
    }
View Full Code Here

    // Setup our own factory
    // setURLSteramHandlerFactor is can be set at most once in the JVM
    // the new URLStreamHandler is valid for all tests cases
    // in TestStreamHandler
    FsUrlStreamHandlerFactory factory =
        new org.apache.hadoop.fs.FsUrlStreamHandlerFactory();
    java.net.URL.setURLStreamHandlerFactory(factory);

    Path filePath = new Path("/thefile");
View Full Code Here

        return hdfsEndpoint;
    }

    protected void initHdfs() {
        try {
            URL.setURLStreamHandlerFactory(new FsUrlStreamHandlerFactory());
        } catch (Throwable e) {
            // ignore as its most likely already set
            LOG.debug("Cannot set URLStreamHandlerFactory due " + e.getMessage() + ". This exception will be ignored.", e);
        }
    }
View Full Code Here

TOP

Related Classes of org.apache.hadoop.fs.FsUrlStreamHandlerFactory

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.