Package org.opennms.netmgt.flows.elastic
Class SmartQueryService
- java.lang.Object
-
- org.opennms.netmgt.flows.elastic.SmartQueryService
-
- All Implemented Interfaces:
FlowQueryService
public class SmartQueryService extends java.lang.Object implements FlowQueryService
Used to intelligently delegate to the properFlowQueryService
based on whether or not aggregated flows can be used.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
SmartQueryService.QueryServiceType
-
Constructor Summary
Constructors Constructor Description SmartQueryService(com.codahale.metrics.MetricRegistry metricRegistry, FlowQueryService rawQueryService, FlowQueryService aggQueryService)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.util.concurrent.CompletableFuture<java.util.List<java.lang.String>>
getApplications(java.lang.String matchingPrefix, long limit, java.util.List<Filter> filters)
java.util.concurrent.CompletableFuture<com.google.common.collect.Table<Directional<java.lang.String>,java.lang.Long,java.lang.Double>>
getApplicationSeries(java.util.Set<java.lang.String> applications, long step, boolean includeOther, java.util.List<Filter> filters)
java.util.concurrent.CompletableFuture<java.util.List<TrafficSummary<java.lang.String>>>
getApplicationSummaries(java.util.Set<java.lang.String> applications, boolean includeOther, java.util.List<Filter> filters)
java.util.concurrent.CompletableFuture<java.util.List<java.lang.String>>
getConversations(java.lang.String locationPattern, java.lang.String protocolPattern, java.lang.String lowerIPPattern, java.lang.String upperIPPattern, java.lang.String applicationPattern, long limit, java.util.List<Filter> filters)
java.util.concurrent.CompletableFuture<com.google.common.collect.Table<Directional<Conversation>,java.lang.Long,java.lang.Double>>
getConversationSeries(java.util.Set<java.lang.String> conversations, long step, boolean includeOther, java.util.List<Filter> filters)
java.util.concurrent.CompletableFuture<java.util.List<TrafficSummary<Conversation>>>
getConversationSummaries(java.util.Set<java.lang.String> conversations, boolean includeOther, java.util.List<Filter> filters)
java.util.concurrent.CompletableFuture<com.google.common.collect.Table<Directional<java.lang.String>,java.lang.Long,java.lang.Double>>
getFieldSeries(LimitedCardinalityField field, long step, java.util.List<Filter> filters)
java.util.concurrent.CompletableFuture<java.util.List<TrafficSummary<java.lang.String>>>
getFieldSummaries(LimitedCardinalityField field, java.util.List<Filter> filters)
java.util.concurrent.CompletableFuture<java.util.List<java.lang.String>>
getFieldValues(LimitedCardinalityField field, java.util.List<Filter> filters)
java.util.concurrent.CompletableFuture<java.lang.Long>
getFlowCount(java.util.List<Filter> filters)
java.util.concurrent.CompletableFuture<java.util.List<java.lang.String>>
getHosts(java.lang.String regex, long limit, java.util.List<Filter> filters)
java.util.concurrent.CompletableFuture<com.google.common.collect.Table<Directional<Host>,java.lang.Long,java.lang.Double>>
getHostSeries(java.util.Set<java.lang.String> hosts, long step, boolean includeOther, java.util.List<Filter> filters)
java.util.concurrent.CompletableFuture<java.util.List<TrafficSummary<Host>>>
getHostSummaries(java.util.Set<java.lang.String> hosts, boolean includeOther, java.util.List<Filter> filters)
long
getTimeRangeDurationAggregateThresholdMs()
long
getTimeRangeEndpointAggregateThresholdMs()
java.util.concurrent.CompletableFuture<com.google.common.collect.Table<Directional<java.lang.String>,java.lang.Long,java.lang.Double>>
getTopNApplicationSeries(int N, long step, boolean includeOther, java.util.List<Filter> filters)
java.util.concurrent.CompletableFuture<java.util.List<TrafficSummary<java.lang.String>>>
getTopNApplicationSummaries(int N, boolean includeOther, java.util.List<Filter> filters)
java.util.concurrent.CompletableFuture<com.google.common.collect.Table<Directional<Conversation>,java.lang.Long,java.lang.Double>>
getTopNConversationSeries(int N, long step, boolean includeOther, java.util.List<Filter> filters)
java.util.concurrent.CompletableFuture<java.util.List<TrafficSummary<Conversation>>>
getTopNConversationSummaries(int N, boolean includeOther, java.util.List<Filter> filters)
java.util.concurrent.CompletableFuture<com.google.common.collect.Table<Directional<Host>,java.lang.Long,java.lang.Double>>
getTopNHostSeries(int N, long step, boolean includeOther, java.util.List<Filter> filters)
java.util.concurrent.CompletableFuture<java.util.List<TrafficSummary<Host>>>
getTopNHostSummaries(int N, boolean includeOther, java.util.List<Filter> filters)
boolean
isAlwaysUseAggForQueries()
boolean
isAlwaysUseRawForQueries()
void
setAlwaysUseAggForQueries(boolean alwaysUseAggForQueries)
void
setAlwaysUseRawForQueries(boolean alwaysUseRawForQueries)
void
setTimeRangeDurationAggregateThresholdMs(long timeRangeDurationAggregateThresholdMs)
void
setTimeRangeEndpointAggregateThresholdMs(long timeRangeEndpointAggregateThresholdMs)
java.lang.String
toString()
-
-
-
Constructor Detail
-
SmartQueryService
public SmartQueryService(com.codahale.metrics.MetricRegistry metricRegistry, FlowQueryService rawQueryService, FlowQueryService aggQueryService)
-
-
Method Detail
-
getFlowCount
public java.util.concurrent.CompletableFuture<java.lang.Long> getFlowCount(java.util.List<Filter> filters)
- Specified by:
getFlowCount
in interfaceFlowQueryService
-
getApplications
public java.util.concurrent.CompletableFuture<java.util.List<java.lang.String>> getApplications(java.lang.String matchingPrefix, long limit, java.util.List<Filter> filters)
- Specified by:
getApplications
in interfaceFlowQueryService
-
getTopNApplicationSummaries
public java.util.concurrent.CompletableFuture<java.util.List<TrafficSummary<java.lang.String>>> getTopNApplicationSummaries(int N, boolean includeOther, java.util.List<Filter> filters)
- Specified by:
getTopNApplicationSummaries
in interfaceFlowQueryService
-
getApplicationSummaries
public java.util.concurrent.CompletableFuture<java.util.List<TrafficSummary<java.lang.String>>> getApplicationSummaries(java.util.Set<java.lang.String> applications, boolean includeOther, java.util.List<Filter> filters)
- Specified by:
getApplicationSummaries
in interfaceFlowQueryService
-
getApplicationSeries
public java.util.concurrent.CompletableFuture<com.google.common.collect.Table<Directional<java.lang.String>,java.lang.Long,java.lang.Double>> getApplicationSeries(java.util.Set<java.lang.String> applications, long step, boolean includeOther, java.util.List<Filter> filters)
- Specified by:
getApplicationSeries
in interfaceFlowQueryService
-
getTopNApplicationSeries
public java.util.concurrent.CompletableFuture<com.google.common.collect.Table<Directional<java.lang.String>,java.lang.Long,java.lang.Double>> getTopNApplicationSeries(int N, long step, boolean includeOther, java.util.List<Filter> filters)
- Specified by:
getTopNApplicationSeries
in interfaceFlowQueryService
-
getConversations
public java.util.concurrent.CompletableFuture<java.util.List<java.lang.String>> getConversations(java.lang.String locationPattern, java.lang.String protocolPattern, java.lang.String lowerIPPattern, java.lang.String upperIPPattern, java.lang.String applicationPattern, long limit, java.util.List<Filter> filters)
- Specified by:
getConversations
in interfaceFlowQueryService
-
getTopNConversationSummaries
public java.util.concurrent.CompletableFuture<java.util.List<TrafficSummary<Conversation>>> getTopNConversationSummaries(int N, boolean includeOther, java.util.List<Filter> filters)
- Specified by:
getTopNConversationSummaries
in interfaceFlowQueryService
-
getConversationSummaries
public java.util.concurrent.CompletableFuture<java.util.List<TrafficSummary<Conversation>>> getConversationSummaries(java.util.Set<java.lang.String> conversations, boolean includeOther, java.util.List<Filter> filters)
- Specified by:
getConversationSummaries
in interfaceFlowQueryService
-
getConversationSeries
public java.util.concurrent.CompletableFuture<com.google.common.collect.Table<Directional<Conversation>,java.lang.Long,java.lang.Double>> getConversationSeries(java.util.Set<java.lang.String> conversations, long step, boolean includeOther, java.util.List<Filter> filters)
- Specified by:
getConversationSeries
in interfaceFlowQueryService
-
getTopNConversationSeries
public java.util.concurrent.CompletableFuture<com.google.common.collect.Table<Directional<Conversation>,java.lang.Long,java.lang.Double>> getTopNConversationSeries(int N, long step, boolean includeOther, java.util.List<Filter> filters)
- Specified by:
getTopNConversationSeries
in interfaceFlowQueryService
-
getHosts
public java.util.concurrent.CompletableFuture<java.util.List<java.lang.String>> getHosts(java.lang.String regex, long limit, java.util.List<Filter> filters)
- Specified by:
getHosts
in interfaceFlowQueryService
-
getTopNHostSummaries
public java.util.concurrent.CompletableFuture<java.util.List<TrafficSummary<Host>>> getTopNHostSummaries(int N, boolean includeOther, java.util.List<Filter> filters)
- Specified by:
getTopNHostSummaries
in interfaceFlowQueryService
-
getHostSummaries
public java.util.concurrent.CompletableFuture<java.util.List<TrafficSummary<Host>>> getHostSummaries(java.util.Set<java.lang.String> hosts, boolean includeOther, java.util.List<Filter> filters)
- Specified by:
getHostSummaries
in interfaceFlowQueryService
-
getHostSeries
public java.util.concurrent.CompletableFuture<com.google.common.collect.Table<Directional<Host>,java.lang.Long,java.lang.Double>> getHostSeries(java.util.Set<java.lang.String> hosts, long step, boolean includeOther, java.util.List<Filter> filters)
- Specified by:
getHostSeries
in interfaceFlowQueryService
-
getTopNHostSeries
public java.util.concurrent.CompletableFuture<com.google.common.collect.Table<Directional<Host>,java.lang.Long,java.lang.Double>> getTopNHostSeries(int N, long step, boolean includeOther, java.util.List<Filter> filters)
- Specified by:
getTopNHostSeries
in interfaceFlowQueryService
-
getFieldValues
public java.util.concurrent.CompletableFuture<java.util.List<java.lang.String>> getFieldValues(LimitedCardinalityField field, java.util.List<Filter> filters)
- Specified by:
getFieldValues
in interfaceFlowQueryService
-
getFieldSummaries
public java.util.concurrent.CompletableFuture<java.util.List<TrafficSummary<java.lang.String>>> getFieldSummaries(LimitedCardinalityField field, java.util.List<Filter> filters)
- Specified by:
getFieldSummaries
in interfaceFlowQueryService
-
getFieldSeries
public java.util.concurrent.CompletableFuture<com.google.common.collect.Table<Directional<java.lang.String>,java.lang.Long,java.lang.Double>> getFieldSeries(LimitedCardinalityField field, long step, java.util.List<Filter> filters)
- Specified by:
getFieldSeries
in interfaceFlowQueryService
-
isAlwaysUseAggForQueries
public boolean isAlwaysUseAggForQueries()
-
setAlwaysUseAggForQueries
public void setAlwaysUseAggForQueries(boolean alwaysUseAggForQueries)
-
isAlwaysUseRawForQueries
public boolean isAlwaysUseRawForQueries()
-
setAlwaysUseRawForQueries
public void setAlwaysUseRawForQueries(boolean alwaysUseRawForQueries)
-
getTimeRangeDurationAggregateThresholdMs
public long getTimeRangeDurationAggregateThresholdMs()
-
setTimeRangeDurationAggregateThresholdMs
public void setTimeRangeDurationAggregateThresholdMs(long timeRangeDurationAggregateThresholdMs)
-
getTimeRangeEndpointAggregateThresholdMs
public long getTimeRangeEndpointAggregateThresholdMs()
-
setTimeRangeEndpointAggregateThresholdMs
public void setTimeRangeEndpointAggregateThresholdMs(long timeRangeEndpointAggregateThresholdMs)
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-