-
Notifications
You must be signed in to change notification settings - Fork 5
V3 casl 1220 migrate dh connector tov3 #518
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
Conversation
Signed-off-by: Marcin-Here <[email protected]>
Signed-off-by: Marcin-Here <[email protected]>
| } | ||
|
|
||
| @JsonView(ExcludeFromHash.class) | ||
| @JsonProperty("streamId") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you use this class (com.here.naksha.lib.core.models.payload.Event) somehow?
Afaik most if not all of its subclasses are effectively dead I was strongly considering removing it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
as discussed - check possibility of moving these events to storage-http module
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Those are coupled with other classes from lib.core.payload packages. Which are coupled with other classes from lib.core. That probably is doable but it would take longer time.
|
|
||
| public enum HttpInterface { | ||
| ffwAdapter, | ||
| dataHubConnector |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lowercased enum :(
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it design decision from v2. Because we get that interface from storage properties like: "properties": { "httpInterface" : "dataHubConnector", so to not translate camelCase to UPPPER_SNAKE.
| public PropertyQuery() {} | ||
|
|
||
| public PropertyQuery(@NotNull String key, @NotNull QueryOperation op) {} | ||
| public PropertyQuery(@NotNull String key, @NotNull QueryOperation op) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this class might also be moved to the http module as it serves only "dto" purposes
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Those are coupled with other classes from lib.core.payload packages. Which are coupled with other classes from lib.core. That probably is doable but it would take longer time.
| setQueryParameters(Map.of(key, parameters)); | ||
| return this; | ||
| } | ||
| getQueryParameters().put(key, parameters); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nth: getQueryParameters could be called once in this method
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
...naksha-storage-http/src/jvmMain/java/com/here/naksha/storage/http/HttpStorageProperties.java
Show resolved
Hide resolved
| event.setQuadkey(tileAddress.asQuadkey()); | ||
| return event; | ||
| } else { | ||
| throw new NotImplementedException("Tile type other than " + TILE_TYPE_QUADKEY); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe let's stick to NakshaException
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
| private void assertNoUuid(NakshaFeature feature) { | ||
| String id = feature.getId(); | ||
| if (feature.getProperties().getXyz().getUuid() != null) { | ||
| throw new IllegalArgumentException("The feature with id " + id + " cannot be created. " |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are we recapturing these exceptions? If not, I would use NakshaException if there's no bigger issue with that
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
| } | ||
| } | ||
|
|
||
| private NakshaFeatureList getFeaturesFromDb(List<String> featureIds) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So in getFeaturesFromDb we actually execute a HTTP call to a REST service? 🙃
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
| private final WriteRequest request; | ||
| private final RequestSender sender; | ||
| private final String endpoint; | ||
| private final Map<String, NakshaFeature> databaseFeaturesCache = new HashMap<>(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are we sure that in V3, with TupleCache and all, this cache is required as well? It's worth checking if we're not storing the same stuff in memory twice
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think TupleCache store to cache only on PG calls. In HttpStorage we have constant 21 features in cache, which are defaults from admin storage and storage, handler and space that we are using for DH connector.
|
|
||
| private IPropertyQueryToPropertiesQuery() {} | ||
|
|
||
| public static PropertyQueryOr toPopQueryOr(@NotNull IPropertyQuery query) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This public utility method has no tests
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
Signed-off-by: Marcin-Here <[email protected]>
* CASL-1220: migrated DH connector to v3. Signed-off-by: Marcin-Here <[email protected]> * CASL-1220: added empty tags handling removed unused imports Signed-off-by: Marcin-Here <[email protected]> * CASL-1220: review comments fixes. Signed-off-by: Marcin-Here <[email protected]> --------- Signed-off-by: Marcin-Here <[email protected]>
No description provided.