Uploaded image for project: 'Kafka'
  1. Kafka
  2. KAFKA-15126

Change range queries to accept null lower and upper bounds

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Resolved
    • Minor
    • Resolution: Fixed
    • None
    • 3.6.0
    • streams
    • None

    Description

      When web client requests come in with query params, it's common for those params to be null. We want developers to just be able to pass in the upper/lower bounds if they want instead of implementing their own logic to avoid getting the whole range (which will happen if they leave the params null). 

      An example of the logic they can avoid using after this KIP is implemented is below:

      private RangeQuery<String, ValueAndTimestamp<StockTransactionAggregation>> createRangeQuery(String lower, String upper) {
              if (isBlank(lower) && isBlank(upper)) {
                  return RangeQuery.withNoBounds();
              } else if (!isBlank(lower) && isBlank(upper)) {
                  return RangeQuery.withLowerBound(lower);
              } else if (isBlank(lower) && !isBlank(upper)) {
                  return RangeQuery.withUpperBound(upper);
              } else {
                  return RangeQuery.withRange(lower, upper);
              }
          } 

       

       

      Attachments

        Activity

          People

            Cerchie Lucia Cerchie
            Cerchie Lucia Cerchie
            Bill Bejeck Bill Bejeck
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Time Tracking

                Estimated:
                Original Estimate - 672h
                672h
                Remaining:
                Remaining Estimate - 672h
                672h
                Logged:
                Time Spent - Not Specified
                Not Specified