Skip to content

KAFKA-3522: Interactive Queries must return timestamped stores#6661

Merged
bbejeck merged 2 commits into
apache:trunkfrom
mjsax:kafka-3522-add-iq-code
May 7, 2019
Merged

KAFKA-3522: Interactive Queries must return timestamped stores#6661
bbejeck merged 2 commits into
apache:trunkfrom
mjsax:kafka-3522-add-iq-code

Conversation

@mjsax

@mjsax mjsax commented May 2, 2019

Copy link
Copy Markdown
Member

More detailed description of your change,
if necessary. The PR title and PR message become
the squashed commit message, so use a separate
comment to ping reviewers.

Summary of testing strategy (including rationale)
for the feature or bug fix. Unit and/or integration
tests are expected for any behaviour change and
system tests should be considered for larger changes.

Committer Checklist (excluded from commit message)

  • Verify design and implementation
  • Verify test coverage and CI build status
  • Verify documentation (including upgrade notes)

@mjsax mjsax added the streams label May 2, 2019
@mjsax

mjsax commented May 2, 2019

Copy link
Copy Markdown
Member Author

@abbccdda

abbccdda commented May 2, 2019

Copy link
Copy Markdown

Minor: s/KAFAK-3522/KAFKA-3522

@mjsax mjsax changed the title KAFAK-3522: Interactive Queries must return timestamped stores KAFKA-3522: Interactive Queries must return timestamped stores May 2, 2019
@mjsax

mjsax commented May 2, 2019

Copy link
Copy Markdown
Member Author

Java11 failed with env issue. Java8 passed. Waiting for a review before retriggering the tests.

@bbejeck bbejeck left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I've made a pass I just have a couple of minor comments otherwise this LGTM

if (!store.isOpen()) {
throw new InvalidStateStoreException("the state store, " + storeName + ", is not open.");
}
if (store instanceof TimestampedKeyValueStore && queryableStoreType instanceof QueryableStoreTypes.KeyValueStoreType) {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

nit: Since TimestampedKeyValueStore is always present in the if statement, I'm wondering if

if (store instanceof TimestampedKeyValueStore ) {
   if( store instanceof  QueryableStoreTypes.KeyValueStoreType) {
       return ....
    }
   if( store instanceof  QueryableStoreTypes.WindowStoreType) {
       return ....
    }
}

Would be easier to read. But this is a subjective comment, so feel free to accept or not.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

The second check is actually using TimestampedWindowStore, not TimestampedKeyValueStore. Or do I miss-understand your comment?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Ack, my mistake in reading

" because the store is not open. The state store may have migrated to another instances.");
}
stores.add((T) store);
if (store instanceof TimestampedKeyValueStore && queryableStoreType instanceof QueryableStoreTypes.KeyValueStoreType) {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

same here

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

TimestampedKeyValueStore vs TimestampedWindowStore -- or please elaborate.

Or do you refer to missing tests? Those seems to be there actually:

  • shouldFindTimestampedKeyValueStoresAsKeyValueStores()
  • shouldFindTimestampedWindowStoresAsWindowStore()

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

referring to my previous comments about the if/else but again I read to quickly

}
if (store instanceof TimestampedKeyValueStore && queryableStoreType instanceof QueryableStoreTypes.KeyValueStoreType) {
return (List<T>) Collections.singletonList(new ReadOnlyKeyValueStoreFacade((TimestampedKeyValueStore<Object, Object>) store));
} else if (store instanceof TimestampedWindowStore && queryableStoreType instanceof QueryableStoreTypes.WindowStoreType) {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

super nit: while I don't believe in 100% test coverage, this line isn't covered by the tests

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Good catch! This slipped. Will add a test (I do believe ;) )

@mjsax

mjsax commented May 2, 2019

Copy link
Copy Markdown
Member Author

Updated this.

@vvcephei vvcephei left a comment

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.

Thanks, @mjsax !

@mjsax

mjsax commented May 7, 2019

Copy link
Copy Markdown
Member Author

Java11 failed. Test results not available any longer. Java8 passed.

Retest this please.

@bbejeck bbejeck left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM

if (!store.isOpen()) {
throw new InvalidStateStoreException("the state store, " + storeName + ", is not open.");
}
if (store instanceof TimestampedKeyValueStore && queryableStoreType instanceof QueryableStoreTypes.KeyValueStoreType) {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Ack, my mistake in reading

" because the store is not open. The state store may have migrated to another instances.");
}
stores.add((T) store);
if (store instanceof TimestampedKeyValueStore && queryableStoreType instanceof QueryableStoreTypes.KeyValueStoreType) {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

referring to my previous comments about the if/else but again I read to quickly

@bbejeck bbejeck merged commit a6d5efa into apache:trunk May 7, 2019
@bbejeck

bbejeck commented May 7, 2019

Copy link
Copy Markdown
Member

Merged #6661 into trunk.

ijuma added a commit to ijuma/kafka that referenced this pull request May 8, 2019
…s-hashcode

* apache-github/trunk:
  KAFKA-8158: Add EntityType for Kafka RPC fields (apache#6503)
  MINOR: correctly parse version OffsetCommitResponse version < 3
  KAFKA-8284: enable static membership on KStream (apache#6673)
  KAFKA-8304: Fix registration of Connect REST extensions (apache#6651)
  KAFKA-8275; Take throttling into account when choosing least loaded node (apache#6619)
  KAFKA-3522: Interactive Queries must return timestamped stores (apache#6661)
  MINOR: MetricsIntegrationTest should set StreamsConfig.STATE_DIR_CONFIG (apache#6687)
  MINOR: Remove unused field in `ListenerConnectionQuota`
  KAFKA-8131; Move --version implementation into CommandLineUtils (apache#6481)
  KAFKA-8056; Use automatic RPC generation for FindCoordinator (apache#6408)
  MINOR: Remove workarounds for lz4-java bug affecting byte buffers (apache#6679)
  KAFKA-7455: Support JmxTool to connect to a secured RMI port. (apache#5968)
  MINOR: Document improvement (apache#6682)
  MINOR: Fix ThrottledReplicaListValidator doc error. (apache#6537)
  KAFKA-8306; Initialize log end offset accurately when start offset is non-zero (apache#6652)
pengxiaolong pushed a commit to pengxiaolong/kafka that referenced this pull request Jun 14, 2019
…e#6661)

Reviewers: John Roesler <john@confluent.io>,  Bill Bejeck <bbejeck@gmail.com>
@mjsax mjsax deleted the kafka-3522-add-iq-code branch August 21, 2019 17:33
@mjsax mjsax added the kip Requires or implements a KIP label Jun 12, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

kip Requires or implements a KIP streams

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants