Open
Conversation
Contributor
vitaxa
commented
Feb 25, 2026
- change currency rate events
- flywaydb clickhouse support
flywaydb clickhouse support
src/main/resources/db/migration-clickhouse/V1__create_tables.sql
Outdated
Show resolved
Hide resolved
strug
reviewed
Mar 3, 2026
| } | ||
|
|
||
| private String resolveClickHouseMigrationLocation(String schemaMode) { | ||
| return switch (schemaMode.toLowerCase(Locale.ROOT)) { |
Contributor
There was a problem hiding this comment.
выше уже был toLowerCase оставил бы только выше
|
|
||
| private String resolveClickHouseMigrationLocation(String schemaMode) { | ||
| return switch (schemaMode.toLowerCase(Locale.ROOT)) { | ||
| case "non-sharded" -> "classpath:db/migration-clickhouse/non-sharded"; |
Contributor
There was a problem hiding this comment.
и "non-sharded" и значение лучше вообще в переменную
Comment on lines
+105
to
+107
| if ("non-sharded".equals(schemaMode)) { | ||
| return Map.of(); | ||
| } |
Contributor
There was a problem hiding this comment.
это можно просто удалить результат будет тот же
Comment on lines
+110
to
+117
| validateRequiredShardedProperty("clickhouse.flyway.sharded.cluster", shardedCluster); | ||
| validateRequiredShardedProperty("clickhouse.flyway.sharded.shard", shardedShard); | ||
| validateRequiredShardedProperty("clickhouse.flyway.sharded.replica", shardedReplica); | ||
| return Map.of( | ||
| "cluster", shardedCluster, | ||
| "shard", shardedShard, | ||
| "replica", shardedReplica); | ||
| } |
Contributor
There was a problem hiding this comment.
тоже бы константы какие то сделать и переменные
Comment on lines
+18
to
+26
| if (!event.isSetPayload()) { | ||
| log.warn("CurrencyEvent payload not set, eventId={}", event.getEventId()); | ||
| return null; | ||
| } | ||
| CurrencyEventPayload payload = event.getPayload(); | ||
| if (!payload.isSetExchangeRate()) { | ||
| log.warn("CurrencyEvent payload is not exchange_rate, eventId={}", event.getEventId()); | ||
| return null; | ||
| } |
Contributor
There was a problem hiding this comment.
может в один объединить а то чет тянется и весь payload отлогировать
Comment on lines
+44
to
+57
| if (sourceCurrency == null || !sourceCurrency.isSetSymbolicCode() || !sourceCurrency.isSetExponent()) { | ||
| log.warn("CurrencyEvent source currency incomplete, eventId={}", event.getEventId()); | ||
| return null; | ||
| } | ||
| if (destinationCurrency == null | ||
| || !destinationCurrency.isSetSymbolicCode() | ||
| || !destinationCurrency.isSetExponent()) { | ||
| log.warn("CurrencyEvent destination currency incomplete, eventId={}", event.getEventId()); | ||
| return null; | ||
| } | ||
| if (rational == null || !rational.isSetP() || !rational.isSetQ()) { | ||
| log.warn("CurrencyEvent exchange rate rational incomplete, eventId={}", event.getEventId()); | ||
| return null; | ||
| } |
Contributor
There was a problem hiding this comment.
тоже хорошо схлопывается и просто понятные методы isSetCurrency например которые целое условие проверяет для каждого
strug
approved these changes
Mar 3, 2026
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.