@Test(enabled = false) public void testListFiles() throws IOException, URISyntaxException { HDFSRoot hdfsRoot = new HDFSRoot("/tmp/ListFiles"); MetricsFileSystemInstrumentation fs = (MetricsFileSystemInstrumentation) FileSystem.get(new URI(instrumentedURI), new Configuration()); fs.listFiles(hdfsRoot.getRootPath(), true); Assert.assertEquals(fs.listFilesTimer.getCount(), 1); Assert.assertEquals(fs.listStatusTimer.getCount(), 0); hdfsRoot.cleanupRoot(); }
@Test(enabled = false) public void testCreate10() throws IOException, URISyntaxException { HDFSRoot hdfsRoot = new HDFSRoot("/tmp/create"); MetricsFileSystemInstrumentation fs = (MetricsFileSystemInstrumentation) FileSystem.get(new URI(instrumentedURI), new Configuration()); Path newFile = new Path("/tmp/create/newFile"); FSDataOutputStream fstream = fs.create(newFile, null); Assert.assertEquals(fs.createTimer.getCount(), 1); fstream.close(); hdfsRoot.cleanupRoot(); }
@Test(enabled = false) public void testCreate6() throws IOException, URISyntaxException { HDFSRoot hdfsRoot = new HDFSRoot("/tmp/create"); MetricsFileSystemInstrumentation fs = (MetricsFileSystemInstrumentation) FileSystem.get(new URI(instrumentedURI), new Configuration()); Path newFile = new Path("/tmp/create/newFile"); FSDataOutputStream fstream = fs.create(newFile, true, 300, (short)1, 1048576, null); Assert.assertEquals(fs.createTimer.getCount(), 1); fstream.close(); hdfsRoot.cleanupRoot(); }
@Test(enabled = false) public void testGlobStatus() throws IOException, URISyntaxException { HDFSRoot hdfsRoot = new HDFSRoot("/tmp/GlobStatus"); MetricsFileSystemInstrumentation fs = (MetricsFileSystemInstrumentation) FileSystem.get(new URI(instrumentedURI), new Configuration()); FileStatus[] status = fs.globStatus(new Path("/tmp/GlobStatus/*/*.ext")); Assert.assertEquals(fs.globStatusTimer.getCount(), 1); Assert.assertEquals(status.length, 2); hdfsRoot.cleanupRoot(); }
@Test(enabled = false) public void testCreate2() throws IOException, URISyntaxException { HDFSRoot hdfsRoot = new HDFSRoot("/tmp/create"); MetricsFileSystemInstrumentation fs = (MetricsFileSystemInstrumentation) FileSystem.get(new URI(instrumentedURI), new Configuration()); Path newFile = new Path("/tmp/create/newFile"); FSDataOutputStream fstream = fs.create(newFile, true); Assert.assertEquals(fs.createTimer.getCount(), 1); fstream.close(); hdfsRoot.cleanupRoot(); }
@Test(enabled = false) public void testCreate4() throws IOException, URISyntaxException { HDFSRoot hdfsRoot = new HDFSRoot("/tmp/create"); MetricsFileSystemInstrumentation fs = (MetricsFileSystemInstrumentation) FileSystem.get(new URI(instrumentedURI), new Configuration()); Path newFile = new Path("/tmp/create/newFile"); FSDataOutputStream fstream = fs.create(newFile, true, 300, null); Assert.assertEquals(fs.createTimer.getCount(), 1); fstream.close(); hdfsRoot.cleanupRoot(); }
@Test(enabled = false) public void testCreate5() throws IOException, URISyntaxException { HDFSRoot hdfsRoot = new HDFSRoot("/tmp/create"); MetricsFileSystemInstrumentation fs = (MetricsFileSystemInstrumentation) FileSystem.get(new URI(instrumentedURI), new Configuration()); Path newFile = new Path("/tmp/create/newFile"); FSDataOutputStream fstream = fs.create(newFile, true, 300, (short)1, 1048576); Assert.assertEquals(fs.createTimer.getCount(), 1); fstream.close(); hdfsRoot.cleanupRoot(); }
@Test(enabled = false) public void testOpen1() throws IOException, URISyntaxException { HDFSRoot hdfsRoot = new HDFSRoot("/tmp/Open"); MetricsFileSystemInstrumentation fs = (MetricsFileSystemInstrumentation) FileSystem.get(new URI(instrumentedURI), new Configuration()); Path newFile = new Path(hdfsRoot.getRootPath(), new Path("file8.ext")); FSDataInputStream fstream = fs.open(newFile); Assert.assertEquals(fs.openTimer.getCount(), 1); fstream.close(); hdfsRoot.cleanupRoot(); }
@Test(enabled = false) public void testMakeDirs() throws IOException, URISyntaxException { HDFSRoot hdfsRoot = new HDFSRoot("/tmp/mkdirs"); MetricsFileSystemInstrumentation fs = (MetricsFileSystemInstrumentation) FileSystem.get(new URI(instrumentedURI), new Configuration()); Path newDir = new Path (hdfsRoot.getRootPath(), new Path("X/Y/Z")); fs.mkdirs(newDir); Assert.assertEquals(fs.mkdirTimer.getCount(), 1); hdfsRoot.cleanupRoot(); }
@Test(enabled = false) public void testCreate1() throws IOException, URISyntaxException { HDFSRoot hdfsRoot = new HDFSRoot("/tmp/create"); MetricsFileSystemInstrumentation fs = (MetricsFileSystemInstrumentation) FileSystem.get(new URI(instrumentedURI), new Configuration()); Path newFile = new Path("/tmp/create/newFile"); FSDataOutputStream fstream = fs.create(newFile); Assert.assertEquals(fs.createTimer.getCount(), 1); fstream.close(); hdfsRoot.cleanupRoot(); }
@Test(enabled = false) public void testSetTimes() throws IOException, URISyntaxException { HDFSRoot hdfsRoot = new HDFSRoot("/tmp/setTimes"); MetricsFileSystemInstrumentation fs = (MetricsFileSystemInstrumentation) FileSystem.get(new URI(instrumentedURI), new Configuration()); fs.setTimes(hdfsRoot.getFilePath8(), System.currentTimeMillis(), System.currentTimeMillis()); Assert.assertEquals(fs.setTimesTimer.getCount(), 1); hdfsRoot.cleanupRoot(); }
@Test(enabled = false) public void testMakeDirsWithPermission() throws IOException, URISyntaxException { HDFSRoot hdfsRoot = new HDFSRoot("/tmp/mkdirsWithPermission"); MetricsFileSystemInstrumentation fs = (MetricsFileSystemInstrumentation) FileSystem.get(new URI(instrumentedURI), new Configuration()); Path newDir = new Path (hdfsRoot.getRootPath(), new Path("X/Y/Z")); fs.mkdirs(newDir, new FsPermission(FsAction.ALL, FsAction.ALL, FsAction.READ)); Assert.assertEquals(fs.mkdirTimer.getCount(), 1); hdfsRoot.cleanupRoot(); }
@Test(enabled = false) public void testListStatusPath() throws IOException, URISyntaxException { HDFSRoot hdfsRoot = new HDFSRoot("/tmp/ListStatusPath"); MetricsFileSystemInstrumentation fs = (MetricsFileSystemInstrumentation) FileSystem.get(new URI(instrumentedURI), new Configuration()); Path rootPath = hdfsRoot.getRootPath(); FileStatus[] status = fs.listStatus(rootPath); Assert.assertEquals(fs.listStatusTimer.getCount(), 1); Assert.assertEquals(status.length, 6); hdfsRoot.cleanupRoot(); }
@Test(enabled = false) public void testAppend2() throws IOException, URISyntaxException { HDFSRoot hdfsRoot = new HDFSRoot("/tmp/append"); MetricsFileSystemInstrumentation fs = (MetricsFileSystemInstrumentation) FileSystem.get(new URI(instrumentedURI), new Configuration()); FSDataOutputStream fstream = fs.append(hdfsRoot.getFilePath8(), 100); Assert.assertEquals(fs.appendTimer.getCount(), 1); fstream.close(); hdfsRoot.cleanupRoot(); }
@Test(enabled = false) public void testAppend1() throws IOException, URISyntaxException { HDFSRoot hdfsRoot = new HDFSRoot("/tmp/append"); MetricsFileSystemInstrumentation fs = (MetricsFileSystemInstrumentation) FileSystem.get(new URI(instrumentedURI), new Configuration()); FSDataOutputStream fstream = fs.append(hdfsRoot.getFilePath8()); Assert.assertEquals(fs.appendTimer.getCount(), 1); fstream.close(); hdfsRoot.cleanupRoot(); }
@Test(enabled = false) public void testSetPermission() throws IOException, URISyntaxException { HDFSRoot hdfsRoot = new HDFSRoot("/tmp/permission"); MetricsFileSystemInstrumentation fs = (MetricsFileSystemInstrumentation) FileSystem.get(new URI(instrumentedURI), new Configuration()); FsPermission permission = new FsPermission(FsAction.ALL, FsAction.ALL, FsAction.READ); fs.setPermission(hdfsRoot.getFilePath8(), permission); Assert.assertEquals(fs.setPermissionTimer.getCount(), 1); hdfsRoot.cleanupRoot(); }
@Test(enabled = false) public void testAppend3() throws IOException, URISyntaxException { HDFSRoot hdfsRoot = new HDFSRoot("/tmp/append"); MetricsFileSystemInstrumentation fs = (MetricsFileSystemInstrumentation) FileSystem.get(new URI(instrumentedURI), new Configuration()); FSDataOutputStream fstream = fs.append(hdfsRoot.getFilePath8(), 100, null); Assert.assertEquals(fs.appendTimer.getCount(), 1); fstream.close(); hdfsRoot.cleanupRoot(); } }
@Test(enabled = false) public void testDelete() throws IOException, URISyntaxException { HDFSRoot hdfsRoot = new HDFSRoot("/tmp/delete"); MetricsFileSystemInstrumentation fs = (MetricsFileSystemInstrumentation) FileSystem.get(new URI(instrumentedURI), new Configuration()); fs.delete(hdfsRoot.getDirPath3(), true); Assert.assertEquals(fs.deleteTimer.getCount(), 1); hdfsRoot.cleanupRoot(); }
@Test(enabled = false) public void testGetFileStatus() throws IOException, URISyntaxException { HDFSRoot hdfsRoot = new HDFSRoot("/tmp/getFileStatus"); MetricsFileSystemInstrumentation fs = (MetricsFileSystemInstrumentation) FileSystem.get(new URI(instrumentedURI), new Configuration()); fs.getFileStatus(hdfsRoot.getFilePath8()); Assert.assertEquals(fs.getFileStatusTimer.getCount(), 1); hdfsRoot.cleanupRoot(); }
@Test(enabled = false) public void testRename() throws IOException, URISyntaxException { HDFSRoot hdfsRoot = new HDFSRoot("/tmp/rename"); MetricsFileSystemInstrumentation fs = (MetricsFileSystemInstrumentation) FileSystem.get(new URI(instrumentedURI), new Configuration()); Path newDir = new Path("/tmp/rename/AfterRename"); fs.rename(hdfsRoot.getDirPath3(), newDir); Assert.assertEquals(fs.renameTimer.getCount(), 1); Assert.assertFalse(fs.exists(hdfsRoot.getDirPath3())); Assert.assertTrue(fs.exists(newDir)); hdfsRoot.cleanupRoot(); }