test_class.file: flink-core/src/test/java/org/apache/flink/core/fs/FileSystemTest.java
test_class.identifier: FileSystemTest
test_case.body: @Test
  	public void testGet() throws URISyntaxException, IOException {
  		String scheme = "file";
  		
  		assertTrue(FileSystem.get(new URI(scheme + ":///test/test")) instanceof LocalFileSystem);
  		
  		try {
  			FileSystem.get(new URI(scheme + "://test/test"));
  		} catch (IOException ioe) {
  			assertTrue(ioe.getMessage().startsWith("Found local file path with authority '"));
  		}
  
  		assertTrue(FileSystem.get(new URI(scheme + ":/test/test")) instanceof LocalFileSystem);
  		
  		assertTrue(FileSystem.get(new URI(scheme + ":test/test")) instanceof LocalFileSystem);
  
  		assertTrue(FileSystem.get(new URI("/test/test")) instanceof LocalFileSystem);
  		
  		assertTrue(FileSystem.get(new URI("test/test")) instanceof LocalFileSystem);
  	}
test_case.class_method_signature: FileSystemTest.testGet()
test_case.full_signature: @Test public void testGet()
test_case.identifier: testGet
test_case.invocations: assertTrue get get assertTrue startsWith getMessage assertTrue get assertTrue get assertTrue get assertTrue get
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void testGet()
focal_class.declarator: LOCAL_FILESYSTEM_CLASS = "org.apache.flink.core.fs.local.LocalFileSystem"
focal_class.modifier: private static final
focal_class.original_string: private static final String LOCAL_FILESYSTEM_CLASS = "org.apache.flink.core.fs.local.LocalFileSystem";
focal_class.type: String
focal_class.var_name: LOCAL_FILESYSTEM_CLASS
focal_class.declarator: HADOOP_WRAPPER_FILESYSTEM_CLASS = "org.apache.flink.runtime.fs.hdfs.HadoopFileSystem"
focal_class.modifier: private static final
focal_class.original_string: private static final String HADOOP_WRAPPER_FILESYSTEM_CLASS = "org.apache.flink.runtime.fs.hdfs.HadoopFileSystem";
focal_class.type: String
focal_class.var_name: HADOOP_WRAPPER_FILESYSTEM_CLASS
focal_class.declarator: MAPR_FILESYSTEM_CLASS = "org.apache.flink.runtime.fs.maprfs.MapRFileSystem"
focal_class.modifier: private static final
focal_class.original_string: private static final String MAPR_FILESYSTEM_CLASS = "org.apache.flink.runtime.fs.maprfs.MapRFileSystem";
focal_class.type: String
focal_class.var_name: MAPR_FILESYSTEM_CLASS
focal_class.declarator: HADOOP_WRAPPER_SCHEME = "hdwrapper"
focal_class.modifier: private static final
focal_class.original_string: private static final String HADOOP_WRAPPER_SCHEME = "hdwrapper";
focal_class.type: String
focal_class.var_name: HADOOP_WRAPPER_SCHEME
focal_class.declarator: SYNCHRONIZATION_OBJECT = new Object()
focal_class.modifier: private static final
focal_class.original_string: private static final Object SYNCHRONIZATION_OBJECT = new Object();
focal_class.type: Object
focal_class.var_name: SYNCHRONIZATION_OBJECT
focal_class.declarator: CACHE = new HashMap<FSKey, FileSystem>()
focal_class.modifier: private static final
focal_class.original_string: private static final Map<FSKey, FileSystem> CACHE = new HashMap<FSKey, FileSystem>();
focal_class.type: Map<FSKey, FileSystem>
focal_class.var_name: CACHE
focal_class.declarator: FSDIRECTORY = new HashMap<String, String>()
focal_class.modifier: private static final
focal_class.original_string: private static final Map<String, String> FSDIRECTORY = new HashMap<String, String>();
focal_class.type: Map<String, String>
focal_class.var_name: FSDIRECTORY
focal_class.declarator: defaultScheme
focal_class.modifier: private static
focal_class.original_string: private static URI defaultScheme;
focal_class.type: URI
focal_class.var_name: defaultScheme
focal_class.declarator: hadoopWrapper
focal_class.modifier: private static
focal_class.original_string: private static HadoopFileSystemWrapper hadoopWrapper;
focal_class.type: HadoopFileSystemWrapper
focal_class.var_name: hadoopWrapper
focal_class.file: flink-core/src/main/java/org/apache/flink/core/fs/FileSystem.java
focal_class.identifier: FileSystem
focal_class.class_method_signature: FileSystem.getLocalFileSystem()
focal_class.full_signature: public static FileSystem getLocalFileSystem()
focal_class.identifier: getLocalFileSystem
focal_class.modifiers: public static
focal_class.parameters: ()
focal_class.return: FileSystem
focal_class.signature: FileSystem getLocalFileSystem()
focal_class.class_method_signature: FileSystem.setDefaultScheme(Configuration config)
focal_class.full_signature: public static void setDefaultScheme(Configuration config)
focal_class.identifier: setDefaultScheme
focal_class.modifiers: public static
focal_class.parameters: (Configuration config)
focal_class.return: void
focal_class.signature: void setDefaultScheme(Configuration config)
focal_class.class_method_signature: FileSystem.get(URI uri)
focal_class.full_signature: public static FileSystem get(URI uri)
focal_class.identifier: get
focal_class.modifiers: public static
focal_class.parameters: (URI uri)
focal_class.return: FileSystem
focal_class.signature: FileSystem get(URI uri)
focal_class.class_method_signature: FileSystem.instantiateHadoopFileSystemWrapper(Class<?> wrappedFileSystem)
focal_class.full_signature: private static FileSystem instantiateHadoopFileSystemWrapper(Class<?> wrappedFileSystem)
focal_class.identifier: instantiateHadoopFileSystemWrapper
focal_class.modifiers: private static
focal_class.parameters: (Class<?> wrappedFileSystem)
focal_class.return: FileSystem
focal_class.signature: FileSystem instantiateHadoopFileSystemWrapper(Class<?> wrappedFileSystem)
focal_class.class_method_signature: FileSystem.instantiateFileSystem(String className)
focal_class.full_signature: private static FileSystem instantiateFileSystem(String className)
focal_class.identifier: instantiateFileSystem
focal_class.modifiers: private static
focal_class.parameters: (String className)
focal_class.return: FileSystem
focal_class.signature: FileSystem instantiateFileSystem(String className)
focal_class.class_method_signature: FileSystem.getHadoopWrapperClassNameForFileSystem(String scheme)
focal_class.full_signature: private static Class<?> getHadoopWrapperClassNameForFileSystem(String scheme)
focal_class.identifier: getHadoopWrapperClassNameForFileSystem
focal_class.modifiers: private static
focal_class.parameters: (String scheme)
focal_class.return: Class<?>
focal_class.signature: Class<?> getHadoopWrapperClassNameForFileSystem(String scheme)
focal_class.class_method_signature: FileSystem.getWorkingDirectory()
focal_class.full_signature: public abstract Path getWorkingDirectory()
focal_class.identifier: getWorkingDirectory
focal_class.modifiers: public abstract
focal_class.parameters: ()
focal_class.return: Path
focal_class.signature: Path getWorkingDirectory()
focal_class.class_method_signature: FileSystem.getHomeDirectory()
focal_class.full_signature: public abstract Path getHomeDirectory()
focal_class.identifier: getHomeDirectory
focal_class.modifiers: public abstract
focal_class.parameters: ()
focal_class.return: Path
focal_class.signature: Path getHomeDirectory()
focal_class.class_method_signature: FileSystem.getUri()
focal_class.full_signature: public abstract URI getUri()
focal_class.identifier: getUri
focal_class.modifiers: public abstract
focal_class.parameters: ()
focal_class.return: URI
focal_class.signature: URI getUri()
focal_class.class_method_signature: FileSystem.initialize(URI name)
focal_class.full_signature: public abstract void initialize(URI name)
focal_class.identifier: initialize
focal_class.modifiers: public abstract
focal_class.parameters: (URI name)
focal_class.return: void
focal_class.signature: void initialize(URI name)
focal_class.class_method_signature: FileSystem.getFileStatus(Path f)
focal_class.full_signature: public abstract FileStatus getFileStatus(Path f)
focal_class.identifier: getFileStatus
focal_class.modifiers: public abstract
focal_class.parameters: (Path f)
focal_class.return: FileStatus
focal_class.signature: FileStatus getFileStatus(Path f)
focal_class.class_method_signature: FileSystem.getFileBlockLocations(FileStatus file, long start, long len)
focal_class.full_signature: public abstract BlockLocation[] getFileBlockLocations(FileStatus file, long start, long len)
focal_class.identifier: getFileBlockLocations
focal_class.modifiers: public abstract
focal_class.parameters: (FileStatus file, long start, long len)
focal_class.return: BlockLocation[]
focal_class.signature: BlockLocation[] getFileBlockLocations(FileStatus file, long start, long len)
focal_class.class_method_signature: FileSystem.open(Path f, int bufferSize)
focal_class.full_signature: public abstract FSDataInputStream open(Path f, int bufferSize)
focal_class.identifier: open
focal_class.modifiers: public abstract
focal_class.parameters: (Path f, int bufferSize)
focal_class.return: FSDataInputStream
focal_class.signature: FSDataInputStream open(Path f, int bufferSize)
focal_class.class_method_signature: FileSystem.open(Path f)
focal_class.full_signature: public abstract FSDataInputStream open(Path f)
focal_class.identifier: open
focal_class.modifiers: public abstract
focal_class.parameters: (Path f)
focal_class.return: FSDataInputStream
focal_class.signature: FSDataInputStream open(Path f)
focal_class.class_method_signature: FileSystem.getDefaultBlockSize()
focal_class.full_signature: public long getDefaultBlockSize()
focal_class.identifier: getDefaultBlockSize
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.return: long
focal_class.signature: long getDefaultBlockSize()
focal_class.class_method_signature: FileSystem.listStatus(Path f)
focal_class.full_signature: public abstract FileStatus[] listStatus(Path f)
focal_class.identifier: listStatus
focal_class.modifiers: public abstract
focal_class.parameters: (Path f)
focal_class.return: FileStatus[]
focal_class.signature: FileStatus[] listStatus(Path f)
focal_class.class_method_signature: FileSystem.exists(final Path f)
focal_class.full_signature: public boolean exists(final Path f)
focal_class.identifier: exists
focal_class.modifiers: public
focal_class.parameters: (final Path f)
focal_class.return: boolean
focal_class.signature: boolean exists(final Path f)
focal_class.class_method_signature: FileSystem.delete(Path f, boolean recursive)
focal_class.full_signature: public abstract boolean delete(Path f, boolean recursive)
focal_class.identifier: delete
focal_class.modifiers: public abstract
focal_class.parameters: (Path f, boolean recursive)
focal_class.return: boolean
focal_class.signature: boolean delete(Path f, boolean recursive)
focal_class.class_method_signature: FileSystem.mkdirs(Path f)
focal_class.full_signature: public abstract boolean mkdirs(Path f)
focal_class.identifier: mkdirs
focal_class.modifiers: public abstract
focal_class.parameters: (Path f)
focal_class.return: boolean
focal_class.signature: boolean mkdirs(Path f)
focal_class.class_method_signature: FileSystem.create(Path f, boolean overwrite, int bufferSize, short replication,
  			long blockSize)
