/*
 * Licensed to the Apache Software Foundation (ASF) under one or more
 * contributor license agreements. See the NOTICE file distributed with
 * this work for additional information regarding copyright ownership.
 * The ASF licenses this file to You under the Apache License, Version 2.0
 * (the "License"); you may not use this file except in compliance with
 * the License. You may obtain a copy of the License at
 *
 *    http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package org.apache.kafka.streams.state;

import org.apache.kafka.common.annotation.InterfaceStability;
import org.apache.kafka.streams.errors.InvalidStateStoreException;

/**
 * A window store that only supports read operations
 * Implementations should be thread-safe as concurrent reads and writes
 * are expected.
 * @param <K> Type of keys
 * @param <V> Type of values
 */
@InterfaceStability.Unstable
public interface ReadOnlyWindowStore<K, V> {

    /**
     * Get all the key-value pairs with the given key and the time range from all
     * the existing windows.
     *
     * @return an iterator over key-value pairs {@code <timestamp, value>}
     * @throws InvalidStateStoreException if the store is not initialized
     */
    WindowStoreIterator<V> fetch(K key, long timeFrom, long timeTo);
}

@@ -1369,16 +1369,840 @@
 .%0A     *
+ %3Cp%3E%0A     * The time range is inclusive and applies to the starting timestamp of the window.%0A     * For example, if we have the following windows:%0A     * %3Cp%3E%0A     * %3Cpre%3E%0A     * +-------------------------------+%0A     * %7C  key  %7C start time %7C end time %7C%0A     * +-------+------------+----------+%0A     * %7C   A   %7C     10     %7C    20    %7C%0A     * +-------+------------+----------+%0A     * %7C   A   %7C     15     %7C    25    %7C%0A     * +-------+------------+----------+%0A     * %7C   A   %7C     20     %7C    30    %7C%0A     * +-------+------------+----------+%0A     * %7C   A   %7C     25     %7C    35    %7C%0A     * +--------------------------------%0A     * %3C/pre%3E%0A     * And we call %7B@code store.fetch(%22A%22, 10, 20)%7D then the results will contain the first%0A     * three windows from the table above, i.e., all those where 10 %3C= start time %3C= 20.%0A     * 
 %0A     * 

Clarify ReadOnlyWindowStore's time range behaviour