@Test(expected = IOException.class) public void getTestAbnormal2() throws IOException { String host = mLocalTachyonCluster.getMasterHostname(); int port = mLocalTachyonCluster.getMasterPort(); TachyonFS.get("/" + host + port); }
public static synchronized TachyonFS get(String tachyonPath) throws IOException { boolean zookeeperMode = false; String tempAddress = tachyonPath; if (tachyonPath.startsWith(Constants.HEADER)) { tempAddress = tachyonPath.substring(Constants.HEADER.length()); } else if (tachyonPath.startsWith(Constants.HEADER_FT)) { zookeeperMode = true; tempAddress = tachyonPath.substring(Constants.HEADER_FT.length()); } else { throw new IOException("Invalid Path: " + tachyonPath + ". Use " + Constants.HEADER + "host:port/ ," + Constants.HEADER_FT + "host:port/"); } String masterAddress = tempAddress; if (tempAddress.contains(Constants.PATH_SEPARATOR)) { masterAddress = tempAddress.substring(0, tempAddress.indexOf(Constants.PATH_SEPARATOR)); } if (masterAddress.split(":").length != 2) { CommonUtils.illegalArgumentException("Illegal Tachyon Master Address: " + tachyonPath); } String masterHost = masterAddress.split(":")[0]; int masterPort = Integer.parseInt(masterAddress.split(":")[1]); return new TachyonFS(new InetSocketAddress(masterHost, masterPort), zookeeperMode); }
TachyonFS { public static synchronized TachyonFS get(String tachyonPath) throws IOException { boolean zookeeperMode = false; String tempAddress = tachyonPath; if (tachyonPath.startsWith(Constants.HEADER)) { tempAddress = tachyonPath.substring(Constants.HEADER.length()); } else if (tachyonPath.startsWith(Constants.HEADER_FT)) { zookeeperMode = true; tempAddress = tachyonPath.substring(Constants.HEADER_FT.length()); } else { throw new IOException("Invalid Path: " + tachyonPath + ". Use " + Constants.HEADER + "host:port/ ," + Constants.HEADER_FT + "host:port/"); } String masterAddress = tempAddress; if (tempAddress.contains(Constants.PATH_SEPARATOR)) { masterAddress = tempAddress.substring(0, tempAddress.indexOf(Constants.PATH_SEPARATOR)); } if (masterAddress.split(":").length != 2) { CommonUtils.illegalArgumentException("Illegal Tachyon Master Address: " + tachyonPath); } String masterHost = masterAddress.split(":")[0]; int masterPort = Integer.parseInt(masterAddress.split(":")[1]); return new TachyonFS(new InetSocketAddress(masterHost, masterPort), zookeeperMode); } }
TachyonFS { public static synchronized TachyonFS get(String tachyonPath) throws IOException { boolean zookeeperMode = false; String tempAddress = tachyonPath; if (tachyonPath.startsWith(Constants.HEADER)) { tempAddress = tachyonPath.substring(Constants.HEADER.length()); } else if (tachyonPath.startsWith(Constants.HEADER_FT)) { zookeeperMode = true; tempAddress = tachyonPath.substring(Constants.HEADER_FT.length()); } else { throw new IOException("Invalid Path: " + tachyonPath + ". Use " + Constants.HEADER + "host:port/ ," + Constants.HEADER_FT + "host:port/"); } String masterAddress = tempAddress; if (tempAddress.contains(Constants.PATH_SEPARATOR)) { masterAddress = tempAddress.substring(0, tempAddress.indexOf(Constants.PATH_SEPARATOR)); } if (masterAddress.split(":").length != 2) { CommonUtils.illegalArgumentException("Illegal Tachyon Master Address: " + tachyonPath); } String masterHost = masterAddress.split(":")[0]; int masterPort = Integer.parseInt(masterAddress.split(":")[1]); return new TachyonFS(new InetSocketAddress(masterHost, masterPort), zookeeperMode); } private  TachyonFS(InetSocketAddress masterAddress, boolean zookeeperMode); }
TachyonFS { public static synchronized TachyonFS get(String tachyonPath) throws IOException { boolean zookeeperMode = false; String tempAddress = tachyonPath; if (tachyonPath.startsWith(Constants.HEADER)) { tempAddress = tachyonPath.substring(Constants.HEADER.length()); } else if (tachyonPath.startsWith(Constants.HEADER_FT)) { zookeeperMode = true; tempAddress = tachyonPath.substring(Constants.HEADER_FT.length()); } else { throw new IOException("Invalid Path: " + tachyonPath + ". Use " + Constants.HEADER + "host:port/ ," + Constants.HEADER_FT + "host:port/"); } String masterAddress = tempAddress; if (tempAddress.contains(Constants.PATH_SEPARATOR)) { masterAddress = tempAddress.substring(0, tempAddress.indexOf(Constants.PATH_SEPARATOR)); } if (masterAddress.split(":").length != 2) { CommonUtils.illegalArgumentException("Illegal Tachyon Master Address: " + tachyonPath); } String masterHost = masterAddress.split(":")[0]; int masterPort = Integer.parseInt(masterAddress.split(":")[1]); return new TachyonFS(new InetSocketAddress(masterHost, masterPort), zookeeperMode); } private  TachyonFS(InetSocketAddress masterAddress, boolean zookeeperMode); static synchronized TachyonFS get(String tachyonPath); synchronized void cacheBlock(long blockId); synchronized void close(); synchronized int createDependency(List<String> parents, List<String> children,
      String commandPrefix, List<ByteBuffer> data, String comment, String framework,
      String frameworkVersion, int dependencyType, long childrenBlockSizeByte); synchronized int createFile(String path); synchronized int createFile(String path, long blockSizeByte); synchronized int createFile(String path, String underfsPath); synchronized int createRawTable(String path, int columns); synchronized int createRawTable(String path, int columns, ByteBuffer metadata); synchronized boolean delete(int fid, boolean recursive); synchronized boolean delete(String path, boolean recursive); synchronized boolean exist(String path); synchronized long getBlockId(int fId, int blockIndex); int getBlockLockId(); synchronized long getBlockSizeByte(int fId); synchronized ClientBlockInfo getClientBlockInfo(int fId, int blockIndex); synchronized ClientDependencyInfo getClientDependencyInfo(int did); synchronized long getCreationTimeMs(int fId); synchronized TachyonFile getFile(int fid); synchronized TachyonFile getFile(int fid, boolean useCachedMetadata); synchronized TachyonFile getFile(String path); synchronized TachyonFile getFile(String path, boolean useCachedMetadata); synchronized List<Long> getFileBlockIdList(int fId); synchronized List<ClientBlockInfo> getFileBlocks(int fid); synchronized List<String> getFileHosts(int fileId); synchronized int getFileId(String path); synchronized List<NetAddress> getFileNetAddresses(int fileId); synchronized List<List<String>> getFilesHosts(List<Integer> fileIds); synchronized List<List<NetAddress>> getFilesNetAddresses(List<Integer> fileIds); synchronized int getNumberOfFiles(String path); synchronized RawTable getRawTable(int id); synchronized RawTable getRawTable(String path); synchronized String getUnderfsAddress(); synchronized List<ClientWorkerInfo> getWorkersInfo(); synchronized boolean hasLocalWorker(); synchronized boolean isConnected(); synchronized List<Integer> listFiles(String path, boolean recursive); synchronized List<ClientFileInfo> listStatus(String path); synchronized List<String> ls(String path, boolean recursive); synchronized boolean mkdir(String path); synchronized void outOfMemoryForPinFile(int fid); synchronized void releaseSpace(long releaseSpaceBytes); synchronized boolean rename(int fId, String path); synchronized boolean rename(String srcPath, String dstPath); synchronized void reportLostFile(int fileId); synchronized void requestFilesInDependency(int depId); synchronized boolean requestSpace(long requestSpaceBytes); @Override String toString(); synchronized void setPinned(int fid, boolean pinned); synchronized void pinFile(int fid); synchronized void unpinFile(int fid); synchronized boolean isPinned(int fid, boolean useCachedMetadata); synchronized void updateRawTableMetadata(int id, ByteBuffer metadata); }
