korlov42 commented on code in PR #1134:
URL: https://github.com/apache/ignite-3/pull/1134#discussion_r995541023
##########
modules/schema/src/main/java/org/apache/ignite/internal/schema/SchemaManager.java:
##########
@@ -400,15 +452,128 @@ public void stop() throws Exception {
}
/**
- * Gets a direct accessor for the configuration distributed property.
- * If the metadata access only locally configured the method will return
local property accessor.
+ * Gets the latest version of the table schema which available in
Metastore.
*
- * @param property Distributed configuration property to receive direct
access.
- * @param <T> Type of the property accessor.
- * @return An accessor for distributive property.
- * @see #getMetadataLocallyOnly
+ * @param tblId Table id.
+ * @return The latest schema version.
+ */
+ private int latestSchemaVersion(UUID tblId) {
+ try {
+ Cursor<Entry> cur =
metastorageMgr.prefix(schemaHistPredicate(tblId));
+
+ int lastVer = INITIAL_SCHEMA_VERSION;
+
+ for (Entry ent : cur) {
+ String key = ent.key().toString();
+ int descVer = extractVerFromSchemaKey(key);
+
+ if (descVer > lastVer) {
+ lastVer = descVer;
+ }
+ }
+
+ return lastVer;
+ } catch (NoSuchElementException e) {
Review Comment:
could you please clarify who is throwing this exception?
--
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]