<dependency>
<groupId>com.github.agfsapi4j</groupId>
<artifactId>agfsapi4j</artifactId>
<version>1.0.1</version>
</dependency>
The original plan was the creation of a pure Java GlusterFS client lib. But this idea was discarded because of GlusterFS use of translators written in C that must be rewritten in Java too.
So AGFsApi4J is - beside of the original java binding -
another GlusterFS java binding that depends on the native libgfapi, but uses jna
for native access instead of jni.
Currently the features implemented are far from complete, but messages in case of errors are far, far better.
Feature | AGFsApi4J | glusterfs-java-filesystem |
---|---|---|
Depends on libgfapi | yes | yes |
Native access | jna | jni |
Java Filesystem integration | no | yes |
Log Messages from libgfapi | yes | no |
Feature | Status |
---|---|
Connect | yes |
Create file | yes |
Read file | yes |
Write file | yes |
Delete file | yes |
Rename file | yes |
Create directory | yes |
Rename directory | yes |
Remove directory | yes |
List directory files | basic |
Get file stats | basic |
Get directory stats | basic |
Get cluster status | no |
Java filesytem integration | no |
... | no |
GlusterFsApi gfApi4J = GlusterFsApi.newInstance();
try (GlusterFsSession session = gfApi4J.connect("host", GlusterFsApi.DEFAULT_PORT, "vol0");)
{
GlusterFsFile file = session.openFile(testFilePath, GlusterFsApi.O_RDONLY);
byte[] buf = new byte[4096];
int count = file.read(buf);
file.close();
}
This is an open source project, and contributions are welcome! Feel free to raise an issue or submit a pull request.