nizhikov commented on code in PR #10116:
URL: https://github.com/apache/ignite/pull/10116#discussion_r910786015
##########
modules/control-utility/src/main/java/org/apache/ignite/internal/commandline/indexreader/IgniteIndexReader.java:
##########
@@ -640,25 +701,87 @@ private void doWithoutErrors(RunnableX x, ScanContext
ctx, long pageId) {
* @param name Index name.
* @return Pair of cache id and type id.
*/
- public IgnitePair<Integer> cacheAndTypeId(String name) {
+ public GridTuple3<Integer, Integer, String> cacheAndTypeId(String name) {
return cacheTypeIds.computeIfAbsent(name, k -> {
+ Matcher xId = CACHE_TYPE_ID_INDEX_SEARCH_PATTERN.matcher(k);
+
+ if (xId.find())
+ return new GridTuple3<>(parseInt(xId.group("id")),
parseInt(xId.group("typeId")), xId.group("indexName"));
+
Matcher mId = CACHE_TYPE_ID_SEARCH_PATTERN.matcher(k);
if (mId.find())
- return new IgnitePair<>(parseInt(mId.group("id")),
parseInt(mId.group("typeId")));
+ return new GridTuple3<>(parseInt(mId.group("id")),
parseInt(mId.group("typeId")), null);
Matcher cId = CACHE_ID_SEARCH_PATTERN.matcher(k);
if (cId.find())
- return new IgnitePair<>(parseInt(cId.group("id")), 0);
+ return new GridTuple3<>(parseInt(cId.group("id")), 0, null);
- return new IgnitePair<>(0, 0);
+ return new GridTuple3<>(0, 0, null);
});
}
/** */
- ScanContext createContext(int cacheId, FilePageStore store, ItemStorage
items) {
- return new ScanContext(cacheId, store, items);
+ ScanContext createContext(String idxName, FilePageStore store, ItemStorage
items) {
+ GridTuple3<Integer, Integer, String> parsed;
+
+ if (idxName != null)
+ parsed = cacheAndTypeId(idxName);
+ else
+ parsed = new GridTuple3<>(UNKNOWN_CACHE, 0, null);
+
+ return new ScanContext(parsed.get1(), inlineFieldsCount(parsed),
store, items);
+ }
+
+ /**
+ * Seach index definition inside cache query entities.
Review Comment:
Fixed.
--
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]