@ThreadSafe public final class AlluxioJnrFuseFileSystem extends ru.serce.jnrfuse.FuseStubFS implements FuseUmountable
Modifier and Type | Field and Description |
---|---|
static long |
ID_NOT_SET_VALUE
4294967295 is unsigned long -1, -1 means that uid or gid is not set.
|
static long |
ID_NOT_SET_VALUE_UNSIGNED |
static int |
MAX_NAME_LENGTH
Most FileSystems on linux limit the length of file name beyond 255 characters.
|
static int |
UNKNOWN_INODES
df command will treat -1 as an unknown value.
|
Constructor and Description |
---|
AlluxioJnrFuseFileSystem(FileSystem fs,
AlluxioConfiguration conf,
FuseOptions fuseOptions)
Creates a new instance of
AlluxioJnrFuseFileSystem . |
Modifier and Type | Method and Description |
---|---|
int |
chmod(String path,
long mode)
Changes the mode of an Alluxio file.
|
int |
chown(String path,
long uid,
long gid)
Changes the user and group ownership of an Alluxio file.
|
int |
create(String path,
long mode,
ru.serce.jnrfuse.struct.FuseFileInfo fi)
Creates and opens a new file.
|
int |
flush(String path,
ru.serce.jnrfuse.struct.FuseFileInfo fi)
Flushes cached data on Alluxio.
|
int |
getattr(String path,
ru.serce.jnrfuse.struct.FileStat stat)
Retrieves file attributes.
|
String |
getFSName() |
int |
mkdir(String path,
long mode)
Creates a new dir.
|
void |
mount(Path mountPoint,
boolean blocking,
boolean debug,
String[] fuseOpts) |
int |
open(String path,
ru.serce.jnrfuse.struct.FuseFileInfo fi)
Opens an existing file for reading.
|
int |
read(String path,
jnr.ffi.Pointer buf,
long size,
long offset,
ru.serce.jnrfuse.struct.FuseFileInfo fi)
Reads data from an open file.
|
int |
readdir(String path,
jnr.ffi.Pointer buff,
ru.serce.jnrfuse.FuseFillDir filter,
long offset,
ru.serce.jnrfuse.struct.FuseFileInfo fi)
Reads the contents of a directory.
|
int |
release(String path,
ru.serce.jnrfuse.struct.FuseFileInfo fi)
Releases the resources associated to an open file.
|
int |
rename(String oldPath,
String newPath)
Renames a path.
|
int |
rmdir(String path)
Deletes an empty directory.
|
int |
statfs(String path,
ru.serce.jnrfuse.struct.Statvfs stbuf)
Gets the filesystem statistics.
|
int |
truncate(String path,
long size)
Changes the size of a file.
|
void |
umount(boolean force)
Unmounts the Fuse application.
|
int |
unlink(String path)
Deletes a file from the FS.
|
int |
utimens(String path,
ru.serce.jnrfuse.struct.Timespec[] timespec)
Alluxio does not have access time, and the file is created only once.
|
int |
write(String path,
jnr.ffi.Pointer buf,
long size,
long offset,
ru.serce.jnrfuse.struct.FuseFileInfo fi)
Writes a buffer to an open Alluxio file.
|
access, bmap, destroy, fallocate, fgetattr, flock, fsync, fsyncdir, ftruncate, getxattr, init, ioctl, link, listxattr, lock, mknod, opendir, poll, read_buf, readlink, releasedir, removexattr, setxattr, symlink, write_buf
public static final int UNKNOWN_INODES
public static final int MAX_NAME_LENGTH
public static final long ID_NOT_SET_VALUE
public static final long ID_NOT_SET_VALUE_UNSIGNED
public AlluxioJnrFuseFileSystem(FileSystem fs, AlluxioConfiguration conf, FuseOptions fuseOptions)
AlluxioJnrFuseFileSystem
.fs
- Alluxio file systemconf
- the Alluxio configuration containing Fuse optionsfuseOptions
- the FUSE optionspublic int chmod(String path, long mode)
chmod
in interface ru.serce.jnrfuse.FuseFS
chmod
in class ru.serce.jnrfuse.FuseStubFS
path
- the path of the filemode
- the mode to change topublic int chown(String path, long uid, long gid)
chown
in interface ru.serce.jnrfuse.FuseFS
chown
in class ru.serce.jnrfuse.FuseStubFS
path
- the path of the fileuid
- the uid to change togid
- the gid to change topublic int create(String path, long mode, ru.serce.jnrfuse.struct.FuseFileInfo fi)
create
in interface ru.serce.jnrfuse.FuseFS
create
in class ru.serce.jnrfuse.FuseStubFS
path
- The FS path of the file to openmode
- mode flagsfi
- FileInfo data struct kept by FUSEpublic int flush(String path, ru.serce.jnrfuse.struct.FuseFileInfo fi)
flush
in interface ru.serce.jnrfuse.FuseFS
flush
in class ru.serce.jnrfuse.FuseStubFS
path
- The path on the FS of the file to closefi
- FileInfo data struct kept by FUSEpublic int getattr(String path, ru.serce.jnrfuse.struct.FileStat stat)
getattr
in interface ru.serce.jnrfuse.FuseFS
getattr
in class ru.serce.jnrfuse.FuseStubFS
path
- The path on the FS of the filestat
- FUSE data structure to fill with file attrspublic String getFSName()
getFSName
in class ru.serce.jnrfuse.AbstractFuseFS
public int mkdir(String path, long mode)
mkdir
in interface ru.serce.jnrfuse.FuseFS
mkdir
in class ru.serce.jnrfuse.FuseStubFS
path
- the path on the FS of the new dirmode
- Dir creation flags (IGNORED)public int open(String path, ru.serce.jnrfuse.struct.FuseFileInfo fi)
open
in interface ru.serce.jnrfuse.FuseFS
open
in class ru.serce.jnrfuse.FuseStubFS
path
- the FS path of the file to openfi
- FileInfo data structure kept by FUSEpublic int read(String path, jnr.ffi.Pointer buf, long size, long offset, ru.serce.jnrfuse.struct.FuseFileInfo fi)
read
in interface ru.serce.jnrfuse.FuseFS
read
in class ru.serce.jnrfuse.FuseStubFS
path
- the FS path of the file to readbuf
- FUSE buffer to fill with data readsize
- how many bytes to read. The maximum value that is accepted
on this method is Integer.MAX_VALUE
(note that current
FUSE implementation will call this method with a size of
at most 128K).offset
- offset of the read operationfi
- FileInfo data structure kept by FUSEpublic int readdir(String path, jnr.ffi.Pointer buff, ru.serce.jnrfuse.FuseFillDir filter, long offset, ru.serce.jnrfuse.struct.FuseFileInfo fi)
readdir
in interface ru.serce.jnrfuse.FuseFS
readdir
in class ru.serce.jnrfuse.FuseStubFS
path
- The FS path of the directorybuff
- The FUSE buffer to fillfilter
- FUSE filteroffset
- Ignored in alluxio-fusefi
- FileInfo data structure kept by FUSEpublic int release(String path, ru.serce.jnrfuse.struct.FuseFileInfo fi)
release
in interface ru.serce.jnrfuse.FuseFS
release
in class ru.serce.jnrfuse.FuseStubFS
path
- the FS path of the file to releasefi
- FileInfo data structure kept by FUSEpublic int rename(String oldPath, String newPath)
rename
in interface ru.serce.jnrfuse.FuseFS
rename
in class ru.serce.jnrfuse.FuseStubFS
oldPath
- the source path in the FSnewPath
- the destination path in the FSpublic int rmdir(String path)
rmdir
in interface ru.serce.jnrfuse.FuseFS
rmdir
in class ru.serce.jnrfuse.FuseStubFS
path
- The FS path of the directorypublic int statfs(String path, ru.serce.jnrfuse.struct.Statvfs stbuf)
statfs
in interface ru.serce.jnrfuse.FuseFS
statfs
in class ru.serce.jnrfuse.FuseStubFS
path
- The FS path of the directorystbuf
- Statistics of a filesystempublic int truncate(String path, long size)
truncate
in interface ru.serce.jnrfuse.FuseFS
truncate
in class ru.serce.jnrfuse.FuseStubFS
public int unlink(String path)
unlink
in interface ru.serce.jnrfuse.FuseFS
unlink
in class ru.serce.jnrfuse.FuseStubFS
path
- the FS path of the filepublic int utimens(String path, ru.serce.jnrfuse.struct.Timespec[] timespec)
utimens
in interface ru.serce.jnrfuse.FuseFS
utimens
in class ru.serce.jnrfuse.FuseStubFS
public int write(String path, jnr.ffi.Pointer buf, long size, long offset, ru.serce.jnrfuse.struct.FuseFileInfo fi)
write
in interface ru.serce.jnrfuse.FuseFS
write
in class ru.serce.jnrfuse.FuseStubFS
buf
- The buffer with source datasize
- How much data to write from the buffer. The maximum accepted size for writes is
Integer.MAX_VALUE
. Note that current FUSE implementation will anyway call write
with at most 128K writesoffset
- The offset where to write in the file (IGNORED)fi
- FileInfo data structure kept by FUSEpublic void mount(Path mountPoint, boolean blocking, boolean debug, String[] fuseOpts)
mount
in interface ru.serce.jnrfuse.Mountable
mount
in class ru.serce.jnrfuse.AbstractFuseFS
public void umount(boolean force)
FuseUmountable
umount
in interface FuseUmountable
force
- true to throw an exception and treat umount as a no-op
when umount timeouts due to the fuse device is busy.Copyright © 2023. All Rights Reserved.