test_class.file: flink-core/src/test/java/org/apache/flink/core/fs/local/LocalFileSystemTest.java
test_class.identifier: LocalFileSystemTest
test_case.body: @Test
  	public void testLocalFilesystem() {
  
  		File tempdir = new File(CommonTestUtils.getTempDir() + File.separator
  			+ CommonTestUtils.getRandomDirectoryName() + File.separator);
  
  		// we must ensure, that this directory does NOT exist yet
  		// probability is extremely low but just to make sure..
  		while (tempdir.exists()) {
  			tempdir = new File(CommonTestUtils.getTempDir() + File.separator + CommonTestUtils.getRandomDirectoryName()
  				+ File.separator);
  		}
  
  		final File testfile1 = new File(tempdir.getAbsolutePath() + File.separator
  			+ CommonTestUtils.getRandomFilename());
  
  		final File testfile2 = new File(tempdir.getAbsolutePath() + File.separator
  			+ CommonTestUtils.getRandomFilename());
  
  		final Path pathtotestfile1 = new Path(testfile1.toURI().getPath());
  		final Path pathtotestfile2 = new Path(testfile2.toURI().getPath());
  
  		try {
  			final LocalFileSystem lfs = new LocalFileSystem();
  
  			final Path pathtotmpdir = new Path(tempdir.toURI().getPath());
  
  			/*
  			 * check that lfs can see/create/delete/read directories
  			 */
  
  			// check that dir is not existent yet
  			assertFalse(lfs.exists(pathtotmpdir));
  			tempdir.mkdirs();
  
  			// check that local file system recognizes file..
  			assertTrue(lfs.exists(pathtotmpdir));
  			final FileStatus localstatus1 = lfs.getFileStatus(pathtotmpdir);
  
  			// check that lfs recognizes directory..
  			assertTrue(localstatus1.isDir());
  
  			// get status for files in this (empty) directory..
  			final FileStatus[] statusforfiles = lfs.listStatus(pathtotmpdir);
  
  			// no files in there.. hence, must be zero
  			assertTrue(statusforfiles.length == 0);
  
  			// check that lfs can delete directory..
  			lfs.delete(pathtotmpdir, true);
  
  			// double check that directory is not existent anymore..
  			assertFalse(lfs.exists(pathtotmpdir));
  			assertFalse(tempdir.exists());
  
  			// re-create directory..
  			lfs.mkdirs(pathtotmpdir);
  
  			// creation successful?
  			assertTrue(tempdir.exists());
  
  			/*
  			 * check that lfs can create/read/write from/to files properly and read meta information..
  			 */
  
  			// create files.. one ""natively"", one using lfs
  			final FSDataOutputStream lfsoutput1 = lfs.create(pathtotestfile1, false);
  			testfile2.createNewFile();
  
  			// does lfs create files? does lfs recognize created files?
  			assertTrue(testfile1.exists());
  			assertTrue(lfs.exists(pathtotestfile2));
  
  			// test that lfs can write to files properly
  			final byte[] testbytes = { 1, 2, 3, 4, 5 };
  			lfsoutput1.write(testbytes);
  			lfsoutput1.close();
  
  			assertEquals(testfile1.length(), 5l);
  
  			final FileInputStream fisfile1 = new FileInputStream(testfile1);
  			byte[] testbytestest = new byte[5];
  			fisfile1.read(testbytestest);
  			fisfile1.close();
  
  			// assertEquals is not able to compare arrays properly...
  			// assertEquals(testbytes, testbytestest);
  			assertTrue(Arrays.equals(testbytes, testbytestest));
  
  			// does lfs see the correct file length?
  			assertEquals(lfs.getFileStatus(pathtotestfile1).getLen(), testfile1.length());
  
  			// as well, when we call the listStatus (that is intended for directories?)
  			assertEquals(lfs.listStatus(pathtotestfile1)[0].getLen(), testfile1.length());
  
  			// test that lfs can read files properly
  			final FileOutputStream fosfile2 = new FileOutputStream(testfile2);
  			fosfile2.write(testbytes);
  			fosfile2.close();
  
  			testbytestest = new byte[5];
  			final FSDataInputStream lfsinput2 = lfs.open(pathtotestfile2);
  			assertEquals(lfsinput2.read(testbytestest), 5);
  			lfsinput2.close();
  			assertTrue(Arrays.equals(testbytes, testbytestest));
  
  			// does lfs see two files?
  			assertEquals(lfs.listStatus(pathtotmpdir).length, 2);
  
  			// do we get exactly one blocklocation per file? no matter what start and len we provide
  			assertEquals(lfs.getFileBlockLocations(lfs.getFileStatus(pathtotestfile1), 0, 0).length, 1);
  
  			/*
  			 * can lfs delete files / directories?
  			 */
  			assertTrue(lfs.delete(pathtotestfile1, false));
  
  			// and can lfs also delete directories recursively?
  			assertTrue(lfs.delete(pathtotmpdir, true));
  
  			assertTrue(!tempdir.exists());
  
  		} catch (IOException e) {
  			fail(e.getMessage());
  		} finally {
  			// clean up!
  			testfile1.delete();
  			testfile2.delete();
  			tempdir.delete();
  		}
  	}
