-
Notifications
You must be signed in to change notification settings - Fork 5
DataHub Connector #350
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
DataHub Connector #350
Conversation
Code Coverage
Files
|
...http/src/main/java/com/here/naksha/storage/http/connector/ConnectorInterfaceReadExecute.java
Outdated
Show resolved
Hide resolved
...http/src/main/java/com/here/naksha/storage/http/connector/ConnectorInterfaceReadExecute.java
Outdated
Show resolved
Hide resolved
8c71fb2 to
c25cc01
Compare
Code Coverage
Files
|
Code Coverage
Files
|
c25cc01 to
91cea2b
Compare
Code Coverage
Files
|
hirenkp2000
left a comment
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.
Looks good.
81f2b2a to
02f6176
Compare
02f6176 to
bf6e61b
Compare
Code Coverage
Files
|
bf6e61b to
03b886b
Compare
Code Coverage
Files
|
Code Coverage
Files
|
Code Coverage
Files
|
Code Coverage
Files
|
5e1f3ae to
cdb38cb
Compare
hirenkp2000
left a comment
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.
Changes look good so far. Pls look into minor comments and also address pipeline failure.
here-naksha-storage-http/src/main/java/com/here/naksha/storage/http/PrepareResult.java
Outdated
Show resolved
Hide resolved
...http/src/main/java/com/here/naksha/storage/http/connector/ConnectorInterfaceReadExecute.java
Outdated
Show resolved
Hide resolved
...http/src/main/java/com/here/naksha/storage/http/connector/ConnectorInterfaceReadExecute.java
Outdated
Show resolved
Hide resolved
e01e40f to
029d13a
Compare
Code Coverage
Files
|
Signed-off-by: Adamczyk, Tomasz <[email protected]> Signed-off-by: adamczyk-HERE <[email protected]>
Signed-off-by: adamczyk-HERE <[email protected]>
Signed-off-by: adamczyk-HERE <[email protected]>
Signed-off-by: adamczyk-HERE <[email protected]>
Signed-off-by: adamczyk-HERE <[email protected]>
Code Coverage
Files
|
...ttp/src/main/java/com/here/naksha/storage/http/connector/ConnectorInterfaceWriteExecute.java
Outdated
Show resolved
Hide resolved
...ttp/src/main/java/com/here/naksha/storage/http/connector/ConnectorInterfaceWriteExecute.java
Outdated
Show resolved
Hide resolved
Signed-off-by: adamczyk-HERE <[email protected]>
6619309 to
2ed8782
Compare
Code Coverage
Files
|
Code Coverage
Files
|
Signed-off-by: adamczyk-HERE <[email protected]>
Code Coverage
Files
|
Signed-off-by: adamczyk-HERE <[email protected]>
Signed-off-by: adamczyk-HERE <[email protected]>
2e42dda to
6534eb7
Compare
Code Coverage
Files
|
Code Coverage
Files
|
Code Coverage
Files
|
Signed-off-by: adamczyk-HERE <[email protected]>
2e8f750 to
005d16f
Compare
Code Coverage
Files
|
Signed-off-by: adamczyk-HERE <[email protected]>
Code Coverage
Files
|
| List<XyzFeature> featuresToUpdate = new LinkedList<>(); | ||
| Map<String, String> featuresToDelete = new HashMap<>(); // Format enforced by connector API | ||
|
|
||
| populateDbCache(request.features); |
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 assume we don't need to prefetch for DELETE ?
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.
We don't.
Modified code in populateDbCache method to get only features with PUT operation.
| String uuid = feature.getProperties().getXyzNamespace().getUuid(); | ||
| // We are making an assumption that if uuid exists in feature, it is not a new feature | ||
| return uuid == null && !existsInDb(feature); | ||
| } |
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 we are anyways pre-fetching all records from DB, I think it is safer to update isNewFeature() function to only check whether feature exists in DB (i.e. in cache) or not. And avoid additional uuid == null condition. This will otherwise prevent those API requests where features are new and uuid is provided by user (either mistakenly OR purposely to fail request on UUID conflict)
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.
Also added throwing if a new feature with uuid is provided (assertNoUuid method)
This is how DataHub behaves and now as we dropped assumption that "uuid exists => its update operation" I thought it is good to implement.
| } | ||
| } | ||
|
|
||
| private void setPuuidFromUuid(XyzFeature feature) { |
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.
to be safer, I suggest always setting puuid with the value of uuid as available in DB (and not with the uuid of the incoming request).
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 and tested
| } | ||
| } | ||
|
|
||
| private void fillMissingCreatedAt(XyzFeature feature) { |
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.
to be safer, I suggest always setting createdAt with the value of createdAt as available in DB (and not with the value supplied in the incoming request). My assumption here is, user should not be allowed to manipulate createdAt (intentionally or unintentionally).
in that case the function name can be renamed as something like fillOriginalCreatedAt()
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 and tested
Signed-off-by: adamczyk-HERE <[email protected]>
Code Coverage
Files
|
Signed-off-by: adamczyk-HERE <[email protected]>
Signed-off-by: adamczyk-HERE <[email protected]>
Signed-off-by: adamczyk-HERE <[email protected]>
Code Coverage
Files
|
No description provided.