public class ClusterManager
extends net.spy.memcached.compat.SpyObject
Modifier and Type | Class and Description |
---|---|
static class |
ClusterManager.HttpResult
Value Object to aggregate a raw response message.
|
Modifier and Type | Field and Description |
---|---|
static int |
DEFAULT_CONN_TIMEOUT
The default connection timeout in milliseconds.
|
static int |
DEFAULT_CONNS_PER_NODE
The default number fo max.
|
static int |
DEFAULT_IO_THREADS
The default number of IO (worker) threads to use.
|
static int |
DEFAULT_SOCKET_TIMEOUT
The default socket timeout in milliseconds.
|
static boolean |
DEFAULT_TCP_NODELAY
By default, enable tcp nodelay.
|
Constructor and Description |
---|
ClusterManager(java.util.List<java.net.URI> nodes,
java.lang.String username,
java.lang.String password)
Create a new
ClusterManager instance. |
ClusterManager(java.util.List<java.net.URI> nodes,
java.lang.String username,
java.lang.String password,
int connectionTimeout,
int socketTimeout,
boolean tcpNoDelay,
int ioThreadCount,
int connectionsPerNode)
Create a new
ClusterManager instance. |
Modifier and Type | Method and Description |
---|---|
void |
createDefaultBucket(BucketType type,
int memorySizeMB,
int replicas,
boolean flushEnabled)
Creates the default bucket.
|
void |
createNamedBucket(BucketType type,
java.lang.String name,
int memorySizeMB,
int replicas,
java.lang.String authPassword,
boolean flushEnabled)
Creates a named bucket with a given password for SASL authentication.
|
void |
createPortBucket(BucketType type,
java.lang.String name,
int memorySizeMB,
int replicas,
int port,
boolean flush)
Creates the a sasl bucket.
|
void |
deleteBucket(java.lang.String name)
Deletes a bucket.
|
FlushResponse |
flushBucket(java.lang.String name)
Deletes all data in a bucket.
|
java.util.List<java.lang.String> |
listBuckets()
Lists all buckets in a Couchbase cluster.
|
boolean |
shutdown()
Shutdown the
ClusterManager . |
void |
updateBucket(java.lang.String name,
int memorySizeMB,
AuthType authType,
int replicas,
int port,
java.lang.String authpassword,
boolean flushEnabled)
Update a bucket with the new settings.
|
public static final int DEFAULT_CONN_TIMEOUT
public static final int DEFAULT_SOCKET_TIMEOUT
public static final boolean DEFAULT_TCP_NODELAY
public static final int DEFAULT_IO_THREADS
public static final int DEFAULT_CONNS_PER_NODE
public ClusterManager(java.util.List<java.net.URI> nodes, java.lang.String username, java.lang.String password)
ClusterManager
instance.
Not all nodes in the cluster need to be provided, a subset is enough so
that the ClusterManager
can connect to at least one of them, even
in the case of a node failure.nodes
- the list of nodes in the cluster to connect to.username
- the admin username.password
- the admin password.public ClusterManager(java.util.List<java.net.URI> nodes, java.lang.String username, java.lang.String password, int connectionTimeout, int socketTimeout, boolean tcpNoDelay, int ioThreadCount, int connectionsPerNode)
ClusterManager
instance.
Not all nodes in the cluster need to be provided, a subset is enough so
that the ClusterManager
can connect to at least one of them, even
in the case of a node failure.nodes
- the list of nodes in the cluster to connect to.username
- the admin username.password
- the admin password.connectionTimeout
- the timeout of the connection once established.socketTimeout
- the socket timeout of the connection.tcpNoDelay
- if nagle should be used or not.ioThreadCount
- the number of IO threads to use.connectionsPerNode
- the number of connections per node to establish.public void createDefaultBucket(BucketType type, int memorySizeMB, int replicas, boolean flushEnabled)
type
- The bucket type to create.memorySizeMB
- The amount of memory to allocate to this bucket.replicas
- The number of replicas for this bucket.flushEnabled
- If flush should be enabled on this bucket.public void createNamedBucket(BucketType type, java.lang.String name, int memorySizeMB, int replicas, java.lang.String authPassword, boolean flushEnabled)
type
- The bucket type to create.name
- The name of the bucket.memorySizeMB
- The amount of memory to allocate to this bucket.replicas
- The number of replicas for this bucket.authPassword
- The password for this bucket.flushEnabled
- If flush should be enabled on this bucket.public void createPortBucket(BucketType type, java.lang.String name, int memorySizeMB, int replicas, int port, boolean flush)
type
- The bucket type to create.name
- The name of the bucket.memorySizeMB
- The amount of memory to allocate to this bucket.replicas
- The number of replicas for this bucket.port
- The port for this bucket to listen on.public void deleteBucket(java.lang.String name)
name
- The name of the bucket to delete.public java.util.List<java.lang.String> listBuckets()
public FlushResponse flushBucket(java.lang.String name)
name
- The bucket to flush.public void updateBucket(java.lang.String name, int memorySizeMB, AuthType authType, int replicas, int port, java.lang.String authpassword, boolean flushEnabled)
name
- The name of the bucket.memorySizeMB
- The amount of memory to allocate to this bucket.authType
- the authentication type to use.replicas
- The number of replicas for this bucket.port
- The port for this bucket to listen on.authpassword
- the authentication password.flushEnabled
- whether flush is enabled.public boolean shutdown()
ClusterManager
.Copyright © 2006-2009 Dustin Sallings, 2009-2012 Couchbase, Inc.