kafka-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From guozh...@apache.org
Subject kafka git commit: MINOR: improve StateStore JavaDocs
Date Fri, 17 Nov 2017 19:49:21 GMT
Repository: kafka
Updated Branches:
  refs/heads/1.0 d3c46ceb7 -> 06e662c0f


MINOR: improve StateStore JavaDocs

Clarify that state directory must use `storeName`

Author: Matthias J. Sax <matthias@confluent.io>

Reviewers: Bill Bejeck <bill@confluent.io>, Guozhang Wang <wangguoz@gmail.com>

Closes #4228 from mjsax/minor-state-store-javadoc

(cherry picked from commit b604540fbde818025afac85c3e96be76f212503e)
Signed-off-by: Guozhang Wang <wangguoz@gmail.com>


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

Branch: refs/heads/1.0
Commit: 06e662c0fd527c1175008f31cb8a9ba9c0c5ddb6
Parents: d3c46ce
Author: Matthias J. Sax <matthias@confluent.io>
Authored: Fri Nov 17 11:49:09 2017 -0800
Committer: Guozhang Wang <wangguoz@gmail.com>
Committed: Fri Nov 17 11:49:18 2017 -0800

----------------------------------------------------------------------
 .../org/apache/kafka/streams/processor/StateStore.java | 13 +++++++++++--
 1 file changed, 11 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/kafka/blob/06e662c0/streams/src/main/java/org/apache/kafka/streams/processor/StateStore.java
----------------------------------------------------------------------
diff --git a/streams/src/main/java/org/apache/kafka/streams/processor/StateStore.java b/streams/src/main/java/org/apache/kafka/streams/processor/StateStore.java
index cb8139c..f098cd0 100644
--- a/streams/src/main/java/org/apache/kafka/streams/processor/StateStore.java
+++ b/streams/src/main/java/org/apache/kafka/streams/processor/StateStore.java
@@ -20,13 +20,22 @@ import org.apache.kafka.streams.errors.StreamsException;
 
 /**
  * A storage engine for managing state maintained by a stream processor.
- *
+ * <p>
+ * If the store is implemented as a persistent store, it <em>must</em> use the
store name as directory name and write
+ * all data into this store directory.
+ * The store directory must be created with the state directory.
+ * The state directory can be obtained via {@link ProcessorContext#stateDir() #stateDir()}
using the
+ * {@link ProcessorContext} provided via {@link #init(ProcessorContext, StateStore) init(...)}.
+ * <p>
+ * Using nested store directories within the state directory isolates different state stores.
+ * If a state store would write into the state directory directly, it might conflict with
others state stores and thus,
+ * data might get corrupted and/or Streams might fail with an error.
+ * Furthermore, Kafka Streams relies on using the store name as store directory name to perform
internal cleanup tasks.
  * <p>
  * This interface does not specify any query capabilities, which, of course,
  * would be query engine specific. Instead it just specifies the minimum
  * functionality required to reload a storage engine from its changelog as well
  * as basic lifecycle management.
- * </p>
  */
 public interface StateStore {
 


Mime
View raw message