|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.gcube.couchbase.helpers.QueryHelper
public class QueryHelper
| Constructor Summary | |
|---|---|
QueryHelper()
|
|
| Method Summary | |
|---|---|
static void |
addExcludedFields(List<ArrayList<org.gcube.indexmanagement.bdbwrapper.BDBGcqlQueryContainer.SingleTerm>> queries,
List<String> projections)
Adds the fields that may be in searchables with wildcards but not appear in projections |
static List<Map<String,String>> |
applyProjection(Map<String,Object> docs,
List<String> projections)
Performs projection on the given documents. |
static com.couchbase.client.protocol.views.Query |
createOneOperantQuery(Operator op,
Object value)
Creates a 1-operant Query from the given operator and value |
static com.couchbase.client.protocol.views.Query |
createOneOperantQuery(com.couchbase.client.protocol.views.Query query,
Operator op,
Object value)
Creates a 1-operant Query from the given operator and value |
static com.couchbase.client.protocol.views.Query |
createTwoOperantQuery(Operator op,
Object value1,
Object value2)
Creates a 2-operant Query from the given operators and values |
static com.couchbase.client.protocol.views.Query |
createTwoOperantQuery(Operator op1,
Object value1,
Operator op2,
Object value2)
Creates a 2-operant Query from the given operators and values |
static void |
dummyQuery(com.couchbase.client.CouchbaseClient client,
String designDocumentName,
String viewName)
Performs a dummy query with stale value FALSE in order to force index to be recreated |
static List<String> |
getExcludedFields(List<org.gcube.indexmanagement.bdbwrapper.BDBGcqlQueryContainer.SingleTerm> terms)
Excludes the fields with the wildcards |
static Map<String,List<org.gcube.couchbase.helpers.Relation>> |
getKeys(String queryString)
Return a Map that contains the Relations per key that are extracted from the queryString Relations contain the operator and the value for each key. |
static List<String> |
getViewResponse(com.couchbase.client.protocol.views.ViewResponse vr)
Returns a list of the keys of the matching documents of the ViewResponse |
static Map<String,String> |
getViewResponseKeyValues(com.couchbase.client.protocol.views.ViewResponse vr)
|
static Long |
keyCount(com.couchbase.client.CouchbaseClient client,
String bucketName,
String designDocumentName,
Set<String> fields,
Map<String,CouchBaseDataTypesHelper.DataType> keys)
Returns the number of keys for each field. |
static void |
main(String[] args)
|
static Map<String,Object> |
multiGetCouchBase(com.couchbase.client.CouchbaseClient client,
Collection<String> ids,
boolean distinct)
Returns a Map of |
static Map<String,Object> |
multiGetCouchBase(com.couchbase.client.CouchbaseClient client,
Collection<String> ids,
boolean distinct,
int numOfResults)
Returns a Map of |
static void |
printQueryDate(com.couchbase.client.protocol.views.ViewResponse vr)
|
static String |
pruneQuery(List<org.gcube.indexmanagement.bdbwrapper.BDBGcqlQueryContainer.SingleTerm> terms)
Returns a string that is the representations of the terms given but excludes the fields with the wildcard |
static List<String> |
queryCouchBase(com.couchbase.client.CouchbaseClient client,
String designDocumentName,
String viewName,
Operator op,
Object key)
Returns only the keys and the matching docs (not the document). |
static List<String> |
queryCouchBase(com.couchbase.client.CouchbaseClient client,
String designDocumentName,
String viewName,
Operator op,
Object startKey,
Object endKey)
Returns only the keys and the matching docs (not the document). |
static List<String> |
queryCouchBase(com.couchbase.client.CouchbaseClient client,
String designDocumentName,
String viewName,
Operator op1,
Object key1,
Operator op2,
Object key2)
Returns only the keys and the matching docs (not the document). |
static Long |
queryCountCouchBase(com.couchbase.client.CouchbaseClient client,
String designDocumentName,
String viewName)
Returns the number of keys for each field. |
static Long |
queryCountCouchBase(com.couchbase.client.CouchbaseClient client,
String bucketName,
String designDocumentName,
String fieldName,
Map<String,CouchBaseDataTypesHelper.DataType> keys)
Returns the number of keys for each field. |
static List<String> |
queryRelations(com.couchbase.client.CouchbaseClient client,
String bucketName,
String designDocumentName,
Map<String,List<org.gcube.couchbase.helpers.Relation>> relations,
Map<String,CouchBaseDataTypesHelper.DataType> keys)
Returns all the ids that match the given Relations in a list. |
static List<String> |
queryString(com.couchbase.client.CouchbaseClient client,
String bucketName,
String designDocumentName,
Map<String,CouchBaseDataTypesHelper.DataType> keys,
String queryString)
Returns all the ids that match the given queryString in a list. |
static Object |
singleGetCouchBase(com.couchbase.client.CouchbaseClient client,
String id)
Returns a document that its key matches the id given |
static Map<String,List<org.gcube.couchbase.helpers.Relation>> |
validateAndSimplifyKeys(Map<String,List<org.gcube.couchbase.helpers.Relation>> keys)
Performs a validation on a Map that contains the Relations per key. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public QueryHelper()
| Method Detail |
|---|
public static String pruneQuery(List<org.gcube.indexmanagement.bdbwrapper.BDBGcqlQueryContainer.SingleTerm> terms)
terms -
public static List<String> getExcludedFields(List<org.gcube.indexmanagement.bdbwrapper.BDBGcqlQueryContainer.SingleTerm> terms)
terms -
public static void addExcludedFields(List<ArrayList<org.gcube.indexmanagement.bdbwrapper.BDBGcqlQueryContainer.SingleTerm>> queries,
List<String> projections)
queries - projections -
public static void dummyQuery(com.couchbase.client.CouchbaseClient client,
String designDocumentName,
String viewName)
client - designDocumentName - viewName -
public static List<Map<String,String>> applyProjection(Map<String,Object> docs,
List<String> projections)
docs - projections -
public static List<String> queryCouchBase(com.couchbase.client.CouchbaseClient client,
String designDocumentName,
String viewName,
Operator op,
Object startKey,
Object endKey)
client - designDocumentName - viewName - startKey - endKey -
public static List<String> queryCouchBase(com.couchbase.client.CouchbaseClient client,
String designDocumentName,
String viewName,
Operator op1,
Object key1,
Operator op2,
Object key2)
client - designDocumentName - viewName - op1 - key1 - op2 - key2 -
public static List<String> queryCouchBase(com.couchbase.client.CouchbaseClient client,
String designDocumentName,
String viewName,
Operator op,
Object key)
client - designDocumentName - viewName - op - key -
public static List<String> getViewResponse(com.couchbase.client.protocol.views.ViewResponse vr)
vr -
public static Object singleGetCouchBase(com.couchbase.client.CouchbaseClient client,
String id)
client - id -
public static Map<String,Object> multiGetCouchBase(com.couchbase.client.CouchbaseClient client,
Collection<String> ids,
boolean distinct)
client - ids - distinct -
public static Map<String,Object> multiGetCouchBase(com.couchbase.client.CouchbaseClient client,
Collection<String> ids,
boolean distinct,
int numOfResults)
client - ids - distinct -
public static Map<String,List<org.gcube.couchbase.helpers.Relation>> getKeys(String queryString)
throws Exception
queryString -
Exception
public static Map<String,List<org.gcube.couchbase.helpers.Relation>> validateAndSimplifyKeys(Map<String,List<org.gcube.couchbase.helpers.Relation>> keys)
throws Exception
keys -
Exception
public static List<String> queryString(com.couchbase.client.CouchbaseClient client,
String bucketName,
String designDocumentName,
Map<String,CouchBaseDataTypesHelper.DataType> keys,
String queryString)
throws Exception
client - bucketName - designDocumentName - keys - queryString -
Exception
public static List<String> queryRelations(com.couchbase.client.CouchbaseClient client,
String bucketName,
String designDocumentName,
Map<String,List<org.gcube.couchbase.helpers.Relation>> relations,
Map<String,CouchBaseDataTypesHelper.DataType> keys)
throws Exception
client - bucketName - designDocumentName - keys - queryString -
Exception
public static Long keyCount(com.couchbase.client.CouchbaseClient client,
String bucketName,
String designDocumentName,
Set<String> fields,
Map<String,CouchBaseDataTypesHelper.DataType> keys)
throws Exception
client - bucketName - designDocumentName - fields - keys -
Exception
public static Long queryCountCouchBase(com.couchbase.client.CouchbaseClient client,
String bucketName,
String designDocumentName,
String fieldName,
Map<String,CouchBaseDataTypesHelper.DataType> keys)
throws Exception
client - bucketName - designDocumentName - fieldName - keys -
Exception
public static Long queryCountCouchBase(com.couchbase.client.CouchbaseClient client,
String designDocumentName,
String viewName)
throws Exception
client - designDocumentName - viewName -
Exception
public static com.couchbase.client.protocol.views.Query createTwoOperantQuery(Operator op1,
Object value1,
Operator op2,
Object value2)
op1 - value1 - op2 - value2 -
public static com.couchbase.client.protocol.views.Query createTwoOperantQuery(Operator op,
Object value1,
Object value2)
op - value1 - value2 -
public static com.couchbase.client.protocol.views.Query createOneOperantQuery(Operator op,
Object value)
op - value -
public static com.couchbase.client.protocol.views.Query createOneOperantQuery(com.couchbase.client.protocol.views.Query query,
Operator op,
Object value)
query - op - value -
public static void printQueryDate(com.couchbase.client.protocol.views.ViewResponse vr)
public static Map<String,String> getViewResponseKeyValues(com.couchbase.client.protocol.views.ViewResponse vr)
public static void main(String[] args)
throws Exception
Exception
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||