public class ThreadSafeEstimatedQueryCollection extends Object implements EstimatedQueryCollection
EstimatedQueryCollection interface thread safe by wrapping all behaviours in
synchronized method.| Constructor and Description |
|---|
ThreadSafeEstimatedQueryCollection(EstimatedQueryCollection estimatedQueries) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
add(QueryContext query)
add the given query to existing queries
|
boolean |
addAll(Set<QueryContext> queries) |
Set<QueryContext> |
getQueries() |
Set<QueryContext> |
getQueries(LensDriver driver) |
Set<QueryContext> |
getQueries(String user) |
int |
getQueriesCount() |
int |
getQueriesCount(LensDriver driver) |
Integer |
getQueryIndex(QueryContext query) |
QueryCost |
getTotalQueryCost(String user)
Get total query cost of all queries of given user
|
boolean |
remove(QueryContext query)
removes given query from existing queries
|
boolean |
removeAll(Set<QueryContext> queries) |
String |
toString() |
public ThreadSafeEstimatedQueryCollection(@NonNull
EstimatedQueryCollection estimatedQueries)
public Set<QueryContext> getQueries(LensDriver driver)
getQueries in interface EstimatedImmutableQueryCollectiondriver - Driver for which queries have to be returned.public int getQueriesCount(LensDriver driver)
getQueriesCount in interface EstimatedImmutableQueryCollectiondriver - Driver for which count of queries have to be returned.public QueryCost getTotalQueryCost(String user)
EstimatedImmutableQueryCollectiongetTotalQueryCost in interface EstimatedImmutableQueryCollectionpublic Set<QueryContext> getQueries()
getQueries in interface ImmutableQueryCollectionpublic Set<QueryContext> getQueries(String user)
getQueries in interface ImmutableQueryCollectionuser - User for whom queries have to be returned.public int getQueriesCount()
getQueriesCount in interface ImmutableQueryCollectionpublic Integer getQueryIndex(QueryContext query)
getQueryIndex in interface ImmutableQueryCollectionpublic boolean add(QueryContext query)
MutableQueryCollectionadd in interface MutableQueryCollectionpublic boolean addAll(Set<QueryContext> queries)
addAll in interface MutableQueryCollectionpublic boolean remove(QueryContext query)
MutableQueryCollectionremove in interface MutableQueryCollectionpublic boolean removeAll(Set<QueryContext> queries)
removeAll in interface MutableQueryCollectionCopyright © 2014–2016 Apache Software Foundation. All rights reserved.