Skip to content
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

V3 fix storage-http compiler errors #379

Open
wants to merge 60 commits into
base: v3
Choose a base branch
from
Open

V3 fix storage-http compiler errors #379

wants to merge 60 commits into from

Conversation

gunplar
Copy link
Collaborator

@gunplar gunplar commented Nov 11, 2024

No description provided.

# Conflicts:
#	here-naksha-lib-view/src/main/java/com/here/naksha/lib/view/View.java
#	here-naksha-lib-view/src/main/java/com/here/naksha/lib/view/ViewReadSession.java
#	here-naksha-lib-view/src/main/java/com/here/naksha/lib/view/ViewWriteSession.java
#	here-naksha-lib-view/src/main/java/com/here/naksha/lib/view/concurrent/LayerReadRequest.java
#	here-naksha-lib-view/src/main/java/com/here/naksha/lib/view/concurrent/LayerRequest.java
#	here-naksha-lib-view/src/main/java/com/here/naksha/lib/view/concurrent/ParallelQueryExecutor.java
# Conflicts:
#	here-naksha-lib-model/src/commonMain/kotlin/naksha/model/request/SuccessResponse.kt
#	here-naksha-lib-view/src/main/java/com/here/naksha/lib/view/LayerWriteFeatureRequest.java
#	here-naksha-lib-view/src/main/java/com/here/naksha/lib/view/ViewReadSession.java
#	here-naksha-lib-view/src/main/java/com/here/naksha/lib/view/ViewWriteSession.java
#	here-naksha-lib-view/src/main/java/com/here/naksha/lib/view/concurrent/ParallelQueryExecutor.java
#	here-naksha-lib-view/src/main/java/com/here/naksha/lib/view/missing/ObligatoryLayersResolver.java
#	here-naksha-lib-view/src/test/java/com/here/naksha/lib/view/MockReadSession.java
#	here-naksha-lib-view/src/test/java/com/here/naksha/lib/view/PsqlTests.java
#	here-naksha-lib-view/src/test/java/com/here/naksha/lib/view/PsqlViewTests.java
#	here-naksha-lib-view/src/test/java/com/here/naksha/lib/view/Sample.java
#	here-naksha-lib-view/src/test/java/com/here/naksha/lib/view/ViewTest.java
#	here-naksha-lib-view/src/test/java/com/here/naksha/lib/view/ViewWriteSessionTests.java
#	here-naksha-lib-view/src/test/java/com/here/naksha/lib/view/merge/MergeByStoragePriorityTest.java
#	here-naksha-lib-view/src/test/java/com/here/naksha/lib/view/missing/ObligatoryLayersResolverTest.java
# Conflicts:
#	here-naksha-storage-http/src/main/java/com/here/naksha/storage/http/HttpStorage.java
#	here-naksha-storage-http/src/main/java/com/here/naksha/storage/http/HttpStorageProperties.java
#	here-naksha-storage-http/src/main/java/com/here/naksha/storage/http/HttpStorageReadExecute.java
#	here-naksha-storage-http/src/main/java/com/here/naksha/storage/http/HttpStorageReadSession.java
#	here-naksha-storage-http/src/main/java/com/here/naksha/storage/http/PrepareResult.java
Copy link

Code Coverage

Overall Project 31.1% -0.05% 🍏
Files changed 0% 🍏

Module Coverage
here-naksha-lib-view 83.39% -2.51% 🍏
Files
Module File Coverage
here-naksha-lib-view ViewReadSession.java 75.69% -7.29% 🍏

Copy link

Code Coverage

Overall Project 31.1% -0.05% 🍏
Files changed 0% 🍏

Module Coverage
here-naksha-lib-view 83.39% -2.51% 🍏
Files
Module File Coverage
here-naksha-lib-view ViewReadSession.java 75.69% -7.29% 🍏

Copy link

Code Coverage

Overall Project 30.77% -0.67% 🍏
Files changed 20.4% 🍏

Module Coverage
here-naksha-lib-view 83.39% -2.51% 🍏
here-naksha-storage-http 18.06% -25.12% 🍏
Files
Module File Coverage
here-naksha-lib-view ViewReadSession.java 75.69% -7.29% 🍏
here-naksha-storage-http HttpStorageProperties.java 100% 🍏
RequestSenderCache.java 75.81% 🍏
RequestSender.java 34% -3.2% 🍏
HttpStorageReadExecute.java 0% -15.89% 🍏
HttpStorageReadSession.java 0% -71.83% 🍏
HttpStorage.java 0% -69.4% 🍏
PrepareResult.java 0% -37.84% 🍏

