public class Rados
extends java.lang.Object
| Modifier and Type | Field and Description |
|---|---|
protected com.sun.jna.Pointer |
clusterPtr |
| Constructor and Description |
|---|
Rados()
Construct a RADOS Object which invokes rados_create
|
Rados(java.lang.String id)
Construct a RADOS Object which invokes rados_create
|
Rados(java.lang.String clustername,
java.lang.String name,
long flags)
Construct a RADOS Object which invokes rados_create2
|
| Modifier and Type | Method and Description |
|---|---|
java.lang.String |
clusterFsid()
Get the cluster's fsid
|
RadosClusterInfo |
clusterStat()
Get the cluster stats
|
java.lang.String |
confGet(java.lang.String option)
Retrieve a RADOS configuration option's value
|
void |
confReadFile(java.io.File file)
Read a Ceph configuration file
|
void |
confSet(java.lang.String option,
java.lang.String value)
Set a RADOS configuration option
|
void |
connect()
Connect to the Ceph cluster
|
protected void |
finalize() |
long |
getInstanceId()
Get the global unique ID of the current connection
|
static int[] |
getVersion()
Get the librados version
|
IoCTX |
ioCtxCreate(java.lang.String pool)
Create a IoCTX
|
void |
ioCtxDestroy(IoCTX io)
Destroy a IoCTX
|
void |
poolCreate(java.lang.String name)
Create a RADOS pool
|
void |
poolCreate(java.lang.String name,
long auid)
Create a RADOS pool and set a auid
|
void |
poolCreate(java.lang.String name,
long auid,
long crushrule)
Create a RADOS pool and set a auid and crushrule
|
void |
poolDelete(java.lang.String name)
Delete a RADOS pool
|
java.lang.String[] |
poolList()
List all the RADOS pools
|
long |
poolLookup(java.lang.String name)
Get the ID of a RADOS pool
|
java.lang.String |
poolReverseLookup(long id)
Get the name of a RADOS pool
|
public Rados(java.lang.String id)
id - the cephx id to authenticate withpublic Rados(java.lang.String clustername,
java.lang.String name,
long flags)
clustername - The name of the cluster (usually "ceph").name - The name of the user (e.g., client.admin, client.user)flags - Flag options (future use).public Rados()
public void confReadFile(java.io.File file)
throws RadosException
file - A file object with the path to a ceph.confRadosExceptionpublic void confSet(java.lang.String option,
java.lang.String value)
throws RadosException
option - the name of the optionvalue - the value configuration valueRadosExceptionpublic java.lang.String confGet(java.lang.String option)
throws RadosException
option - the name of the optionRadosExceptionpublic void connect()
throws RadosException
RadosExceptionpublic java.lang.String clusterFsid()
throws RadosException
RadosExceptionpublic RadosClusterInfo clusterStat() throws RadosException
RadosExceptionpublic void poolCreate(java.lang.String name)
throws RadosException
name - the name of the pool to be createdRadosExceptionpublic void poolCreate(java.lang.String name,
long auid)
throws RadosException
name - the name of the pool to be createdauid - the owner ID for the new poolRadosExceptionpublic void poolCreate(java.lang.String name,
long auid,
long crushrule)
throws RadosException
name - the name of the pool to be createdauid - the owner ID for the new poolcrushrule - the crushrule for this poolRadosExceptionpublic void poolDelete(java.lang.String name)
throws RadosException
name - the name of the pool to be deletedRadosExceptionprotected void finalize()
throws java.lang.Throwable
finalize in class java.lang.Objectjava.lang.Throwablepublic java.lang.String[] poolList()
throws RadosException
RadosExceptionpublic long poolLookup(java.lang.String name)
throws RadosException
name - The name of the poolRadosExceptionpublic java.lang.String poolReverseLookup(long id)
throws RadosException
id - The id of the poolRadosExceptionpublic IoCTX ioCtxCreate(java.lang.String pool) throws RadosException
pool - The name of the RADOS poolRadosExceptionpublic void ioCtxDestroy(IoCTX io)
io - A IoCTX objectpublic long getInstanceId()
throws RadosException
RadosExceptionpublic static int[] getVersion()