Package org.apache.flink.core.fs
Class ConnectionLimitingFactory
- java.lang.Object
-
- org.apache.flink.core.fs.ConnectionLimitingFactory
-
- All Implemented Interfaces:
FileSystemFactory,Plugin
@Internal public class ConnectionLimitingFactory extends Object implements FileSystemFactory
A wrapping factory that adds aLimitedConnectionsFileSystemto a file system.
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidconfigure(Configuration config)Optional method for plugins to pick up settings from the configuration.FileSystemcreate(URI fsUri)Creates a new file system for the given file system URI.static FileSystemFactorydecorateIfLimited(FileSystemFactory factory, String scheme, Configuration config)Decorates the given factory for aConnectionLimitingFactory, if the given configuration configured connection limiting for the given file system scheme.ClassLoadergetClassLoader()Helper method to get the class loader used to load the plugin.StringgetScheme()Gets the scheme of the file system created by this factory.
-
-
-
Method Detail
-
getClassLoader
public ClassLoader getClassLoader()
Description copied from interface:PluginHelper method to get the class loader used to load the plugin. This may be needed for some plugins that use dynamic class loading afterwards the plugin was loaded.- Specified by:
getClassLoaderin interfacePlugin- Returns:
- the class loader used to load the plugin.
-
getScheme
public String getScheme()
Description copied from interface:FileSystemFactoryGets the scheme of the file system created by this factory.- Specified by:
getSchemein interfaceFileSystemFactory
-
configure
public void configure(Configuration config)
Description copied from interface:PluginOptional method for plugins to pick up settings from the configuration.
-
create
public FileSystem create(URI fsUri) throws IOException
Description copied from interface:FileSystemFactoryCreates a new file system for the given file system URI. The URI describes the type of file system (via its scheme) and optionally the authority (for example the host) of the file system.- Specified by:
createin interfaceFileSystemFactory- Parameters:
fsUri- The URI that describes the file system.- Returns:
- A new instance of the specified file system.
- Throws:
IOException- Thrown if the file system could not be instantiated.
-
decorateIfLimited
public static FileSystemFactory decorateIfLimited(FileSystemFactory factory, String scheme, Configuration config)
Decorates the given factory for aConnectionLimitingFactory, if the given configuration configured connection limiting for the given file system scheme. Otherwise, it returns the given factory as is.- Parameters:
factory- The factory to potentially decorate.scheme- The file scheme for which to check the configuration.config- The configuration- Returns:
- The decorated factors, if connection limiting is configured, the original factory otherwise.
-
-