test_case.class_method_signature: LocalFileSystemTest.testLocalFilesystem()
test_case.full_signature: @Test public void testLocalFilesystem()
test_case.identifier: testLocalFilesystem
test_case.invocations: getTempDir getRandomDirectoryName exists getTempDir getRandomDirectoryName getAbsolutePath getRandomFilename getAbsolutePath getRandomFilename getPath toURI getPath toURI getPath toURI assertFalse exists mkdirs assertTrue exists getFileStatus assertTrue isDir listStatus assertTrue delete assertFalse exists assertFalse exists mkdirs assertTrue exists create createNewFile assertTrue exists assertTrue exists write close assertEquals length read close assertTrue equals assertEquals getLen getFileStatus length assertEquals getLen listStatus length write close open assertEquals read close assertTrue equals assertEquals listStatus assertEquals getFileBlockLocations getFileStatus assertTrue delete assertTrue delete assertTrue exists fail getMessage delete delete delete
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void testLocalFilesystem()
focal_class.declarator: workingDir = null
focal_class.modifier: private
focal_class.original_string: private Path workingDir = null;
focal_class.type: Path
focal_class.var_name: workingDir
focal_class.declarator: name = OperatingSystem.isWindows() ? URI.create("file:/") : URI.create("file:///")
focal_class.modifier: private final
focal_class.original_string: private final URI name = OperatingSystem.isWindows() ? URI.create("file:/") : URI.create("file:///");
focal_class.type: URI
focal_class.var_name: name
focal_class.declarator: hostName
focal_class.modifier: private final
focal_class.original_string: private final String hostName;
focal_class.type: String
focal_class.var_name: hostName
focal_class.declarator: LOG = LoggerFactory.getLogger(LocalFileSystem.class)
focal_class.modifier: private static final
focal_class.original_string: private static final Logger LOG = LoggerFactory.getLogger(LocalFileSystem.class);
focal_class.type: Logger
focal_class.var_name: LOG
focal_class.file: flink-core/src/main/java/org/apache/flink/core/fs/local/LocalFileSystem.java
focal_class.identifier: LocalFileSystem
focal_class.class_method_signature: LocalFileSystem.LocalFileSystem()
focal_class.full_signature: public  LocalFileSystem()
focal_class.identifier: LocalFileSystem
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.signature:  LocalFileSystem()
focal_class.class_method_signature: LocalFileSystem.getFileBlockLocations(final FileStatus file, final long start, final long len)
focal_class.full_signature: @Override public BlockLocation[] getFileBlockLocations(final FileStatus file, final long start, final long len)
focal_class.identifier: getFileBlockLocations
focal_class.modifiers: @Override public
focal_class.parameters: (final FileStatus file, final long start, final long len)
focal_class.return: BlockLocation[]
focal_class.signature: BlockLocation[] getFileBlockLocations(final FileStatus file, final long start, final long len)
focal_class.class_method_signature: LocalFileSystem.getFileStatus(Path f)
focal_class.full_signature: @Override public FileStatus getFileStatus(Path f)
focal_class.identifier: getFileStatus
focal_class.modifiers: @Override public
focal_class.parameters: (Path f)
focal_class.return: FileStatus
focal_class.signature: FileStatus getFileStatus(Path f)
focal_class.class_method_signature: LocalFileSystem.getUri()
focal_class.full_signature: @Override public URI getUri()
focal_class.identifier: getUri
focal_class.modifiers: @Override public
focal_class.parameters: ()
focal_class.return: URI
focal_class.signature: URI getUri()
focal_class.class_method_signature: LocalFileSystem.getWorkingDirectory()
focal_class.full_signature: @Override public Path getWorkingDirectory()
focal_class.identifier: getWorkingDirectory
focal_class.modifiers: @Override public
focal_class.parameters: ()
focal_class.return: Path
focal_class.signature: Path getWorkingDirectory()
focal_class.class_method_signature: LocalFileSystem.getHomeDirectory()
focal_class.full_signature: @Override public Path getHomeDirectory()
focal_class.identifier: getHomeDirectory
focal_class.modifiers: @Override public
focal_class.parameters: ()
focal_class.return: Path
focal_class.signature: Path getHomeDirectory()
focal_class.class_method_signature: LocalFileSystem.initialize(final URI name)
focal_class.full_signature: @Override public void initialize(final URI name)
focal_class.identifier: initialize
focal_class.modifiers: @Override public
focal_class.parameters: (final URI name)
focal_class.return: void
focal_class.signature: void initialize(final URI name)
focal_class.class_method_signature: LocalFileSystem.open(final Path f, final int bufferSize)
focal_class.full_signature: @Override public FSDataInputStream open(final Path f, final int bufferSize)
focal_class.identifier: open
focal_class.modifiers: @Override public
focal_class.parameters: (final Path f, final int bufferSize)
focal_class.return: FSDataInputStream
focal_class.signature: FSDataInputStream open(final Path f, final int bufferSize)
focal_class.class_method_signature: LocalFileSystem.open(final Path f)
focal_class.full_signature: @Override public FSDataInputStream open(final Path f)
focal_class.identifier: open
focal_class.modifiers: @Override public
focal_class.parameters: (final Path f)
focal_class.return: FSDataInputStream
focal_class.signature: FSDataInputStream open(final Path f)
focal_class.class_method_signature: LocalFileSystem.pathToFile(Path path)
focal_class.full_signature: private File pathToFile(Path path)
focal_class.identifier: pathToFile
focal_class.modifiers: private
focal_class.parameters: (Path path)
focal_class.return: File
focal_class.signature: File pathToFile(Path path)
focal_class.class_method_signature: LocalFileSystem.listStatus(final Path f)
focal_class.full_signature: @Override public FileStatus[] listStatus(final Path f)
focal_class.identifier: listStatus
focal_class.modifiers: @Override public
focal_class.parameters: (final Path f)
focal_class.return: FileStatus[]
focal_class.signature: FileStatus[] listStatus(final Path f)
focal_class.class_method_signature: LocalFileSystem.delete(final Path f, final boolean recursive)
focal_class.full_signature: @Override public boolean delete(final Path f, final boolean recursive)
focal_class.identifier: delete
focal_class.modifiers: @Override public
focal_class.parameters: (final Path f, final boolean recursive)
focal_class.return: boolean
focal_class.signature: boolean delete(final Path f, final boolean recursive)
focal_class.class_method_signature: LocalFileSystem.delete(final File f)
focal_class.full_signature: private boolean delete(final File f)
focal_class.identifier: delete
focal_class.modifiers: private
focal_class.parameters: (final File f)
focal_class.return: boolean
focal_class.signature: boolean delete(final File f)
focal_class.class_method_signature: LocalFileSystem.mkdirs(final Path f)
focal_class.full_signature: public boolean mkdirs(final Path f)
focal_class.identifier: mkdirs
focal_class.modifiers: public
focal_class.parameters: (final Path f)
focal_class.return: boolean
focal_class.signature: boolean mkdirs(final Path f)
focal_class.class_method_signature: LocalFileSystem.create(final Path f, final boolean overwrite, final int bufferSize,
  			final short replication, final long blockSize)
