Class SmartQueryService

  • All Implemented Interfaces:
    FlowQueryService

    public class SmartQueryService
    extends java.lang.Object
    implements FlowQueryService
    Used to intelligently delegate to the proper FlowQueryService based on whether or not aggregated flows can be used.
    • 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 interface FlowQueryService
      • 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 interface FlowQueryService
      • 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 interface FlowQueryService
      • 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 interface FlowQueryService
      • 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 interface FlowQueryService
      • 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 interface FlowQueryService
      • 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 interface FlowQueryService
      • 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 interface FlowQueryService
      • 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 interface FlowQueryService
      • 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 interface FlowQueryService
      • 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 interface FlowQueryService
      • 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 interface FlowQueryService
      • 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 class java.lang.Object