focal_class.full_signature: public abstract FSDataOutputStream create(Path f, boolean overwrite, int bufferSize, short replication,
  			long blockSize)
focal_class.identifier: create
focal_class.modifiers: public abstract
focal_class.parameters: (Path f, boolean overwrite, int bufferSize, short replication,
  			long blockSize)
focal_class.return: FSDataOutputStream
focal_class.signature: FSDataOutputStream create(Path f, boolean overwrite, int bufferSize, short replication,
  			long blockSize)
focal_class.class_method_signature: FileSystem.create(Path f, boolean overwrite)
focal_class.full_signature: public abstract FSDataOutputStream create(Path f, boolean overwrite)
focal_class.identifier: create
focal_class.modifiers: public abstract
focal_class.parameters: (Path f, boolean overwrite)
focal_class.return: FSDataOutputStream
focal_class.signature: FSDataOutputStream create(Path f, boolean overwrite)
focal_class.class_method_signature: FileSystem.rename(Path src, Path dst)
focal_class.full_signature: public abstract boolean rename(Path src, Path dst)
focal_class.identifier: rename
focal_class.modifiers: public abstract
focal_class.parameters: (Path src, Path dst)
focal_class.return: boolean
focal_class.signature: boolean rename(Path src, Path dst)
focal_class.class_method_signature: FileSystem.initOutPathLocalFS(Path outPath, WriteMode writeMode, boolean createDirectory)
focal_class.full_signature: public boolean initOutPathLocalFS(Path outPath, WriteMode writeMode, boolean createDirectory)
focal_class.identifier: initOutPathLocalFS
focal_class.modifiers: public
focal_class.parameters: (Path outPath, WriteMode writeMode, boolean createDirectory)
focal_class.return: boolean
focal_class.signature: boolean initOutPathLocalFS(Path outPath, WriteMode writeMode, boolean createDirectory)
focal_class.class_method_signature: FileSystem.initOutPathDistFS(Path outPath, WriteMode writeMode, boolean createDirectory)
focal_class.full_signature: public boolean initOutPathDistFS(Path outPath, WriteMode writeMode, boolean createDirectory)
focal_class.identifier: initOutPathDistFS
focal_class.modifiers: public
focal_class.parameters: (Path outPath, WriteMode writeMode, boolean createDirectory)
focal_class.return: boolean
focal_class.signature: boolean initOutPathDistFS(Path outPath, WriteMode writeMode, boolean createDirectory)
focal_class.class_method_signature: FileSystem.isDistributedFS()
focal_class.full_signature: public abstract boolean isDistributedFS()
focal_class.identifier: isDistributedFS
focal_class.modifiers: public abstract
focal_class.parameters: ()
focal_class.return: boolean
focal_class.signature: boolean isDistributedFS()
focal_class.class_method_signature: FileSystem.getFileSystemByName(String className)
focal_class.full_signature: private static Class<? extends FileSystem> getFileSystemByName(String className)
focal_class.identifier: getFileSystemByName
focal_class.modifiers: private static
focal_class.parameters: (String className)
focal_class.return: Class<? extends FileSystem>
focal_class.signature: Class<? extends FileSystem> getFileSystemByName(String className)
focal_method.body: public static FileSystem get(URI uri) throws IOException {
  		FileSystem fs;
  
  		URI asked = uri;
  		synchronized (SYNCHRONIZATION_OBJECT) {
  
  			if (uri.getScheme() == null) {
  				try {
  					if (defaultScheme == null) {
  						defaultScheme = new URI(ConfigConstants.DEFAULT_FILESYSTEM_SCHEME);
  					}
  
  					uri = new URI(defaultScheme.getScheme(), null, defaultScheme.getHost(),
  						defaultScheme.getPort(), uri.getPath(), null, null);
  
  				} catch (URISyntaxException e) {
  					try {
  						if (defaultScheme.getScheme().equals("file")) {
  							uri = new URI("file", null,
  								new Path(new File(uri.getPath()).getAbsolutePath()).toUri().getPath(), null);
  						}
  					} catch (URISyntaxException ex) {
  						// we tried to repair it, but could not. report the scheme error
  						throw new IOException("The URI '" + uri.toString() + "' is not valid.");
  					}
  				}
  			}
  
  			if(uri.getScheme() == null) {
  				throw new IOException("The URI '" + uri + "' is invalid.\n" +
  					"The fs.default-scheme = " + defaultScheme + ", the requested URI = " + asked +
  					", and the final URI = " + uri + ".");
  			}
  
  			if (uri.getScheme().equals("file") && uri.getAuthority() != null && !uri.getAuthority().isEmpty()) {
  				String supposedUri = "file:///" + uri.getAuthority() + uri.getPath();
  
  				throw new IOException("Found local file path with authority '" + uri.getAuthority() + "' in path '"
  						+ uri.toString() + "'. Hint: Did you forget a slash? (correct path would be '" + supposedUri + "')");
  			}
  
  			final FSKey key = new FSKey(uri.getScheme(), uri.getAuthority());
  
  			// See if there is a file system object in the cache
  			if (CACHE.containsKey(key)) {
  				return CACHE.get(key);
  			}
  
  			// Try to create a new file system
  
  			if (!FSDIRECTORY.containsKey(uri.getScheme())) {
  				// no build in support for this file system. Falling back to Hadoop's FileSystem impl.
  				Class<?> wrapperClass = getHadoopWrapperClassNameForFileSystem(uri.getScheme());
  				if (wrapperClass != null) {
  					// hadoop has support for the FileSystem
  					FSKey wrappedKey = new FSKey(HADOOP_WRAPPER_SCHEME + "+" + uri.getScheme(), uri.getAuthority());
  					if (CACHE.containsKey(wrappedKey)) {
  						return CACHE.get(wrappedKey);
  					}
  					// cache didn't contain the file system. instantiate it:
  
  					// by now we know that the HadoopFileSystem wrapper can wrap the file system.
  					fs = instantiateHadoopFileSystemWrapper(wrapperClass);
  					fs.initialize(uri);
  					CACHE.put(wrappedKey, fs);
  
  				} else {
  					// we can not read from this file system.
  					throw new IOException("No file system found with scheme " + uri.getScheme()
  						+ ", referenced in file URI '" + uri.toString() + "'.");
  				}
  			} else {
  				// we end up here if we have a file system with build-in flink support.
  				String fsClass = FSDIRECTORY.get(uri.getScheme());
  				if (fsClass.equals(HADOOP_WRAPPER_FILESYSTEM_CLASS)) {
  					fs = instantiateHadoopFileSystemWrapper(null);
  				} else {
  					fs = instantiateFileSystem(fsClass);
  				}
  				// Initialize new file system object
  				fs.initialize(uri);
  
  				// Add new file system object to cache
  				CACHE.put(key, fs);
  			}
  		}
  
  		return fs;
  	}
focal_method.class_method_signature: FileSystem.get(URI uri)
focal_method.full_signature: public static FileSystem get(URI uri)
focal_method.identifier: get
focal_method.invocations: getScheme getScheme getHost getPort getPath equals getScheme getPath toUri getAbsolutePath getPath toString getScheme equals getScheme getAuthority isEmpty getAuthority getAuthority getPath getAuthority toString getScheme getAuthority containsKey get containsKey getScheme getHadoopWrapperClassNameForFileSystem getScheme getScheme getAuthority containsKey get instantiateHadoopFileSystemWrapper initialize put getScheme toString get getScheme equals instantiateHadoopFileSystemWrapper instantiateFileSystem initialize put
focal_method.modifiers: public static
focal_method.parameters: (URI uri)
focal_method.return: FileSystem
focal_method.signature: FileSystem get(URI uri)