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

Upsert specimens #73

Merged
merged 3 commits into from
Dec 15, 2023
Merged

Upsert specimens #73

merged 3 commits into from
Dec 15, 2023

Conversation

southeo
Copy link
Collaborator

@southeo southeo commented Dec 12, 2023

Re-adds upsert endpoint. New specimens are Postgres-Copied. Updated specimens are inserted with Jooq.

We don't verify media objects/annotations haven't been ingested the way we verify specimens. For media/annotation objects, we rely on the respective processing services to verify they haven't been ingested. It might make sense with media objects (since they'll eventually get DOIs), but for annotations, it probably isn't necessary.

@southeo southeo requested a review from samleeflang December 12, 2023 12:43
Copy link
Contributor

@samleeflang samleeflang left a comment

Choose a reason for hiding this comment

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

One question about the writable PIDs, might have missed how that part works

var registeredPhysicalIdentiferMap = registeredPhysicalIdentifiers.stream()
.collect(Collectors.toMap(row -> new String(row.getData(), StandardCharsets.UTF_8),
row -> new String(row.getHandle(), StandardCharsets.UTF_8)));
var writableHandles = pidRepository.checkHandlesWritable(
Copy link
Contributor

Choose a reason for hiding this comment

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

What does the checkHandlesWritable do? Do we have unwritable handles, I don't get this part

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Checks PID state. If the PID is set to "ARCHIVED", then the specimen will get a new PID instead of updating an archived PID.

@southeo southeo requested a review from samleeflang December 12, 2023 14:33
Copy link

@@ -97,7 +97,7 @@ public enum FdoProfile {
private final int index;


private FdoProfile(String attribute, int index) {
FdoProfile(String attribute, int index) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Way are these no longer private?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

"If you do not specify an access modifier the enum constructor it will be implicitly private."

Source

Slowly going to remove the private constructors when I touch enum files

Copy link
Contributor

Choose a reason for hiding this comment

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

Good find 💯

Copy link
Contributor

@samleeflang samleeflang left a comment

Choose a reason for hiding this comment

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

Good work! Query is a pain but it is a bit faster. Next year start the discussion about the handle server. Just one more question about the no longer private constructions

@southeo southeo requested a review from samleeflang December 14, 2023 10:21
@southeo southeo merged commit c6804a6 into main Dec 15, 2023
2 checks passed
@southeo southeo deleted the feature/upsert-endpoint branch December 15, 2023 08:15
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