vldpyatkov commented on a change in pull request #149:
URL: https://github.com/apache/ignite-3/pull/149#discussion_r642315578
##########
File path:
modules/schema/src/main/java/org/apache/ignite/internal/schema/SchemaManager.java
##########
@@ -251,13 +253,32 @@ private SchemaRegistry schemaRegistryForTable(UUID
tableId) {
Set<ByteArray> keys = new HashSet<>();
- try (Cursor<Entry> cursor = metaStorageMgr.range(new
ByteArray(schemaPrefix), null)) {
+ IgniteBiTuple<ByteArray, ByteArray> range = toRange(new
ByteArray(schemaPrefix));
+
+ try (Cursor<Entry> cursor = metaStorageMgr.range(range.get1(),
range.get2())) {
cursor.forEach(entry -> keys.add(entry.key()));
}
catch (Exception e) {
- LOG.error("Can't remove schemas for the table [tblId=" + tableId +
']');
+ LOG.error("Can't remove schemas for the table [tblId=" + tableId +
']', e);
}
return fut.thenCompose(r ->
metaStorageMgr.removeAll(keys)).thenApply(v -> true);
}
+
+ /**
+ * Transforms a prefix bytes to range.
+ *
+ * @param prefixKey Prefix bytes.
+ * @return Tuple with left and right borders for range.
+ */
+ private IgniteBiTuple<ByteArray, ByteArray> toRange(ByteArray prefixKey) {
Review comment:
Added todo.
--
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.
For queries about this service, please contact Infrastructure at:
[email protected]