-
Notifications
You must be signed in to change notification settings - Fork 13
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
MCR-3046 allow id generation independent from actual storage #2067
MCR-3046 allow id generation independent from actual storage #2067
Conversation
d9d8521
to
9fea7c7
Compare
|
||
try ( | ||
FileChannel channel = FileChannel.open(cacheFile, StandardOpenOption.WRITE, | ||
StandardOpenOption.SYNC, StandardOpenOption.CREATE);){ |
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.
shouldn't we use here at least a FileLock, too?
A ReentrantWriteLock is probably not necessary.
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.
It is only used by the migration Command.
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 added javadoc that the caller has to do locking. The method should only be rarely used anyway.
mycore-base/src/main/java/org/mycore/datamodel/common/MCRFileBaseCacheObjectIDGenerator.java
Show resolved
Hide resolved
@@ -0,0 +1,58 @@ | |||
package org.mycore.datamodel.common; |
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.
MyCoRe License Header is missing
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.
added
throws IOException { | ||
buffer.clear(); | ||
channel.position(0); | ||
buffer.putInt(nextID.getNumberAsInteger()); |
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.
For me if would be nicer to see the Integer not as byte, but readable string in the file - or maybe store the whole MCRObjectID-String?
So it would be easier to Debug the MyCoRe-System.
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 store the entire id as string now
* store ids as strings to make debugging easier * add a docs to setNextFreeId * add missing copyrights
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 for me now
* 2023.06.x: MCR-3011 fix duplicate dateModified MCR-3030 Isolated the HTTP-client in use by MCRRESTResolver (#2051) MCR-3035 fix empty p tags in wcms MCR-3037 Added getUsableSpace() to MCRXMLFunctions (#2058) MCR-3038 MCRMETSDefaultGenerator.structureMets generates double logical ids MCR-3039 fix upload size detection and fix error messages (#2059) MCR-3040 fix XSLT 3 issues MCR-3041 rest api v 2 quirks (#2065) MCR-3041 rest api v 2 quirks (#2062) MCR-3046 allow id generation independent from actual storage (#2067)
Link to jira.