Copy link

Code Coverage

Overall Project 30.7% -0.87% 🍏
Files changed 16.12% 🍏

Module Coverage
here-naksha-lib-view 83.39% -2.51% 🍏
here-naksha-storage-http 16.44% -30.7% 🍏
Files
Module File Coverage
here-naksha-lib-view ViewReadSession.java 75.69% -7.29% 🍏
here-naksha-storage-http HttpStorageProperties.java 100% 🍏
RequestSenderCache.java 75.81% 🍏
RequestSender.java 33.47% -3.19% 🍏
HttpStorageReadExecute.java 0% -15.89% 🍏
HttpStorageReadSession.java 0% -80.91% 🍏
HttpStorage.java 0% -76.97% 🍏
PrepareResult.java 0% -37.84% 🍏

@gunplar gunplar requested review from adamczyk-HERE, hirenkp2000 and Amaneusz and removed request for adamczyk-HERE November 12, 2024 14:15
Copy link

Code Coverage

Overall Project 30.71% -0.87% 🍏
Files changed 16.12% 🍏

Module Coverage
here-naksha-lib-view 83.39% -2.51% 🍏
here-naksha-storage-http 16.44% -30.7% 🍏
Files
Module File Coverage
here-naksha-lib-view ViewReadSession.java 75.69% -7.29% 🍏
here-naksha-storage-http HttpStorageProperties.java 100% 🍏
RequestSenderCache.java 75.81% 🍏
RequestSender.java 33.47% -3.19% 🍏
HttpStorageReadExecute.java 0% -15.89% 🍏
HttpStorageReadSession.java 0% -80.91% 🍏
HttpStorage.java 0% -76.97% 🍏
PrepareResult.java 0% -37.84% 🍏

@@ -51,31 +59,117 @@ public HttpStorage(@NotNull Storage storage) {
properties.getSocketTimeout()));
}

@Override
public @NotNull IReadSession newReadSession(@Nullable NakshaContext context, boolean useMaster) {
return new HttpStorageReadSession(context, useMaster, requestSender);
Copy link
Collaborator

Choose a reason for hiding this comment

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

Since this method is no longer used in Handlers or Tasks it can be removed completely

@Override
public void initStorage() {
public IWriteSession newWriteSession(@Nullable SessionOptions options) {
// TODO
Copy link
Collaborator

Choose a reason for hiding this comment

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

Write session is not supported in HttpStorage, so there is no need for //TODO
It will be supported when the DataHub Connector HttpStorage is implemented, but it is not ready and I guess migrating it to v3 will be whole another task.


@Override
public void close() {
// TODO
Copy link
Collaborator

Choose a reason for hiding this comment

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

I don't see anything that should be closed or finalized inside HttpStorage.
So if there is no additional requirement from Naksha design to handle closure in some particular way, I think //TODO here is not needed

@Override
public boolean isMasterConnect() {
Copy link
Collaborator

Choose a reason for hiding this comment

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

If isMasterConnect is deleted there is no longer any usage of the useMaster field.
So the field and all the parameters used only to set this field may be removed.

POp pOp = readRequest.getQueryParameter(PROPERTY_SEARCH_OP);
return pOp == null ? "" : "&" + POpToQueryConverter.p0pToQuery(pOp);
final IPropertyQuery propertyQuery = readRequest.getQuery().getProperties();
return propertyQuery == null ? "" : "&" + propertyQuery;
Copy link
Collaborator

Choose a reason for hiding this comment

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

It would be nice to test it with
ReadFeaturesByBBoxHttpStorageTest.tc800_testPropertySearch()
If the test passes that means that whole POp conversion and its test can be removed from HttpStorage

However I was not able to run the test due to compilation errors in AbstractEventHandler and other classes

@@ -95,7 +95,6 @@ void testOneId() {
TimeUnit.HOURS
);

assertEquals(PROP_ID_1, PROP_ID_1_COPY);
Copy link
Collaborator

Choose a reason for hiding this comment

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

I don't understand why this and the 127 line was deleted

@NotNull Map<String, String> defaultHeaders,
long connectionTimeoutSec,
long socketTimeoutSec) {}
public static class KeyProperties {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Why convert this record to a class?
If it is about being compared based on the contents, java records already override equals method
https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/Record.html#equals(java.lang.Object)

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