-
Notifications
You must be signed in to change notification settings - Fork 15.4k
KAFKA-3705: Added a foreignKeyJoin implementation for KTable. #5527
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
64 commits
Select commit
Hold shift + click to select a range
d472a94
Merged and resolved differences. Left a number of TODOs, and now tryi…
78ccb49
oneToMany join Working, with a number of prefixScans stubbed out. Als…
b47b3e3
Changed SubscriptionResolverJoinProcessorSupplier to use the KTableVa…
3c7ad51
"Fixed" an issue where the SubscriptionResponseWrapper was sending a…
1b07216
Added the code that should support the prefixscan in the timestamped …
74f4ae8
prefixScan provisionally working on a number of previously unsupporte…
40fca2d
Populated AbstractKeyValueStoreTest.java with prefixScan tests equiva…
cb2e625
Added more tests. Incorrectly used Bytes.MAX_VALUE, replaced it with …
75ea876
Split serdes and combinedkey into their own test files. Fixed some un…
beaa82f
Enforcing co-partitioning of source topics to be identical to that of…
897fa90
Empty test, did not need
4bde43d
Rebased to the latest trunk
d687dbb
Fixed a few erroring unit tests with incorrect asserts (not sure how …
73cc69e
Potential fix for the timestamp store casting issue.
9c31fcd
Add the missing licenses
5ad29a6
Potential solution for prefixScan bug that I had introduced previousl…
8a8e10d
Reworking the test cases to better exercise all of the logical nuance…
bb84b8a
Added leftJoin for foreignKey joiner. Modified the SubscriptionWrappe…
6d80434
Added commit hash and sources to Murmur3 and Murmur3Test to indicate …
2f11d5d
Fixed all the checkstyle and spotbug issues in streams and clients. A…
fa358ce
Must add exclusions to spotbugs for the copied Murmur3 file. The good…
9f65880
Fixed a formatting failure with scala-streams. Added some clearer com…
8695037
Forgot to close the iterator after a prefixScan
c7ccdc2
...aaaaand I was missing a closing bracket... sheesh
7ec664b
Added a bunch of comments and attempted to clarify the topology by ad…
23b4e02
Reworked the Named usage in the FKjoiners to adhere much more closely…
ed11b9f
Added versions and primaryKey to SubscriptionWrapper. Removed Combine…
947cf6d
Reworked the Serdes to indicate if the hash is null, without using mo…
955cf06
Added more tests and debugged SubscriptionWrapper.java and Subscripti…
c7d8ddf
Remove errant code that wasn't supposed to be committed
19b11fe
Added handling for key == null based off of logic in KStreamSessionWi…
aff3cd9
Copartitioning works with multiple partition count for single join, b…
f15ab35
Ran checkStyleMain and corrected the style errors
ce51bf4
Removed check to see if old and newvalue are the same in prefixscan. …
10eacb2
Added some comments to help with the prefixScan readability
dfdfc34
Not a byte
6add956
Do not support multiple input topic partitions. The copartitioning lo…
b67fae8
Changed ValueMapper to Function. Also fixed a number of SpotBugs issu…
fd8394c
John Roesler's extensive simplification changes
953da3a
Merged John Roesler's extensive simplification changes into branch.
2445e87
Fixed a few minor issues with imports, Murmur3 newline, and and comme…
a8e6b40
Merge branch 'trunk' into trunk-oneToMany
0dbac68
Undoing the changes made to NamedCache since it's not required.
1678a54
Fixed a number of issues preventing the pre-build checks and the buil…
543aa4f
Merge remote-tracking branch 'source/trunk' into trunk-oneToMany
4e58aa3
Missed a dependency on merge
c69824a
Cleaning up the commit by reverting a number of unneccessary files. A…
0536c81
Remove unused code in RocksDBTimestampedStore.java
259f20e
Updated the docs for KTable
e93c25f
Reverting some unnecessary changes
811b477
Reverting more seemingly unnecessary changes.
7c7581b
Fixed some checkstyle violations
2a64bf7
Trying to revert file cause I messed it up before.. bah
ce558e8
Revert unnecessary files
8b33ffb
Change Bytes.increment to throw an exception if the incremented index…
9da1cd9
Updated the docs on Bytes.increment()
67e1ee6
A few cleanups and some extra testing based on Bill's feedback
6917848
Add javadoc for streams
1e0aaae
Added the two named options to streamsResetter
faa3cba
Added prospective code to streamsresetter, need to find the correct p…
a1e7fbb
Pass in the streamsConfig to builder.build() in the integration tests
92ab536
Merged in trunk, moved Murmur3 to use the streams version, removed gu…
4c50463
Added a comment about the foreignKey leftJoin not propagating on a nu…
6e1b6a1
Exclude tests ending in Suite in :streams project
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
84 changes: 84 additions & 0 deletions
84
clients/src/test/java/org/apache/kafka/common/utils/BytesTest.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,84 @@ | ||
| /* | ||
| * 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.common.utils; | ||
|
|
||
| import org.junit.Test; | ||
|
|
||
| import java.util.Comparator; | ||
| import java.util.NavigableMap; | ||
| import java.util.TreeMap; | ||
|
|
||
| import static org.junit.Assert.assertArrayEquals; | ||
| import static org.junit.Assert.assertThrows; | ||
| import static org.junit.Assert.assertEquals; | ||
|
|
||
| public class BytesTest { | ||
|
|
||
| @Test | ||
| public void testIncrement() { | ||
| byte[] input = new byte[]{(byte) 0xAB, (byte) 0xCD, (byte) 0xFF}; | ||
| byte[] expected = new byte[]{(byte) 0xAB, (byte) 0xCE, (byte) 0x00}; | ||
| Bytes output = Bytes.increment(Bytes.wrap(input)); | ||
| assertArrayEquals(output.get(), expected); | ||
| } | ||
|
|
||
| @Test | ||
| public void testIncrementUpperBoundary() { | ||
| byte[] input = new byte[]{(byte) 0xFF, (byte) 0xFF, (byte) 0xFF}; | ||
| assertThrows(IndexOutOfBoundsException.class, () -> Bytes.increment(Bytes.wrap(input))); | ||
| } | ||
|
|
||
| @Test | ||
| public void testIncrementWithSubmap() { | ||
| final NavigableMap<Bytes, byte[]> map = new TreeMap<>(); | ||
| Bytes key1 = Bytes.wrap(new byte[]{(byte) 0xAA}); | ||
| byte[] val = new byte[]{(byte) 0x00}; | ||
| map.put(key1, val); | ||
|
|
||
| Bytes key2 = Bytes.wrap(new byte[]{(byte) 0xAA, (byte) 0xAA}); | ||
| map.put(key2, val); | ||
|
|
||
| Bytes key3 = Bytes.wrap(new byte[]{(byte) 0xAA, (byte) 0x00, (byte) 0xFF, (byte) 0xFF, (byte) 0xFF}); | ||
| map.put(key3, val); | ||
|
|
||
| Bytes key4 = Bytes.wrap(new byte[]{(byte) 0xAB, (byte) 0x00}); | ||
| map.put(key4, val); | ||
|
|
||
| Bytes key5 = Bytes.wrap(new byte[]{(byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x01}); | ||
| map.put(key5, val); | ||
|
|
||
| Bytes prefix = key1; | ||
| Bytes prefixEnd = Bytes.increment(prefix); | ||
|
|
||
| Comparator<? super Bytes> comparator = map.comparator(); | ||
| final int result = comparator == null ? prefix.compareTo(prefixEnd) : comparator.compare(prefix, prefixEnd); | ||
| NavigableMap<Bytes, byte[]> subMapResults; | ||
| if (result > 0) { | ||
| //Prefix increment would cause a wrap-around. Get the submap from toKey to the end of the map | ||
| subMapResults = map.tailMap(prefix, true); | ||
| } else { | ||
| subMapResults = map.subMap(prefix, true, prefixEnd, false); | ||
| } | ||
|
|
||
| NavigableMap<Bytes, byte[]> subMapExpected = new TreeMap<>(); | ||
| subMapExpected.put(key1, val); | ||
| subMapExpected.put(key2, val); | ||
| subMapExpected.put(key3, val); | ||
|
|
||
| assertEquals(subMapExpected.keySet(), subMapResults.keySet()); | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.