@Test public void testDoCreateFileSystemNoPort() throws FileSystemException, ClusterInitializationException { String testHostname = "testHostname"; FileName fileName = mock( FileName.class ); GenericFileName genericFileName = mock( GenericFileName.class ); when( fileName.getURI() ).thenReturn( "" ); when( fileName.getRoot() ).thenReturn( genericFileName ); when( fileName.getScheme() ).thenReturn( HDFSFileProvider.MAPRFS ); when( genericFileName.getHostName() ).thenReturn( testHostname ); when( genericFileName.getPort() ).thenReturn( -1 ); assertTrue( hdfsFileProvider.doCreateFileSystem( fileName, null ) instanceof HDFSFileSystem ); verify( hadoopFileSystemLocator ).getHadoopFilesystem( namedCluster, URI.create( "" ) ); verify( namedClusterService ).updateNamedClusterTemplate( testHostname, -1, true ); }
@Override protected FileSystem doCreateFileSystem( final FileName name, final FileSystemOptions fileSystemOptions ) throws FileSystemException { GenericFileName genericFileName = (GenericFileName) name.getRoot(); String hostName = genericFileName.getHostName(); int port = genericFileName.getPort(); NamedCluster namedCluster = resolveNamedCluster( hostName, port, name ); try { return new HDFSFileSystem( name, fileSystemOptions, hadoopFileSystemLocator.getHadoopFilesystem( namedCluster, URI.create( name.getURI() == null ? "" : name.getURI() ) ) ); } catch ( ClusterInitializationException e ) { throw new FileSystemException( e ); } }
HDFSFileProvider extends AbstractOriginatingFileProvider { @Override protected FileSystem doCreateFileSystem( final FileName name, final FileSystemOptions fileSystemOptions ) throws FileSystemException { GenericFileName genericFileName = (GenericFileName) name.getRoot(); String hostName = genericFileName.getHostName(); int port = genericFileName.getPort(); NamedCluster namedCluster = resolveNamedCluster( hostName, port, name ); try { return new HDFSFileSystem( name, fileSystemOptions, hadoopFileSystemLocator.getHadoopFilesystem( namedCluster, URI.create( name.getURI() == null ? "" : name.getURI() ) ) ); } catch ( ClusterInitializationException e ) { throw new FileSystemException( e ); } } }
HDFSFileProvider extends AbstractOriginatingFileProvider { @Override protected FileSystem doCreateFileSystem( final FileName name, final FileSystemOptions fileSystemOptions ) throws FileSystemException { GenericFileName genericFileName = (GenericFileName) name.getRoot(); String hostName = genericFileName.getHostName(); int port = genericFileName.getPort(); NamedCluster namedCluster = resolveNamedCluster( hostName, port, name ); try { return new HDFSFileSystem( name, fileSystemOptions, hadoopFileSystemLocator.getHadoopFilesystem( namedCluster, URI.create( name.getURI() == null ? "" : name.getURI() ) ) ); } catch ( ClusterInitializationException e ) { throw new FileSystemException( e ); } } @Deprecated  HDFSFileProvider( HadoopFileSystemLocator hadoopFileSystemLocator,
                           NamedClusterService namedClusterService, MetastoreLocatorOsgi metaStore ); @Deprecated  HDFSFileProvider( HadoopFileSystemLocator hadoopFileSystemLocator, NamedClusterService namedClusterService,
                           DefaultFileSystemManager fileSystemManager, MetastoreLocatorOsgi metaStore );  HDFSFileProvider( HadoopFileSystemLocator hadoopFileSystemLocator, NamedClusterService namedClusterService,
                           FileNameParser fileNameParser, String schema, MetastoreLocatorOsgi metaStore );  HDFSFileProvider( HadoopFileSystemLocator hadoopFileSystemLocator, NamedClusterService namedClusterService,
                           DefaultFileSystemManager fileSystemManager, FileNameParser fileNameParser, String[] schemes,
                           MetastoreLocatorOsgi metaStore ); }
HDFSFileProvider extends AbstractOriginatingFileProvider { @Override protected FileSystem doCreateFileSystem( final FileName name, final FileSystemOptions fileSystemOptions ) throws FileSystemException { GenericFileName genericFileName = (GenericFileName) name.getRoot(); String hostName = genericFileName.getHostName(); int port = genericFileName.getPort(); NamedCluster namedCluster = resolveNamedCluster( hostName, port, name ); try { return new HDFSFileSystem( name, fileSystemOptions, hadoopFileSystemLocator.getHadoopFilesystem( namedCluster, URI.create( name.getURI() == null ? "" : name.getURI() ) ) ); } catch ( ClusterInitializationException e ) { throw new FileSystemException( e ); } } @Deprecated  HDFSFileProvider( HadoopFileSystemLocator hadoopFileSystemLocator,
                           NamedClusterService namedClusterService, MetastoreLocatorOsgi metaStore ); @Deprecated  HDFSFileProvider( HadoopFileSystemLocator hadoopFileSystemLocator, NamedClusterService namedClusterService,
                           DefaultFileSystemManager fileSystemManager, MetastoreLocatorOsgi metaStore );  HDFSFileProvider( HadoopFileSystemLocator hadoopFileSystemLocator, NamedClusterService namedClusterService,
                           FileNameParser fileNameParser, String schema, MetastoreLocatorOsgi metaStore );  HDFSFileProvider( HadoopFileSystemLocator hadoopFileSystemLocator, NamedClusterService namedClusterService,
                           DefaultFileSystemManager fileSystemManager, FileNameParser fileNameParser, String[] schemes,
                           MetastoreLocatorOsgi metaStore ); @Override Collection<Capability> getCapabilities(); @Override FileSystemConfigBuilder getConfigBuilder(); }
HDFSFileProvider extends AbstractOriginatingFileProvider { @Override protected FileSystem doCreateFileSystem( final FileName name, final FileSystemOptions fileSystemOptions ) throws FileSystemException { GenericFileName genericFileName = (GenericFileName) name.getRoot(); String hostName = genericFileName.getHostName(); int port = genericFileName.getPort(); NamedCluster namedCluster = resolveNamedCluster( hostName, port, name ); try { return new HDFSFileSystem( name, fileSystemOptions, hadoopFileSystemLocator.getHadoopFilesystem( namedCluster, URI.create( name.getURI() == null ? "" : name.getURI() ) ) ); } catch ( ClusterInitializationException e ) { throw new FileSystemException( e ); } } @Deprecated  HDFSFileProvider( HadoopFileSystemLocator hadoopFileSystemLocator,
                           NamedClusterService namedClusterService, MetastoreLocatorOsgi metaStore ); @Deprecated  HDFSFileProvider( HadoopFileSystemLocator hadoopFileSystemLocator, NamedClusterService namedClusterService,
                           DefaultFileSystemManager fileSystemManager, MetastoreLocatorOsgi metaStore );  HDFSFileProvider( HadoopFileSystemLocator hadoopFileSystemLocator, NamedClusterService namedClusterService,
                           FileNameParser fileNameParser, String schema, MetastoreLocatorOsgi metaStore );  HDFSFileProvider( HadoopFileSystemLocator hadoopFileSystemLocator, NamedClusterService namedClusterService,
                           DefaultFileSystemManager fileSystemManager, FileNameParser fileNameParser, String[] schemes,
                           MetastoreLocatorOsgi metaStore ); @Override Collection<Capability> getCapabilities(); @Override FileSystemConfigBuilder getConfigBuilder(); static final String SCHEME; static final String MAPRFS; static final String ATTR_USER_INFO; static final UserAuthenticationData.Type[] AUTHENTICATOR_TYPES; static final Collection<Capability> capabilities; }