focal_class.full_signature: @Override public FSDataOutputStream create(final Path f, final boolean overwrite, final int bufferSize,
  			final short replication, final long blockSize)
focal_class.identifier: create
focal_class.modifiers: @Override public
focal_class.parameters: (final Path f, final boolean overwrite, final int bufferSize,
  			final short replication, final long blockSize)
focal_class.return: FSDataOutputStream
focal_class.signature: FSDataOutputStream create(final Path f, final boolean overwrite, final int bufferSize,
  			final short replication, final long blockSize)
focal_class.class_method_signature: LocalFileSystem.create(final Path f, final boolean overwrite)
focal_class.full_signature: @Override public FSDataOutputStream create(final Path f, final boolean overwrite)
focal_class.identifier: create
focal_class.modifiers: @Override public
focal_class.parameters: (final Path f, final boolean overwrite)
focal_class.return: FSDataOutputStream
focal_class.signature: FSDataOutputStream create(final Path f, final boolean overwrite)
focal_class.class_method_signature: LocalFileSystem.rename(final Path src, final Path dst)
focal_class.full_signature: @Override public boolean rename(final Path src, final Path dst)
focal_class.identifier: rename
focal_class.modifiers: @Override public
focal_class.parameters: (final Path src, final Path dst)
focal_class.return: boolean
focal_class.signature: boolean rename(final Path src, final Path dst)
focal_class.class_method_signature: LocalFileSystem.isDistributedFS()
focal_class.full_signature: @Override public boolean isDistributedFS()
focal_class.identifier: isDistributedFS
focal_class.modifiers: @Override public
focal_class.parameters: ()
focal_class.return: boolean
focal_class.signature: boolean isDistributedFS()
focal_class.superclass: extends FileSystem
focal_method.body: public LocalFileSystem() {
  		this.workingDir = new Path(System.getProperty("user.dir")).makeQualified(this);
  
  		String tmp = "unknownHost";
  
  		try {
  			tmp = InetAddress.getLocalHost().getHostName();
  		} catch (UnknownHostException e) {
  			LOG.error("Could not resolve local host", e);
  		}
  
  		this.hostName = tmp;
  	}
focal_method.class_method_signature: LocalFileSystem.LocalFileSystem()
focal_method.full_signature: public  LocalFileSystem()
focal_method.identifier: LocalFileSystem
focal_method.modifiers: public
focal_method.parameters: ()
focal_method.signature:  LocalFileSystem()