code: static final public LocalRateOptions parseRateOptions(boolean rate, String spec) {
      if (!rate || spec.length() < 6) {
        return new LocalRateOptions();
      }
  
      String[] parts = spec.split(spec.substring(5, spec.length() - 1), ',');
      if (parts.length < 1 || parts.length > 3) {
        return new LocalRateOptions();
      }
  
      try {
        LocalRateOptions options = new LocalRateOptions();
        options.is_counter = parts[0].endsWith("counter");
        options.counter_max = (parts.length >= 2 && parts[1].length() > 0 ? Long
            .parseLong(parts[1]) : Long.MAX_VALUE);
        options.reset_value = (parts.length >= 3 && parts[2].length() > 0 ? Long
            .parseLong(parts[2]) : 0);
        return options;
      } catch (NumberFormatException e) {
        return new LocalRateOptions();
      }
    }
docs: Parses the "rate" section of the query string and returns an instance
  of the LocalRateOptions class that contains the values found.
  <p/>
  The format of the rate specification is rate[{counter[,#[,#]]}].
  If the spec is invalid or we were unable to parse properly, it returns a
  default options object.
  @param rate If true, then the query is set as a rate query and the rate
  specification will be parsed. If false, a default RateOptions instance
  will be returned and largely ignored by the rest of the processing
  @param spec The part of the query string that pertains to the rate
  @return An initialized LocalRateOptions instance based on the specification
  @since 2.0