public class RbdImage extends Object
| Constructor and Description |
|---|
RbdImage(com.sun.jna.Pointer image,
String name) |
| Modifier and Type | Method and Description |
|---|---|
void |
flatten() |
String |
getName()
Returns the name of the image
|
com.sun.jna.Pointer |
getPointer()
Return the pointer to the RBD image
This method is used internally and by the RBD class
to close a RBD image
|
boolean |
isOldFormat()
Find out if the format of the RBD image is the old format
or not
|
List<String> |
listChildren(String snapname)
List children of a snapshot
|
int |
read(long offset,
byte[] buffer,
int length)
Read from an RBD image
|
void |
resize(long size)
Resize an RBD image
|
void |
snapCreate(String snapName)
Create a RBD snapshot
|
boolean |
snapIsProtected(String snapName)
Tells if a snapshot is protected or not
|
List<RbdSnapInfo> |
snapList()
List all snapshots
|
List<RbdSnapInfo> |
snapList(int initialBufferSize)
List all snapshots
|
void |
snapProtect(String snapName)
Protect a snapshot
|
void |
snapRemove(String snapName)
Remove a RBD snapshot
|
void |
snapUnprotect(String snapName)
Unprotect a RBD snapshot
|
RbdImageInfo |
stat()
Get information about a RBD image
|
void |
write(byte[] data)
Write data to an RBD image
|
void |
write(byte[] data,
long offset)
Write data to an RBD image
|
void |
write(byte[] data,
long offset,
int length)
Write data to an RBD image
|
public RbdImage(com.sun.jna.Pointer image,
String name)
public String getName()
public com.sun.jna.Pointer getPointer()
public RbdImageInfo stat() throws RbdException
RbdExceptionpublic boolean isOldFormat()
throws RbdException
RbdExceptionpublic void snapCreate(String snapName) throws RbdException
snapName - The name for the snapshotRbdExceptionpublic void snapRemove(String snapName) throws RbdException
snapName - The name of the snapshotRbdExceptionpublic void snapProtect(String snapName) throws RbdException
snapName - The name of the snapshotRbdExceptionpublic void snapUnprotect(String snapName) throws RbdException
snapName - The name of the snapshotRbdExceptionpublic boolean snapIsProtected(String snapName) throws RbdException
snapName - The name of the snapshotRbdExceptionpublic List<RbdSnapInfo> snapList() throws RbdException
RbdExceptionpublic List<RbdSnapInfo> snapList(int initialBufferSize) throws RbdException
initialBufferSize - Initial size of the byte buffer holding snapshot namesRbdExceptionpublic void write(byte[] data,
long offset,
int length)
throws RbdException
data - The to be written dataoffset - Where to start writinglength - The number of bytes to writeRbdExceptionpublic void write(byte[] data,
long offset)
throws RbdException
data - The to be written dataoffset - Where to start writingRbdExceptionpublic void write(byte[] data)
throws RbdException
data - The to be written dataRbdExceptionpublic int read(long offset,
byte[] buffer,
int length)
offset - Where to start readingbuffer - The buffer to store the resultlength - The amount of bytes to readpublic void resize(long size)
throws RbdException
size - The new size for the RBD imageRbdExceptionpublic void flatten()
throws RbdException
RbdExceptionpublic List<String> listChildren(String snapname) throws RbdException
snapname - Name of the snapshot on RBD imageRbdExceptionCopyright © 2015. All rights reserved.