Skip to content

KAFKA-3452 Follow-up: Refactoring StateStore hierarchies#2360

Closed
dguy wants to merge 4 commits intoapache:trunkfrom
dguy:state-store-refactor
Closed

KAFKA-3452 Follow-up: Refactoring StateStore hierarchies#2360
dguy wants to merge 4 commits intoapache:trunkfrom
dguy:state-store-refactor

Conversation

@dguy
Copy link
Copy Markdown
Contributor

@dguy dguy commented Jan 12, 2017

This is a follow up of #2166 - refactoring the store hierarchies as requested

@dguy
Copy link
Copy Markdown
Contributor Author

dguy commented Jan 12, 2017

@guozhangwang, @mjsax, @enothereska - this is the refactor of the store hierarchies along the lines of the suggestions made by @guozhangwang

@asfbot
Copy link
Copy Markdown

asfbot commented Jan 12, 2017

Refer to this link for build results (access rights to CI server needed):
https://builds.apache.org/job/kafka-pr-jdk8-scala2.12/806/
Test PASSed (JDK 8 and Scala 2.12).

@asfbot
Copy link
Copy Markdown

asfbot commented Jan 12, 2017

Refer to this link for build results (access rights to CI server needed):
https://builds.apache.org/job/kafka-pr-jdk8-scala2.11/808/
Test PASSed (JDK 8 and Scala 2.11).

@asfbot
Copy link
Copy Markdown

asfbot commented Jan 12, 2017

Refer to this link for build results (access rights to CI server needed):
https://builds.apache.org/job/kafka-pr-jdk7-scala2.10/806/
Test FAILed (JDK 7 and Scala 2.10).

@asfbot
Copy link
Copy Markdown

asfbot commented Jan 16, 2017

Refer to this link for build results (access rights to CI server needed):
https://builds.apache.org/job/kafka-pr-jdk7-scala2.10/908/
Test FAILed (JDK 7 and Scala 2.10).

@asfbot
Copy link
Copy Markdown

asfbot commented Jan 16, 2017

Refer to this link for build results (access rights to CI server needed):
https://builds.apache.org/job/kafka-pr-jdk8-scala2.12/908/
Test PASSed (JDK 8 and Scala 2.12).

@asfbot
Copy link
Copy Markdown

asfbot commented Jan 16, 2017

Refer to this link for build results (access rights to CI server needed):
https://builds.apache.org/job/kafka-pr-jdk8-scala2.11/910/
Test FAILed (JDK 8 and Scala 2.11).

Copy link
Copy Markdown
Contributor

@guozhangwang guozhangwang left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I feel myself is not the ideal reviewer since I'm too familiar to most of the changes. I focused on the added unit tests, besides I left some discussion questions.

import org.apache.kafka.streams.state.WindowStore;
import org.apache.kafka.streams.state.WindowStoreIterator;

public class MeteredWindowStore<K, V> implements WindowStore<K, V> {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was a bit pondering on this function: for window and session store RocksDB impl, its wrapping hierarchy is a bit different with the key-value store, as it is

caching -> window -> metered-segmented -> changelog-segmented -> raw-segmented (rocksdb)

Where key-value store hierarchy is

caching -> metered -> changelog -> rocksdb

If users provide a customized window store implementation, I think it would be similar to key-value as

caching -> metered -> changelogged -> user-provided window-store

I think case we still need to provide the MeteredWindowStore and ChangeLoggingWindowStore wrappers. WDYT?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If people provide their own store implementations, then we aren't wrapping them at all at the moment. They would provide a custom StateStoreSupplier and we just call that to get the store.
The question is do we want to have code that we don't use, yet? Should we just add them back if we ever provide a way to wrap the store that is created from a custom StateStoreSupplier?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sounds good. Let's worry about that later.

private final String name;
private final Segments segments;
private final KeySchema keySchema;
private final boolean loggingEnabled;
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As we discussed before, this seems not needed any more?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep - i removed it already


public RocksDBStore(String name, Serde<K> keySerde, Serde<V> valueSerde) {
this(name, DB_FILE_DIR, keySerde, valueSerde);
public RocksDBStore(final String name,
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should be able to remove logging out of RocksDBStore now, right?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah - i've done that. Though it looks like i forgot to remove the field

@asfbot
Copy link
Copy Markdown

asfbot commented Jan 17, 2017

Refer to this link for build results (access rights to CI server needed):
https://builds.apache.org/job/kafka-pr-jdk8-scala2.11/926/
Test PASSed (JDK 8 and Scala 2.11).

@asfbot
Copy link
Copy Markdown

asfbot commented Jan 17, 2017

Refer to this link for build results (access rights to CI server needed):
https://builds.apache.org/job/kafka-pr-jdk7-scala2.10/924/
Test FAILed (JDK 7 and Scala 2.10).

@asfbot
Copy link
Copy Markdown

asfbot commented Jan 17, 2017

Refer to this link for build results (access rights to CI server needed):
https://builds.apache.org/job/kafka-pr-jdk8-scala2.12/924/
Test FAILed (JDK 8 and Scala 2.12).

@guozhangwang
Copy link
Copy Markdown
Contributor

retest this please.

@asfbot
Copy link
Copy Markdown

asfbot commented Jan 17, 2017

Refer to this link for build results (access rights to CI server needed):
https://builds.apache.org/job/kafka-pr-jdk8-scala2.11/943/
Test FAILed (JDK 8 and Scala 2.11).

@asfbot
Copy link
Copy Markdown

asfbot commented Jan 17, 2017

Refer to this link for build results (access rights to CI server needed):
https://builds.apache.org/job/kafka-pr-jdk8-scala2.12/941/
Test PASSed (JDK 8 and Scala 2.12).

@asfbot
Copy link
Copy Markdown

asfbot commented Jan 17, 2017

Refer to this link for build results (access rights to CI server needed):
https://builds.apache.org/job/kafka-pr-jdk7-scala2.10/941/
Test PASSed (JDK 7 and Scala 2.10).

asfgit pushed a commit that referenced this pull request Jan 17, 2017
This is a follow up of #2166 - refactoring the store hierarchies as requested

Author: Damian Guy <damian.guy@gmail.com>

Reviewers: Guozhang Wang <wangguoz@gmail.com>

Closes #2360 from dguy/state-store-refactor

(cherry picked from commit 73b7ae0)
Signed-off-by: Guozhang Wang <wangguoz@gmail.com>
@asfgit asfgit closed this in 73b7ae0 Jan 17, 2017
@guozhangwang
Copy link
Copy Markdown
Contributor

LGTM and merged to trunk, piggy-backed to 0.10.2.

@dguy dguy deleted the state-store-refactor branch January 19, 2017 11:40
soenkeliebau pushed a commit to soenkeliebau/kafka that referenced this pull request Feb 7, 2017
This is a follow up of apache#2166 - refactoring the store hierarchies as requested

Author: Damian Guy <damian.guy@gmail.com>

Reviewers: Guozhang Wang <wangguoz@gmail.com>

Closes apache#2360 from dguy/state-store-refactor
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants