@Test public void fileinfoTest() throws IOException { int fileId = TestUtils.createByteFile(mTfs, "/testFile", WriteType.MUST_CACHE, 10); mFsShell.fileinfo(new String[] { "fileinfo", "/testFile" }); TachyonFile tFile = mTfs.getFile("/testFile"); Assert.assertNotNull(tFile); List<ClientBlockInfo> blocks = mTfs.getFileBlocks(fileId); String[] commandParameters = new String[3 + blocks.size()]; commandParameters[0] = "fileinfo"; commandParameters[1] = "/testFile"; commandParameters[2] = String.valueOf(fileId); Iterator<ClientBlockInfo> iter = blocks.iterator(); int i = 3; while (iter.hasNext()) { commandParameters[i ++] = iter.next().toString(); } Assert.assertEquals(getCommandOutput(commandParameters), mOutput.toString()); }
public int fileinfo(String argv[]) throws IOException { if (argv.length != 2) { System.out.println("Usage: tfs fileinfo <path>"); return -1; } String path = argv[1]; String file = Utils.getFilePath(path); TachyonFS tachyonClient = TachyonFS.get(Utils.validatePath(path)); int fileId = tachyonClient.getFileId(file); List<ClientBlockInfo> blocks = tachyonClient.getFileBlocks(fileId); System.out.println(file + " with file id " + fileId + " have following blocks: "); for (ClientBlockInfo block : blocks) { System.out.println(block); } return 0; }
TFsShell { public int fileinfo(String argv[]) throws IOException { if (argv.length != 2) { System.out.println("Usage: tfs fileinfo <path>"); return -1; } String path = argv[1]; String file = Utils.getFilePath(path); TachyonFS tachyonClient = TachyonFS.get(Utils.validatePath(path)); int fileId = tachyonClient.getFileId(file); List<ClientBlockInfo> blocks = tachyonClient.getFileBlocks(fileId); System.out.println(file + " with file id " + fileId + " have following blocks: "); for (ClientBlockInfo block : blocks) { System.out.println(block); } return 0; } }
TFsShell { public int fileinfo(String argv[]) throws IOException { if (argv.length != 2) { System.out.println("Usage: tfs fileinfo <path>"); return -1; } String path = argv[1]; String file = Utils.getFilePath(path); TachyonFS tachyonClient = TachyonFS.get(Utils.validatePath(path)); int fileId = tachyonClient.getFileId(file); List<ClientBlockInfo> blocks = tachyonClient.getFileBlocks(fileId); System.out.println(file + " with file id " + fileId + " have following blocks: "); for (ClientBlockInfo block : blocks) { System.out.println(block); } return 0; }  }
TFsShell { public int fileinfo(String argv[]) throws IOException { if (argv.length != 2) { System.out.println("Usage: tfs fileinfo <path>"); return -1; } String path = argv[1]; String file = Utils.getFilePath(path); TachyonFS tachyonClient = TachyonFS.get(Utils.validatePath(path)); int fileId = tachyonClient.getFileId(file); List<ClientBlockInfo> blocks = tachyonClient.getFileBlocks(fileId); System.out.println(file + " with file id " + fileId + " have following blocks: "); for (ClientBlockInfo block : blocks) { System.out.println(block); } return 0; }  static void main(String argv[]); int cat(String argv[]); int copyFromLocal(String argv[]); int copyToLocal(String argv[]); int count(String argv[]); int fileinfo(String argv[]); int location(String argv[]); int ls(String argv[]); int lsr(String argv[]); int mkdir(String argv[]); int pin(String argv[]); int unpin(String argv[]); void printUsage(); int rename(String argv[]); int report(String argv[]); int request(String argv[]); int rm(String argv[]); int run(String argv[]); int tail(String argv[]); int touch(String argv[]); }
TFsShell { public int fileinfo(String argv[]) throws IOException { if (argv.length != 2) { System.out.println("Usage: tfs fileinfo <path>"); return -1; } String path = argv[1]; String file = Utils.getFilePath(path); TachyonFS tachyonClient = TachyonFS.get(Utils.validatePath(path)); int fileId = tachyonClient.getFileId(file); List<ClientBlockInfo> blocks = tachyonClient.getFileBlocks(fileId); System.out.println(file + " with file id " + fileId + " have following blocks: "); for (ClientBlockInfo block : blocks) { System.out.println(block); } return 0; }  static void main(String argv[]); int cat(String argv[]); int copyFromLocal(String argv[]); int copyToLocal(String argv[]); int count(String argv[]); int fileinfo(String argv[]); int location(String argv[]); int ls(String argv[]); int lsr(String argv[]); int mkdir(String argv[]); int pin(String argv[]); int unpin(String argv[]); void printUsage(); int rename(String argv[]); int report(String argv[]); int request(String argv[]); int rm(String argv[]); int run(String argv[]); int tail(String argv[]); int touch(String argv[]);  }