rpuch commented on code in PR #2691:
URL: https://github.com/apache/ignite-3/pull/2691#discussion_r1360683858
##########
modules/catalog/src/main/java/org/apache/ignite/internal/catalog/commands/CatalogUtils.java:
##########
@@ -367,12 +367,11 @@ public static String pkIndexName(String tableName) {
}
/**
- * Returns index with given name.
+ * Returns index descriptor.
*
* @param schema Schema to look up index in.
* @param name Name of the index of interest.
- * @return Table with given name.
- * @throws IndexNotFoundValidationException If index with given name is
not exists.
+ * @throws IndexNotFoundValidationException If index is not exists.
Review Comment:
```suggestion
* @throws IndexNotFoundValidationException If index does not exist.
```
##########
modules/catalog/src/main/java/org/apache/ignite/internal/catalog/storage/MakeIndexAvailableEntry.java:
##########
@@ -72,16 +73,60 @@ public CatalogEvent eventType() {
@Override
public CatalogEventParameters createEventParameters(long causalityToken,
int catalogVersion) {
- return new MakeIndexAvailableEventParameters(causalityToken,
catalogVersion, descriptor.id());
+ return new MakeIndexAvailableEventParameters(causalityToken,
catalogVersion, indexId);
+ }
+
+ private static CatalogSchemaDescriptor schemaByIndexId(Catalog catalog,
int indexId) {
+ CatalogIndexDescriptor index = catalog.index(indexId);
+
+ assert index != null : indexId;
+
+ CatalogTableDescriptor table = catalog.table(index.tableId());
+
+ assert table != null : index.tableId();
+
+ CatalogSchemaDescriptor schema = catalog.schema(table.schemaId());
+
+ assert schema != null : table.schemaId();
+
+ return schema;
}
- /** Returns schema name. */
- public String schemaName() {
- return schemaName;
+ private static CatalogIndexDescriptor
createReadWriteIndex(CatalogIndexDescriptor source, long causalityToken) {
Review Comment:
Again, 2 terminologies. Writing in some documentation that 'RW is same as
Available' will not be enough if all around the code we see either Available,
or RW. My suggestion is to pick 1 principal terminology (I suggest
'Registered/Available') and write the new code in accordance with it, and then
change all the terminology in accordance with this one (for the code that was
written earlier).
##########
modules/catalog/src/main/java/org/apache/ignite/internal/catalog/commands/CatalogUtils.java:
##########
@@ -383,4 +382,21 @@ static CatalogIndexDescriptor
indexOrThrow(CatalogSchemaDescriptor schema, Strin
return index;
}
+
+ /**
+ * Returns index descriptor.
+ *
+ * @param catalog Catalog to look up index in.
+ * @param indexId ID of the index of interest.
+ * @throws IndexNotFoundValidationException If index is not exists.
Review Comment:
```suggestion
* @throws IndexNotFoundValidationException If index does not exist.
```
--
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]