Uploaded image for project: 'Infinispan'
  1. Infinispan
  2. ISPN-484 Querying over HotRod
  3. ISPN-3175

Upgrade the java hotrod client to support remote querying

XMLWordPrintable

    • Icon: Sub-task Sub-task
    • Resolution: Done
    • Icon: Blocker Blocker
    • 6.0.0.Final
    • None
    • None

      Once we'll have ISPN-3169(define query fluent API), ISPN-3173(add a new query operation over hotrod) and ISPN-3174(String-based query language) in place, this is about connecting the dots: invoke the remote query on the server and present the result to the user.

      On the client side

      As described in ISPN-3173, the query is sent as a byte[] to the server: the payload.
      The request payload is query specific (not defined in the HR protocol) and at this stage has the following format: [Q_TYPE] [QUERY_ST] [FIRST_INDEX] [PAGE_SIZE]. This format accommodates the remote query requirements as defined in ISPN-3169.

      • Q_TYPE (protobuf's byte) and query identifier, 1 for JPAQL (this is the query type we'll support). In future we'll add different query types as well.
      • QUERY_STRING (protobuf's string)- JPAQL string generated by the fluent API (ISPN-3169). Parameters are encoded in this string (vs being sent separately)
      • FIRST_INDEX + PAGE_SIZE (protobuf's int)- used for paginating/iterating over the result set.

      HR response: [HR_SUCESS_FLAG] [payload]
      PAYLOAD = [NUM_EL] [PROJ_SIZE] [ELEMENTS]

      • even though at this stage we don't support projections (see ISPN-3169) PROJ_SIZE is added for future compatibility when projection will be supported.

      Note that the payload for both request and response should be marshalled with protobuf as this information is read/written over multiple clients.

      On the server side

      • the server module reads the query operation and the payload (byte[])
      • invokes QueryFacade.query(byte[]) : byte[]
      • QueryFacade is an interface defined in the server modules
      • has an implementation in the remote-query module (new modules)
      • the reason for adding this module: RemoteQueryImpl cannot be in the server modules (ASL) as it has a dependency on the query module (LGPL) which would "contaminate" the server module. Another option would be to merge it in the query module itself, but doesn't feel like a natural fit as its responsibility is serializing data (protobuf). OTOH if it is small we can merge it there so that we don't add a new module to the system?

      For an overview on the remote querying see https://community.jboss.org/wiki/QueryingDesignInInfinispan

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

                Created:
                Updated:
                Resolved: