public class IoCTX
extends java.lang.Object
| Constructor and Description |
|---|
IoCTX(com.sun.jna.Pointer p)
Create a new IO Context object
This constructor should never be called, IO Context
objects are created by the RADOS class and returned
when creating a IO Context there
|
| Modifier and Type | Method and Description |
|---|---|
void |
append(java.lang.String oid,
byte[] buf)
Append data to an object
|
void |
append(java.lang.String oid,
byte[] buf,
int len) |
void |
append(java.lang.String oid,
java.lang.String buf)
Append data to an object
|
void |
clone(java.lang.String dst,
long dst_off,
java.lang.String src,
long src_off,
long len)
Efficiently copy a portion of one object to another
If the underlying filesystem on the OSD supports it, this will be a
copy-on-write clone.
|
long |
getAuid()
Get the associated auid owner of the current pool
|
long |
getId()
Get the pool ID of this context
|
com.sun.jna.Pointer |
getPointer()
Return the pointer to the IO Context
This method is used internally and by the RADOS class
to destroy a IO Context
|
java.lang.String |
getPoolName()
Get the pool name of the context
|
java.lang.String[] |
listObjects()
List all objects in a pool
|
void |
locatorSetKey(java.lang.String key)
Set the locator key
|
RadosPoolInfo |
poolStat()
Stat the currently open pool
|
int |
read(java.lang.String oid,
int length,
long offset,
byte[] buf)
Read data from an object
|
void |
remove(java.lang.String oid)
Remove an object
|
void |
setAuid(long auid)
Set the associated auid owner of the current pool
|
void |
snapCreate(java.lang.String snapname)
Create a snapshot
|
java.lang.String |
snapGetName(long id)
Get the name of a snapshot by it's ID
|
long |
snapGetStamp(long id)
Get the timestamp of a snapshot
|
java.lang.Long[] |
snapList()
List all snapshots
|
long |
snapLookup(java.lang.String snapname)
Get the ID of a snapshot
|
void |
snapRemove(java.lang.String snapname)
Remove a snapshot
|
RadosObjectInfo |
stat(java.lang.String oid)
Stat an object
|
void |
truncate(java.lang.String oid,
long size)
Resize an object
|
void |
write(java.lang.String oid,
byte[] buf)
Write to an object without an offset
|
void |
write(java.lang.String oid,
byte[] buf,
long offset)
Write to an object
|
void |
write(java.lang.String oid,
java.lang.String buf)
Write to an object without an offset
|
void |
write(java.lang.String oid,
java.lang.String buf,
long offset)
Write to an object without an offset
|
void |
writeFull(java.lang.String oid,
byte[] buf,
int len)
Write an entire object
The object is filled with the provided data.
|
public IoCTX(com.sun.jna.Pointer p)
public com.sun.jna.Pointer getPointer()
public long getId()
public void setAuid(long auid)
throws RadosException
auid - The new auidRadosExceptionpublic long getAuid()
throws RadosException
RadosExceptionpublic java.lang.String getPoolName()
throws RadosException
RadosExceptionpublic void locatorSetKey(java.lang.String key)
key - The new locator key or NULL to remove a previous onepublic java.lang.String[] listObjects()
throws RadosException
RadosExceptionpublic void write(java.lang.String oid,
byte[] buf,
long offset)
throws RadosException,
java.lang.IllegalArgumentException
oid - The object to write tobuf - The content to writeoffset - The offset when writingRadosExceptionjava.lang.IllegalArgumentExceptionpublic void write(java.lang.String oid,
byte[] buf)
throws RadosException
oid - The object to write tobuf - The content to writeRadosExceptionpublic void writeFull(java.lang.String oid,
byte[] buf,
int len)
throws RadosException
oid - The object to write tobuf - The content to writelen - The length of the data to writeRadosExceptionpublic void write(java.lang.String oid,
java.lang.String buf,
long offset)
throws RadosException
oid - The object to write tobuf - The content to writeoffset - The offset when writingRadosExceptionpublic void write(java.lang.String oid,
java.lang.String buf)
throws RadosException
oid - The object to write tobuf - The content to writeRadosExceptionpublic void remove(java.lang.String oid)
throws RadosException
oid - The object to removeRadosExceptionpublic int read(java.lang.String oid,
int length,
long offset,
byte[] buf)
throws java.lang.IllegalArgumentException
oid - The object's namelength - Amount of bytes to readoffset - The offset where to start readingbuf - The buffer to store the resultjava.lang.IllegalArgumentExceptionpublic void truncate(java.lang.String oid,
long size)
throws RadosException,
java.lang.IllegalArgumentException
oid - The object to resizesize - The new length of the object. If this enlarges the object,
the new area is logically filled with
zeroes. If this shrinks the object, the excess data is removed.RadosExceptionjava.lang.IllegalArgumentExceptionpublic void append(java.lang.String oid,
byte[] buf)
throws RadosException
oid - The name to append tobuf - The data to appendRadosExceptionpublic void append(java.lang.String oid,
byte[] buf,
int len)
throws RadosException
oid - The name to append tobuf - The data to appendlen - The number of bytes to write from bufRadosExceptionpublic void append(java.lang.String oid,
java.lang.String buf)
throws RadosException
oid - The name to append tobuf - The data to appendRadosExceptionpublic void clone(java.lang.String dst,
long dst_off,
java.lang.String src,
long src_off,
long len)
throws RadosException
dst - The destination objectdst_off - The offset at the destination objectsrc - The source objectsrc_off - The offset at the source objectlen - The amount of bytes to copyRadosExceptionpublic RadosObjectInfo stat(java.lang.String oid) throws RadosException
oid - The name of the objectRadosExceptionpublic RadosPoolInfo poolStat() throws RadosException
RadosExceptionpublic void snapCreate(java.lang.String snapname)
throws RadosException
snapname - The name of the snapshotRadosExceptionpublic void snapRemove(java.lang.String snapname)
throws RadosException
snapname - The name of the snapshotRadosExceptionpublic long snapLookup(java.lang.String snapname)
throws RadosException
snapname - The name of the snapshotRadosExceptionpublic java.lang.String snapGetName(long id)
throws RadosException
id - The ID of the snapshotRadosExceptionpublic long snapGetStamp(long id)
throws RadosException
id - The ID of the snapshotRadosExceptionpublic java.lang.Long[] snapList()
throws RadosException
RadosException