TachyonFS { public static synchronized TachyonFS get(String tachyonPath) throws IOException { boolean zookeeperMode = false; String tempAddress = tachyonPath; if (tachyonPath.startsWith(Constants.HEADER)) { tempAddress = tachyonPath.substring(Constants.HEADER.length()); } else if (tachyonPath.startsWith(Constants.HEADER_FT)) { zookeeperMode = true; tempAddress = tachyonPath.substring(Constants.HEADER_FT.length()); } else { throw new IOException("Invalid Path: " + tachyonPath + ". Use " + Constants.HEADER + "host:port/ ," + Constants.HEADER_FT + "host:port/"); } String masterAddress = tempAddress; if (tempAddress.contains(Constants.PATH_SEPARATOR)) { masterAddress = tempAddress.substring(0, tempAddress.indexOf(Constants.PATH_SEPARATOR)); } if (masterAddress.split(":").length != 2) { CommonUtils.illegalArgumentException("Illegal Tachyon Master Address: " + tachyonPath); } String masterHost = masterAddress.split(":")[0]; int masterPort = Integer.parseInt(masterAddress.split(":")[1]); return new TachyonFS(new InetSocketAddress(masterHost, masterPort), zookeeperMode); } private  TachyonFS(InetSocketAddress masterAddress, boolean zookeeperMode); static synchronized TachyonFS get(String tachyonPath); synchronized void cacheBlock(long blockId); synchronized void close(); synchronized int createDependency(List<String> parents, List<String> children,
      String commandPrefix, List<ByteBuffer> data, String comment, String framework,
      String frameworkVersion, int dependencyType, long childrenBlockSizeByte); synchronized int createFile(String path); synchronized int createFile(String path, long blockSizeByte); synchronized int createFile(String path, String underfsPath); synchronized int createRawTable(String path, int columns); synchronized int createRawTable(String path, int columns, ByteBuffer metadata); synchronized boolean delete(int fid, boolean recursive); synchronized boolean delete(String path, boolean recursive); synchronized boolean exist(String path); synchronized long getBlockId(int fId, int blockIndex); int getBlockLockId(); synchronized long getBlockSizeByte(int fId); synchronized ClientBlockInfo getClientBlockInfo(int fId, int blockIndex); synchronized ClientDependencyInfo getClientDependencyInfo(int did); synchronized long getCreationTimeMs(int fId); synchronized TachyonFile getFile(int fid); synchronized TachyonFile getFile(int fid, boolean useCachedMetadata); synchronized TachyonFile getFile(String path); synchronized TachyonFile getFile(String path, boolean useCachedMetadata); synchronized List<Long> getFileBlockIdList(int fId); synchronized List<ClientBlockInfo> getFileBlocks(int fid); synchronized List<String> getFileHosts(int fileId); synchronized int getFileId(String path); synchronized List<NetAddress> getFileNetAddresses(int fileId); synchronized List<List<String>> getFilesHosts(List<Integer> fileIds); synchronized List<List<NetAddress>> getFilesNetAddresses(List<Integer> fileIds); synchronized int getNumberOfFiles(String path); synchronized RawTable getRawTable(int id); synchronized RawTable getRawTable(String path); synchronized String getUnderfsAddress(); synchronized List<ClientWorkerInfo> getWorkersInfo(); synchronized boolean hasLocalWorker(); synchronized boolean isConnected(); synchronized List<Integer> listFiles(String path, boolean recursive); synchronized List<ClientFileInfo> listStatus(String path); synchronized List<String> ls(String path, boolean recursive); synchronized boolean mkdir(String path); synchronized void outOfMemoryForPinFile(int fid); synchronized void releaseSpace(long releaseSpaceBytes); synchronized boolean rename(int fId, String path); synchronized boolean rename(String srcPath, String dstPath); synchronized void reportLostFile(int fileId); synchronized void requestFilesInDependency(int depId); synchronized boolean requestSpace(long requestSpaceBytes); @Override String toString(); synchronized void setPinned(int fid, boolean pinned); synchronized void pinFile(int fid); synchronized void unpinFile(int fid); synchronized boolean isPinned(int fid, boolean useCachedMetadata); synchronized void updateRawTableMetadata(int id, ByteBuffer metadata);  }