public class CouchBaseNode extends Object implements Serializable
| Constructor and Description |
|---|
CouchBaseNode(String hostname,
String clusterName,
Integer replicas,
Integer ramQuota,
String scope) |
CouchBaseNode(String hostname,
String nodeIP,
String nodePort,
String clusterName,
Integer replicas,
Integer ramQuota,
String scope) |
CouchBaseNode(String hostname,
String nodeIP,
String nodePort,
String username,
String password,
String clusterName,
Integer replicas,
Integer ramQuota,
String scope) |
| Modifier and Type | Method and Description |
|---|---|
void |
addIndexTypes(Map<String,String> keysValues)
Given at map of
|
boolean |
checkIfBucketExists()
Checks if the bucket that is defined for the client exists
|
void |
clear()
Recreates the bucket
|
void |
commitMetaIndexToDatabase()
Saves the current state of meta index in the database and overrides the previous contents
|
void |
connectTo(String host,
String port)
Initializes a client for the server located at host:port
|
Long |
countCollection(String collectionID)
Count all the documents of the given collection
|
void |
createCluster(boolean forceCreate)
Creates a cluster by creating a node and adding a node
|
void |
delete()
Deletes the bucket
|
Boolean |
deleteCollection(String collectionID)
Deletes all the documents of the given collection
|
void |
deleteDocuments(List<String> docIDs)
Deletes all the documents with keys given in docIDs param
|
void |
destroy()
Deletes the bucket and then shutdowns
|
boolean |
feedLocator(String locator)
Feeds the index with values taken from a specific locator.
|
String |
getBucketName() |
Long |
getCollectionDocuments(String collectionID)
Returns the documents count for a given collection
|
Set<String> |
getCollectionsOfIndex(String indexName) |
String |
getDesignDocName() |
Set<String> |
getIndicesOfCollection(String collection) |
Map<String,CouchBaseDataTypesHelper.DataType> |
getKeys() |
MetaIndex |
getMetaIndex() |
org.gcube.indexmanagement.resourceregistry.RRadaptor |
getRradaptor() |
String |
getScope() |
void |
joinCluster(Map<String,String> knownHosts) |
void |
joinCluster(String knownHostIP,
String knownHostPort)
Joins a cluster of a known server
|
void |
loadKeysFromMetaIndex()
Loads the keys from the metaIndex
|
void |
loadMetaFromDatabase()
Loads the meta index from the database and discards current changes
|
String |
query(String queryString)
Executes the queryString and returns the answers at a specific locator.
|
void |
setIndexType(Map<String,String> keysValues)
Given at map of
|
void |
setMetaIndex(MetaIndex metaIndex) |
void |
shutdown()
Shuts down the node and leaves the cluster
|
public CouchBaseNode(String hostname, String clusterName, Integer replicas, Integer ramQuota, String scope) throws gr.uoa.di.madgik.rr.ResourceRegistryException, InterruptedException
gr.uoa.di.madgik.rr.ResourceRegistryExceptionInterruptedExceptionpublic CouchBaseNode(String hostname, String nodeIP, String nodePort, String username, String password, String clusterName, Integer replicas, Integer ramQuota, String scope) throws gr.uoa.di.madgik.rr.ResourceRegistryException, InterruptedException
gr.uoa.di.madgik.rr.ResourceRegistryExceptionInterruptedExceptionpublic CouchBaseNode(String hostname, String nodeIP, String nodePort, String clusterName, Integer replicas, Integer ramQuota, String scope) throws gr.uoa.di.madgik.rr.ResourceRegistryException, InterruptedException
gr.uoa.di.madgik.rr.ResourceRegistryExceptionInterruptedExceptionpublic MetaIndex getMetaIndex()
public void setMetaIndex(MetaIndex metaIndex)
public Map<String,CouchBaseDataTypesHelper.DataType> getKeys()
public org.gcube.indexmanagement.resourceregistry.RRadaptor getRradaptor()
public String getDesignDocName()
public String getBucketName()
public String getScope()
public boolean checkIfBucketExists()
public void createCluster(boolean forceCreate)
throws Exception
forceCreate - Exceptionpublic void connectTo(String host, String port) throws IOException
host - port - IOExceptionpublic void joinCluster(String knownHostIP, String knownHostPort) throws Exception
knownHostIP - knownHostPort - Exceptionpublic void joinCluster(Map<String,String> knownHosts) throws Exception
Exceptionpublic void shutdown()
throws Exception
Exceptionpublic void destroy()
throws Exception
Exceptionpublic void loadKeysFromMetaIndex()
public void setIndexType(Map<String,String> keysValues)
keysValues - public void addIndexTypes(Map<String,String> keysValues)
keysValues - public String query(String queryString)
queryString - public Long getCollectionDocuments(String collectionID)
collectionID - public boolean feedLocator(String locator) throws gr.uoa.di.madgik.grs.reader.GRS2ReaderException, URISyntaxException
locator - gr.uoa.di.madgik.grs.reader.GRS2ReaderExceptionURISyntaxExceptionpublic void deleteDocuments(List<String> docIDs)
docIDs - public Boolean deleteCollection(String collectionID)
collectionID - public Long countCollection(String collectionID)
collectionID - public void loadMetaFromDatabase()
public void commitMetaIndexToDatabase()
Copyright © 2014. All Rights Reserved.