/** * Convenience method for {@link #free(TachyonFile, FreeOptions)} with default options. */ public void free(TachyonFile file) throws IOException, TachyonException, FileDoesNotExistException { free(file, FreeOptions.defaults()); }
/** * Free the given file or folder from tachyon in-memory (recursively freeing all children if a * folder) * * @param path The TachyonURI path as the input of the command * @return 0 if command if successful, -1 if an error occurred */ public int free(TachyonURI path) throws IOException { try { FreeOptions options = new FreeOptions.Builder(mTachyonConf).setRecursive(true).build(); TachyonFile fd = mTfs.open(path); mTfs.free(fd, options); System.out.println(path + " was successfully freed from memory."); return 0; } catch (TachyonException e) { return -1; } }