/** * Reads the contents of a directory. * * @param path The FS path of the directory * @param buff The FUSE buffer to fill * @param filter FUSE filter * @param offset Ignored in alluxio-fuse * @param fi FileInfo data structure kept by FUSE * @return 0 on success, a negative value on error */ @Override public int readdir(String path, Pointer buff, FuseFillDir filter, @off_t long offset, FuseFileInfo fi) { final AlluxioURI turi = mPathResolverCache.getUnchecked(path); LOG.trace("readdir({}) [Alluxio: {}]", path, turi); try { final List<URIStatus> ls = mFileSystem.listStatus(turi); // standard . and .. entries filter.apply(buff, ".", null, 0); filter.apply(buff, "..", null, 0); for (final URIStatus file : ls) { filter.apply(buff, file.getName(), null, 0); } } catch (Throwable t) { LOG.error("Failed to read directory {}", path, t); return AlluxioFuseUtils.getErrorCode(t); } return 0; }
public int write(String path, Pointer buf, @size_t long size, @off_t long offset, FuseFileInfo fi) { if (size > Integer.MAX_VALUE) {
public int read(String path, Pointer buf, @size_t long size, @off_t long offset, FuseFileInfo fi) {
/** * Allocates space for an open file * <p> * This function ensures that required space is allocated for specified * file. If this function returns success then any subsequent write * request to specified range is guaranteed not to fail because of lack * of space on the file system media. */ int fallocate(String path, int mode, @off_t long off, @off_t long length, FuseFileInfo fi); }
/** * Allocates space for an open file * <p> * This function ensures that required space is allocated for specified * file. If this function returns success then any subsequent write * request to specified range is guaranteed not to fail because of lack * of space on the file system media. */ int fallocate(String path, int mode, @off_t long off, @off_t long length, FuseFileInfo fi); }
/** * Change the size of an open file * <p> * This method is called instead of the truncate() method if the * truncation was invoked from an ftruncate() system call. * <p> * If this method is not implemented or under Linux kernel * versions earlier than 2.6.15, the truncate() method will be * called instead. */ int ftruncate(String path, @off_t long size, FuseFileInfo fi);
/** * Change the size of an open file * <p> * This method is called instead of the truncate() method if the * truncation was invoked from an ftruncate() system call. * <p> * If this method is not implemented or under Linux kernel * versions earlier than 2.6.15, the truncate() method will be * called instead. */ int ftruncate(String path, @off_t long size, FuseFileInfo fi);
/** * Write contents of buffer to an open file * <p> * Similar to the write() method, but data is supplied in a * generic buffer. Use fuse_buf_copy() to transfer data to * the destination. * <p> * IMPORTANT: * Is not enabled by default, for enabling use * ru.serce.jnrfuse.AbstractFuseFS#isBufOperationsImplemented() */ int write_buf(String path, FuseBufvec buf, @off_t long off, FuseFileInfo fi);
/** * Write contents of buffer to an open file * <p> * Similar to the write() method, but data is supplied in a * generic buffer. Use fuse_buf_copy() to transfer data to * the destination. * <p> * IMPORTANT: * Is not enabled by default, for enabling use * ru.serce.jnrfuse.AbstractFuseFS#isBufOperationsImplemented() */ int write_buf(String path, FuseBufvec buf, @off_t long off, FuseFileInfo fi);
/** * Change the size of a file */ int truncate(String path, @off_t long size);
/** * Change the size of a file */ int truncate(String path, @off_t long size);
@Override @NotImplemented public int readdir(String path, Pointer buf, FuseFillDir filter, @off_t long offset, FuseFileInfo fi) { return 0; }
/** * Write data to an open file * <p> * Write should return exactly the number of bytes requested * except on error. An exception to this is when the 'direct_io' * mount option is specified (see read operation). */ int write(String path, Pointer buf, @size_t long size, @off_t long offset, FuseFileInfo fi);
@Override @NotImplemented public int truncate(String path, @off_t long size) { return 0; }
@Override @NotImplemented public int readdir(String path, Pointer buf, FuseFillDir filter, @off_t long offset, FuseFileInfo fi) { return 0; }
/** * Read data from an open file * <p> * Read should return exactly the number of bytes requested except * on EOF or error, otherwise the rest of the data will be * substituted with zeroes. An exception to this is when the * 'direct_io' mount option is specified, in which case the return * value of the read system call will reflect the return value of * this operation. */ int read(String path, Pointer buf, @size_t long size, @off_t long offset, FuseFileInfo fi);
/** * Write data to an open file * <p> * Write should return exactly the number of bytes requested * except on error. An exception to this is when the 'direct_io' * mount option is specified (see read operation). */ int write(String path, Pointer buf, @size_t long size, @off_t long offset, FuseFileInfo fi);