public class IoCTX extends RadosBase
| 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(String oid,
byte[] buf)
Append data to an object
|
void |
append(String oid,
byte[] buf,
int len) |
void |
append(String oid,
String buf)
Append data to an object
|
void |
clone(String dst,
long dst_off,
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
|
String |
getExtentedAttribute(String oid,
String xattrName)
Get the value of an extended attribute on an object.
|
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
|
String |
getPoolName()
Get the pool name of the context
|
String[] |
listObjects()
List all objects in a pool
|
ListCtx |
listObjectsPartial(int limit)
List all objects in a pool by piece.
|
void |
locatorSetKey(String key)
Set the locator key
|
RadosPoolInfo |
poolStat()
Stat the currently open pool
|
int |
read(String oid,
int length,
long offset,
byte[] buf)
Read data from an object
|
ReadOp |
readOpCreate() |
void |
readOpRelease(ReadOp read_op) |
void |
remove(String oid)
Remove an object
|
void |
removeExtentedAttribute(String oid,
String xattrName)
Delete an extended attribute from an object.
|
void |
setAuid(long auid)
Set the associated auid owner of the current pool
|
void |
setExtentedAttribute(String oid,
String xattrName,
String val)
Set an extended attribute on an object.
|
void |
snapCreate(String snapname)
Create a snapshot
|
String |
snapGetName(long id)
Get the name of a snapshot by it's ID
|
long |
snapGetStamp(long id)
Get the timestamp of a snapshot
|
Long[] |
snapList()
List all snapshots
|
long |
snapLookup(String snapname)
Get the ID of a snapshot
|
void |
snapRemove(String snapname)
Remove a snapshot
|
RadosObjectInfo |
stat(String oid)
Stat an object
|
void |
truncate(String oid,
long size)
Resize an object
|
void |
write(String oid,
byte[] buf)
Write to an object without an offset
|
void |
write(String oid,
byte[] buf,
long offset)
Write to an object
|
void |
write(String oid,
String buf)
Write to an object without an offset
|
void |
write(String oid,
String buf,
long offset)
Write to an object without an offset
|
void |
writeFull(String oid,
byte[] buf,
int len)
Write an entire object
The object is filled with the provided data.
|
handleReturnCodepublic 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 String getPoolName() throws RadosException
RadosExceptionpublic void locatorSetKey(String key)
key - The new locator key or NULL to remove a previous onepublic String[] listObjects() throws RadosException
RadosExceptionpublic ListCtx listObjectsPartial(int limit) throws RadosException
limit - RadosExceptionpublic void write(String oid, byte[] buf, long offset) throws RadosException, IllegalArgumentException
oid - The object to write tobuf - The content to writeoffset - The offset when writingRadosExceptionIllegalArgumentExceptionpublic void write(String oid, byte[] buf) throws RadosException
oid - The object to write tobuf - The content to writeRadosExceptionpublic void writeFull(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(String oid, String buf, long offset) throws RadosException
oid - The object to write tobuf - The content to writeoffset - The offset when writingRadosExceptionpublic void write(String oid, String buf) throws RadosException
oid - The object to write tobuf - The content to writeRadosExceptionpublic void remove(String oid) throws RadosException
oid - The object to removeRadosExceptionpublic int read(String oid, int length, long offset, byte[] buf) throws RadosException
oid - The object's namelength - Amount of bytes to readoffset - The offset where to start readingbuf - The buffer to store the resultRadosExceptionpublic void truncate(String oid, long size) throws RadosException
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.RadosExceptionpublic void append(String oid, byte[] buf) throws RadosException
oid - The name to append tobuf - The data to appendRadosExceptionpublic void append(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(String oid, String buf) throws RadosException
oid - The name to append tobuf - The data to appendRadosExceptionpublic void clone(String dst, long dst_off, 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(String oid) throws RadosException
oid - The name of the objectRadosExceptionpublic RadosPoolInfo poolStat() throws RadosException
RadosExceptionpublic void snapCreate(String snapname) throws RadosException
snapname - The name of the snapshotRadosExceptionpublic void snapRemove(String snapname) throws RadosException
snapname - The name of the snapshotRadosExceptionpublic long snapLookup(String snapname) throws RadosException
snapname - The name of the snapshotRadosExceptionpublic String snapGetName(long id) throws RadosException
id - The ID of the snapshotRadosExceptionpublic long snapGetStamp(long id)
throws RadosException
id - The ID of the snapshotRadosExceptionpublic Long[] snapList() throws RadosException
RadosExceptionpublic ReadOp readOpCreate()
public void readOpRelease(ReadOp read_op)
public String getExtentedAttribute(String oid, String xattrName) throws RadosException
oid - The name of the objectxattrName - The name of the extended attributeRadosException - on failure -- common error codes:
-34 (ERANGE) : value exceeds buffer
-61 (ENODATA) : no such attributepublic void setExtentedAttribute(String oid, String xattrName, String val) throws IllegalArgumentException, RadosException
oid - The name of the objectxattrName - The name of the extended attributeval - The value of the extended attributeIllegalArgumentException - attribute value is too longRadosException - on failurepublic void removeExtentedAttribute(String oid, String xattrName) throws RadosException
oid - The name of the objectxattrName - The name of the extended attributeRadosException - on failureCopyright © 2015. All rights reserved.