public class Rbd extends Object
| Modifier and Type | Method and Description |
|---|---|
void |
clone(String parentImage,
String parentSnap,
IoCTX childIo,
String childName,
long features,
int order)
Clone a RBD image
|
void |
clone(String parentImage,
String parentSnap,
IoCTX childIo,
String childName,
long features,
int order,
long stripe_unit,
long stripe_count)
Clone a RBD image
|
void |
close(RbdImage image)
Close a RBD image
|
void |
copy(RbdImage sourceImage,
RbdImage destImage)
Copy a RBD image
|
void |
create(String name,
long size)
Create a new RBD image
|
void |
create(String name,
long size,
int order)
Create a new RBD image
|
void |
create(String name,
long size,
long features)
Create a new RBD v2 image
|
void |
create(String name,
long size,
long features,
int order)
Create a new RBD v2 image
|
void |
create(String name,
long size,
long features,
int order,
long stripe_unit,
long stripe_count)
Create a new RBD v2 image
|
static int[] |
getVersion()
Get the librbd version
|
String[] |
list()
List all RBD images in this pool
|
String[] |
list(int initialBufferSize)
List all RBD images in this pool
|
RbdImage |
open(String name)
Open a RBD image
|
RbdImage |
open(String name,
String snapName)
Open a RBD image with a specific snapshot
|
RbdImage |
openReadOnly(String name)
Open a RBD image read only
|
RbdImage |
openReadOnly(String name,
String snapName)
Open a RBD image with a specific snapshot read only
|
void |
remove(String name)
Remove a RBD image
|
void |
rename(String srcName,
String destName)
Rename a RBD image
|
public Rbd(IoCTX io)
public static int[] getVersion()
public void create(String name, long size, int order) throws RbdException
name - The name of the new imagesize - The size of the new image in bytesorder - Object/block size, as a power of twoRbdExceptionpublic void create(String name, long size) throws RbdException
name - The name of the new imagesize - The size of the new image in bytesRbdExceptionpublic void create(String name, long size, long features, int order) throws RbdException
name - The name of the new imagesize - The size of the new image in bytesfeatures - Initial feature bitsorder - Object/block size, as a power of twoRbdExceptionpublic void create(String name, long size, long features) throws RbdException
name - The name of the new imagesize - The size of the new image in bytesfeatures - Initial feature bitsRbdExceptionpublic void create(String name, long size, long features, int order, long stripe_unit, long stripe_count) throws RbdException
name - The name of the new imagesize - The size of the new image in bytesfeatures - Initial feature bitsorder - Object/block size, as a power of twostripe_unit - Stripe unit size, in bytes.stripe_count - Number of objects to stripe over before loopingRbdExceptionpublic void remove(String name) throws RbdException
name - The name of the imageRbdExceptionpublic void rename(String srcName, String destName) throws RbdException
srcName - The source namedestName - The new name for the imageRbdExceptionpublic String[] list() throws RbdException
RbdExceptionpublic String[] list(int initialBufferSize) throws RbdException
initialBufferSize - Initial size of the byte buffer holding image namesRbdExceptionpublic RbdImage open(String name) throws RbdException
name - The name of the image you want to openRbdExceptionpublic RbdImage open(String name, String snapName) throws RbdException
name - The name of the image you want to opensnapName - The name of the snapshot to openRbdExceptionpublic RbdImage openReadOnly(String name) throws RbdException
name - The name of the image you want to openRbdExceptionpublic RbdImage openReadOnly(String name, String snapName) throws RbdException
name - The name of the image you want to opensnapName - The name of the snapshot to openRbdExceptionpublic void close(RbdImage image) throws RbdException
image - The RbdImage objectRbdExceptionpublic void clone(String parentImage, String parentSnap, IoCTX childIo, String childName, long features, int order, long stripe_unit, long stripe_count) throws RbdException
parentImage - The name of the parent imageparentSnap - The snapshot of the parent image (has to be protected)childIo - The IoCTX for the child imagechildName - The name for the child imagefeatures - The RBD featuresorder - Object/block size, as a power of twostripe_unit - Stripe unit size, in bytes.stripe_count - Number of objects to stripe over before loopingRbdExceptionpublic void clone(String parentImage, String parentSnap, IoCTX childIo, String childName, long features, int order) throws RbdException
parentImage - The name of the parent imageparentSnap - The snapshot of the parent image (has to be protected)childIo - The IoCTX for the child imagechildName - The name for the child imagefeatures - The RBD featuresorder - Object/block size, as a power of twoRbdExceptionpublic void copy(RbdImage sourceImage, RbdImage destImage) throws RbdException
sourceImage - The source RbdImagedestImage - The destination RbdImageRbdExceptionCopyright © 2015. All rights reserved.