public class Rados extends RadosBase
| Modifier and Type | Class and Description |
|---|---|
class |
Rados.RadosCommandResult
Result returned by RadosCommands
|
| Modifier and Type | Field and Description |
|---|---|
protected com.sun.jna.Pointer |
clusterPtr |
static int |
OPERATION_BALANCE_READS |
static int |
OPERATION_FULL_TRY |
static int |
OPERATION_IGNORE_CACHE |
static int |
OPERATION_IGNORE_OVERLAY |
static int |
OPERATION_LOCALIZE_READS |
static int |
OPERATION_NOFLAG
flags for ReadOp.operate and (maybe later) WriteOp.operate
See librados operate flags for more information
|
static int |
OPERATION_ORDER_READS_WRITES |
static int |
OPERATION_SKIPRWLOCKS |
| Constructor and Description |
|---|
Rados()
Construct a RADOS Object which invokes rados_create
|
Rados(String id)
Construct a RADOS Object which invokes rados_create
|
Rados(String clustername,
String name,
long flags)
Construct a RADOS Object which invokes rados_create2
|
| Modifier and Type | Method and Description |
|---|---|
String |
clusterFsid()
Get the cluster's fsid
|
RadosClusterInfo |
clusterStat()
Get the cluster stats
|
String |
confGet(String option)
Retrieve a RADOS configuration option's value
|
void |
confReadFile(File file)
Read a Ceph configuration file
|
void |
confSet(String option,
String value)
Set a RADOS configuration option
|
void |
connect()
Connect to the Ceph cluster
|
Rados.RadosCommandResult |
executeRadosMonCommand(String[] commands,
String in)
Executes commands in module: 'mon'
To list commands execute "get_command_descriptions"
|
Rados.RadosCommandResult |
executeRadosMonCommandTarget(String[] commands,
String target,
String in)
Executes commands in module: 'mon'
To list commands execute "get_command_descriptions"
|
Rados.RadosCommandResult |
executeRadosOsdCommand(String[] commands,
int osdId,
String in)
Executes commands in module: 'osd'
To list commands execute "get_command_descriptions"
|
protected void |
finalize()
Java finalizer to make sure librados is correctly released if shutDown has not been called explicitly.
|
long |
getInstanceId()
Get the global unique ID of the current connection
|
static int[] |
getVersion()
Get the librados version
|
IoCTX |
ioCtxCreate(String pool)
Create a IoCTX
|
void |
ioCtxDestroy(IoCTX io)
Destroy a IoCTX
|
void |
poolCreate(String name)
Create a RADOS pool
|
void |
poolCreate(String name,
long auid)
Create a RADOS pool and set a auid
|
void |
poolCreate(String name,
long auid,
long crushrule)
Create a RADOS pool and set a auid and crushrule
|
void |
poolDelete(String name)
Delete a RADOS pool
|
String[] |
poolList()
List all the RADOS pools
|
long |
poolLookup(String name)
Get the ID of a RADOS pool
|
String |
poolReverseLookup(long id)
Get the name of a RADOS pool
|
void |
shutDown()
Shuts rados down
|
handleReturnCode, throwExceptionpublic static final int OPERATION_NOFLAG
public static final int OPERATION_BALANCE_READS
public static final int OPERATION_LOCALIZE_READS
public static final int OPERATION_ORDER_READS_WRITES
public static final int OPERATION_IGNORE_CACHE
public static final int OPERATION_SKIPRWLOCKS
public static final int OPERATION_IGNORE_OVERLAY
public static final int OPERATION_FULL_TRY
protected com.sun.jna.Pointer clusterPtr
public Rados(String id)
id - the cephx id to authenticate withpublic Rados(String clustername, 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(File file) throws RadosException
file - A file object with the path to a ceph.confRadosExceptionpublic void confSet(String option, String value) throws RadosException
option - the name of the optionvalue - the value configuration valueRadosExceptionpublic String confGet(String option) throws RadosException
option - the name of the optionRadosExceptionpublic void connect()
throws RadosException
RadosExceptionpublic String clusterFsid() throws RadosException
RadosExceptionpublic RadosClusterInfo clusterStat() throws RadosException
RadosExceptionpublic void poolCreate(String name) throws RadosException
name - the name of the pool to be createdRadosExceptionpublic void poolCreate(String name, long auid) throws RadosException
name - the name of the pool to be createdauid - the owner ID for the new poolRadosExceptionpublic void poolCreate(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(String name) throws RadosException
name - the name of the pool to be deletedRadosExceptionprotected void finalize()
throws Throwable
public String[] poolList() throws RadosException
RadosExceptionpublic long poolLookup(String name) throws RadosException
name - The name of the poolRadosExceptionpublic String poolReverseLookup(long id) throws RadosException
id - The id of the poolRadosExceptionpublic IoCTX ioCtxCreate(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()
public void shutDown()
public Rados.RadosCommandResult executeRadosMonCommand(String[] commands, String in) throws RadosException
commands - Commands to executein - inputbufferRadosExceptionpublic Rados.RadosCommandResult executeRadosMonCommandTarget(String[] commands, String target, String in) throws RadosException
commands - Command to executetarget - Monitor target to execute commandsin - inputbufferRadosExceptionpublic Rados.RadosCommandResult executeRadosOsdCommand(String[] commands, int osdId, String in) throws RadosException
commands - Command to executeosdId - OSD used to process this commandsin - inputbufferRadosExceptionCopyright © 2020. All rights reserved.