ekaterinadimitrova2 commented on code in PR #2713:
URL: https://github.com/apache/cassandra/pull/2713#discussion_r1357172745
##########
src/java/org/apache/cassandra/schema/Schema.java:
##########
@@ -496,25 +509,43 @@ public Optional<Function> findFunction(FunctionName name,
List<AbstractType<?>>
/* Version control */
/**
- * @return current schema version
+ * Returns the current schema version. Although, if the schema is being
updated while the method was called, it
+ * can return a stale version which does not correspond to the current
keyspaces metadata. It is because the schema
+ * version is unknown for the partially applied changes and is updated
after the entire schema change is applied.
+ * @see #getVersion()
+ */
+ public UUID getVersionUnsafe()
+ {
+ return version;
+ }
+
+ /**
+ * Returns the curren schema version. If the schema is in the middle of
the update, the method will wait until
+ * the update is completed and return the new version.
*/
- public UUID getVersion()
+ public synchronized UUID getVersion()
{
return version;
}
/**
* Checks whether the given schema version is the same as the current
local schema.
+ *
+ * @deprecated please use {@link #getVersion()} or {@link
#getVersionUnsafe()} depending on the use case
*/
- public boolean isSameVersion(UUID schemaVersion)
+ @Deprecated(since = "4.1", forRemoval = true)
+ public synchronized boolean isSameVersion(UUID schemaVersion)
Review Comment:
`would you like me to add that to the comment? `
I will leave the final decision to you, just mentioned that it is a bit
more than that :-)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]