Skip to content
This repository was archived by the owner on Nov 12, 2024. It is now read-only.

name kafka streams topology nodes appropriately#79

Merged
laxmanchekka merged 3 commits intomainfrom
ENG-35206
Sep 27, 2023
Merged

name kafka streams topology nodes appropriately#79
laxmanchekka merged 3 commits intomainfrom
ENG-35206

Conversation

@laxmanchekka
Copy link
Copy Markdown
Contributor

No description provided.

@laxmanchekka laxmanchekka requested a review from a team as a code owner September 27, 2023 15:17
@github-actions

This comment has been minimized.

inputTopics.addAll(viewGenConfig.getStringList(INPUT_TOPICS_CONFIG_KEY));
}
return inputTopics.stream().collect(Collectors.toList());
return new ArrayList<>(inputTopics);
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.

nit - why this change? List.copyOf (unless we're intentionally making this mutable)

That said, we should make this deterministic and avoid the hash set here.

(same comment below)

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.

why this change?

Intellij suggestion

avoid the hash set here

set needed as input topic across all viewgens is same and we need to add only one source per input topic.

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.

set needed as input topic across all viewgens is same and we need to add only one source per input topic.

So we have a uniqueness requirement, not a set it sounds like. Using a hash set means that different runs with the same input will return their outputs in a different order. Even if that's not impactful today, it's a bad practice and makes writing tests annoying. Suggest any of

  • use a list, than run distinct on it
  • use an insertion-ordered set (e.g. guava's or linkedhashset I believe)
  • use streams e.g.
return getViewGenName(properties)
  .stream()
  .map(viewGenConfigs::get)
  .map(config -> config.getStringList(INPUT_TOPICS_CONFIG_KEY))
  .flatMap(Collection::stream)
  .distinct()
  .collect(Collectors.toUnmodifiableList());

Copy link
Copy Markdown
Contributor Author

@laxmanchekka laxmanchekka Sep 27, 2023

Choose a reason for hiding this comment

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

Why not a TreeSet?
Set for me ensures uniqueness and TreeSet ensures sorted ordering (for tests thingy you mentioned).

Looks simpler and much readable than the streams snippet in the suggestion.

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.

Looks simpler and much readable than the streams snippet in the suggestion.

matter of opinion! but yes, any ordered set will do for repeatability, doesn't need to be insertion ordered - I was just trying to match the perceived intent.

@github-actions

This comment has been minimized.

@codecov
Copy link
Copy Markdown

codecov Bot commented Sep 27, 2023

Codecov Report

Merging #79 (dd9984e) into main (f95c57f) will increase coverage by 0.03%.
The diff coverage is 73.33%.

@@             Coverage Diff              @@
##               main      #79      +/-   ##
============================================
+ Coverage     75.50%   75.54%   +0.03%     
  Complexity      148      148              
============================================
  Files            15       15              
  Lines           641      642       +1     
  Branches         64       64              
============================================
+ Hits            484      485       +1     
  Misses          118      118              
  Partials         39       39              
Flag Coverage Δ
unit 75.54% <73.33%> (+0.03%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files Coverage Δ
...viewgenerator/service/ViewGenerationProcessor.java 79.16% <100.00%> (ø)
...e/viewgenerator/service/ViewGeneratorLauncher.java 74.46% <100.00%> (+1.74%) ⬆️
...wgenerator/service/MultiViewGeneratorLauncher.java 64.10% <0.00%> (ø)

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@github-actions

This comment has been minimized.

@laxmanchekka
Copy link
Copy Markdown
Contributor Author

fixed the comments and vulnerabilities.

@laxmanchekka laxmanchekka merged commit e52e516 into main Sep 27, 2023
@laxmanchekka laxmanchekka deleted the ENG-35206 branch September 27, 2023 16:56
@github-actions
Copy link
Copy Markdown

Unit Test Results

  7 files  ±0    7 suites  ±0   11s ⏱️ -1s
14 tests ±0  14 ✔️ ±0  0 💤 ±0  0 ❌ ±0 

Results for commit e52e516. ± Comparison against base commit f95c57f.

implementation("com.typesafe:config:1.4.1")
compileOnly("org.projectlombok:lombok:1.18.26")
annotationProcessor("org.projectlombok:lombok:1.18.26")
implementation("org.slf4j:slf4j-api:2.0.5")
Copy link
Copy Markdown
Contributor

@satish-mittal satish-mittal Oct 4, 2023

Choose a reason for hiding this comment

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

After this change, hypertrace/hypertrace-ingestor transitively loads slf4j-api:2.0.5 via dependency on hypertrace/view-generator-framework, but internally it still uses log4j-slf4j-impl instead of slf4j2. That led to failure of integration tests in QS which loads container "hypertrace/hypertrace-view-generator:main".

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.

Raised PR to fix it: hypertrace/hypertrace-ingester#425

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants