Uploaded image for project: 'Infinispan'
  1. Infinispan
  2. ISPN-3105

Design query API for both embedded use and Java Hot Rod client

    XMLWordPrintable

Details

    • Medium

    Description

      There are several parts to this JIRA.

      1. We'd need a query API to be able to run queries on a cache. For example:

         // Super-interface to Cache and RemoteCache
         public interface BasicCache {
         ...
            Set<?> runQuery(Filter f);
         ...
         }
      

      such that the same API can be used for remote (for the Hot Rod Java client) as well as embedded querying.

      2. Since the approach we're using is effectively to look at the global data set and apply a series of filters, we'd need a FilterBuilder as well to create such filters. E.g.,

        new FilterBuilder().matches("name", "QueenElizabeth").and().greaterThan("age", 65).build();
      

      The Hibernate Search query DSL could probably be used for inspiration.

      3. Further, we should still have an API that takes in Lucene Query objects - as per the existing Query API - but this would be for embedded mode only. E.g.,

        public interface Cache {
          ...
          Set<?> runLuceneQuery(LuceneQuery q);
          ...
        }
      

      4. Projections. We may also want to support projections. This needs thought. Again, Hibernate Search's APIs can provide inspiration.

      Attachments

        Activity

          People

            anistor Adrian Nistor (Inactive)
            mircea.markus Mircea Markus (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: