Skip to content

Conversation

@Marcin-Here
Copy link
Contributor

No description provided.

@Marcin-Here Marcin-Here requested a review from Amaneusz October 1, 2025 10:15
}

@JsonView(ExcludeFromHash.class)
@JsonProperty("streamId")
Copy link
Contributor

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.

Copy link
Contributor

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

Copy link
Contributor Author

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
Copy link
Contributor

Choose a reason for hiding this comment

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

lowercased enum :(

Copy link
Contributor Author

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) {
Copy link
Contributor

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

Copy link
Contributor Author

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);
Copy link
Contributor

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

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

event.setQuadkey(tileAddress.asQuadkey());
return event;
} else {
throw new NotImplementedException("Tile type other than " + TILE_TYPE_QUADKEY);
Copy link
Contributor

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

Copy link
Contributor Author

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. "
Copy link
Contributor

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

Copy link
Contributor Author

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) {
Copy link
Contributor

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? 🙃

Copy link
Contributor Author

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<>();
Copy link
Contributor

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

Copy link
Contributor Author

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) {
Copy link
Contributor

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

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

@Marcin-Here Marcin-Here merged commit 5cd4e61 into v3 Oct 3, 2025
3 checks passed
@Marcin-Here Marcin-Here deleted the V3_CASL-1220_migrate_DH_connector_tov3 branch October 3, 2025 13:59
czyz-bartosz pushed a commit that referenced this pull request Oct 28, 2025
* 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]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants