You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@kafka.apache.org by ij...@apache.org on 2017/04/06 13:45:04 UTC

kafka git commit: MINOR: Clarify ReadOnlyWindowStore's time range behaviour

Repository: kafka
Updated Branches:
  refs/heads/trunk 6ba98f6e5 -> b611cfa5c


MINOR: Clarify ReadOnlyWindowStore's time range behaviour

Highlight that the range in `fetch` is inclusive of both `timeFrom` and `timeTo`

Author: Damian Guy <da...@gmail.com>

Reviewers: Michael G. Noll <mi...@confluent.io>, Matthias J. Sax <ma...@confluent.io>, Ismael Juma <is...@juma.me.uk>

Closes #2811 from dguy/minor-window-fetch-java-doc


Project: http://git-wip-us.apache.org/repos/asf/kafka/repo
Commit: http://git-wip-us.apache.org/repos/asf/kafka/commit/b611cfa5
Tree: http://git-wip-us.apache.org/repos/asf/kafka/tree/b611cfa5
Diff: http://git-wip-us.apache.org/repos/asf/kafka/diff/b611cfa5

Branch: refs/heads/trunk
Commit: b611cfa5c0f4941a491781424afd9b699bdb894e
Parents: 6ba98f6
Author: Damian Guy <da...@gmail.com>
Authored: Thu Apr 6 14:44:40 2017 +0100
Committer: Ismael Juma <is...@juma.me.uk>
Committed: Thu Apr 6 14:44:40 2017 +0100

----------------------------------------------------------------------
 .../streams/state/ReadOnlyWindowStore.java      | 21 +++++++++++++++++++-
 1 file changed, 20 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/kafka/blob/b611cfa5/streams/src/main/java/org/apache/kafka/streams/state/ReadOnlyWindowStore.java
----------------------------------------------------------------------
diff --git a/streams/src/main/java/org/apache/kafka/streams/state/ReadOnlyWindowStore.java b/streams/src/main/java/org/apache/kafka/streams/state/ReadOnlyWindowStore.java
index 3606c57..1472d74 100644
--- a/streams/src/main/java/org/apache/kafka/streams/state/ReadOnlyWindowStore.java
+++ b/streams/src/main/java/org/apache/kafka/streams/state/ReadOnlyWindowStore.java
@@ -32,7 +32,26 @@ public interface ReadOnlyWindowStore<K, V> {
     /**
      * Get all the key-value pairs with the given key and the time range from all
      * the existing windows.
-     *
+     * <p>
+     * The time range is inclusive and applies to the starting timestamp of the window.
+     * For example, if we have the following windows:
+     * <p>
+     * <pre>
+     * +-------------------------------+
+     * |  key  | start time | end time |
+     * +-------+------------+----------+
+     * |   A   |     10     |    20    |
+     * +-------+------------+----------+
+     * |   A   |     15     |    25    |
+     * +-------+------------+----------+
+     * |   A   |     20     |    30    |
+     * +-------+------------+----------+
+     * |   A   |     25     |    35    |
+     * +--------------------------------
+     * </pre>
+     * And we call {@code store.fetch("A", 10, 20)} then the results will contain the first
+     * three windows from the table above, i.e., all those where 10 <= start time <= 20.
+     * 
      * @return an iterator over key-value pairs {@code <timestamp, value>}
      * @throws InvalidStateStoreException if the store is not initialized
      */