Class SearchQueryProvider

  • All Implemented Interfaces:
    FilterVisitor<java.lang.String>

    public class SearchQueryProvider
    extends java.lang.Object
    implements FilterVisitor<java.lang.String>
    Here we store the search queries in the class-path in the form of Freemarker templates and use the templating to perform the parameter substitution. This makes it cleaner than storing the search queries as multiline strings in Java code, and is much less verbose than storing these as POJOs.
    • Constructor Detail

      • SearchQueryProvider

        public SearchQueryProvider()
    • Method Detail

      • getFlowCountQuery

        public java.lang.String getFlowCountQuery​(java.util.List<Filter> filters)
      • getUniqueNodeExporters

        public java.lang.String getUniqueNodeExporters​(long size,
                                                       java.util.List<Filter> filters)
      • getUniqueSnmpInterfaces

        public java.lang.String getUniqueSnmpInterfaces​(long size,
                                                        java.util.List<Filter> filters)
      • getTopNQuery

        public java.lang.String getTopNQuery​(int N,
                                             java.lang.String groupByTerm,
                                             java.lang.String keyForMissingTerm,
                                             java.util.List<Filter> filters)
      • getSeriesFromQuery

        public java.lang.String getSeriesFromQuery​(java.util.Collection<java.lang.String> from,
                                                   long step,
                                                   long start,
                                                   long end,
                                                   java.lang.String groupByTerm,
                                                   java.util.List<Filter> filters)
      • getSeriesFromQuery

        public java.lang.String getSeriesFromQuery​(int size,
                                                   long step,
                                                   long start,
                                                   long end,
                                                   java.lang.String groupByTerm,
                                                   java.util.List<Filter> filters)
      • getSeriesFromMissingQuery

        public java.lang.String getSeriesFromMissingQuery​(long step,
                                                          long start,
                                                          long end,
                                                          java.lang.String groupByTerm,
                                                          java.lang.String keyForMissingTerm,
                                                          java.util.List<Filter> filters)
      • getSeriesFromOthersQuery

        public java.lang.String getSeriesFromOthersQuery​(java.util.Collection<java.lang.String> from,
                                                         long step,
                                                         long start,
                                                         long end,
                                                         java.lang.String groupByTerm,
                                                         boolean excludeMissing,
                                                         java.util.List<Filter> filters)
      • getApplicationsQuery

        public java.lang.String getApplicationsQuery​(java.lang.String prefix,
                                                     long limit,
                                                     java.util.List<Filter> filters)
      • getHostsQuery

        public java.lang.String getHostsQuery​(java.lang.String regex,
                                              long limit,
                                              java.util.List<Filter> filters)
      • getConversationsRegexQuery

        public java.lang.String getConversationsRegexQuery​(java.lang.String regex,
                                                           long limit,
                                                           java.util.List<Filter> filters)
      • getHostnameByConversationQuery

        public java.lang.String getHostnameByConversationQuery​(java.lang.String convoKey,
                                                               java.util.List<Filter> filters)
      • getHostnameByHostQuery

        public java.lang.String getHostnameByHostQuery​(java.lang.String host,
                                                       java.util.List<Filter> filters)
      • getAllValues

        public java.lang.String getAllValues​(java.lang.String field,
                                             int fieldSize,
                                             java.util.List<Filter> filters)