Indhumathi27 commented on a change in pull request #3688: [CARBONDATA-3765] 
Refactor Index Metadata for CG and FG Indexes
URL: https://github.com/apache/carbondata/pull/3688#discussion_r406576221
 
 

 ##########
 File path: 
core/src/main/java/org/apache/carbondata/core/metadata/schema/table/CarbonTable.java
 ##########
 @@ -1202,21 +1192,64 @@ public boolean isIndexTable() throws IOException {
     }
   }
 
+  public List<String> getIndexTableNames(String indexProvider) throws 
IOException {
+    deserializeIndexMetadata();
+    if (null != indexMetadata) {
+      return indexMetadata.getIndexTables(indexProvider);
+    } else {
+      return new ArrayList<>();
+    }
+  }
+
   public String getIndexInfo() throws IOException {
+    return getIndexInfo(null);
+  }
+
+  public IndexMetadata getIndexMetadata() throws IOException {
+    deserializeIndexMetadata();
+    return indexMetadata;
+  }
+
+  public String getIndexInfo(String indexProvider) throws IOException {
     deserializeIndexMetadata();
     if (null != indexMetadata) {
-      IndexTableInfo[] indexTableInfos =
-          new IndexTableInfo[indexMetadata.getIndexesMap().entrySet().size()];
-      int index = 0;
-      if (!isIndexTable()) {
-        for (Map.Entry<String, List<String>> entry : 
indexMetadata.getIndexesMap().entrySet()) {
-          indexTableInfos[index] =
-              new IndexTableInfo(getDatabaseName(), entry.getKey(), 
entry.getValue());
-          index++;
+      if (null != indexProvider) {
+        if (null != indexMetadata.getIndexesMap().get(indexProvider)) {
+          IndexTableInfo[] indexTableInfos =
+              new 
IndexTableInfo[indexMetadata.getIndexesMap().get(indexProvider).entrySet()
+                  .size()];
+          int index = 0;
+          if (!isIndexTable()) {
 
 Review comment:
   added

----------------------------------------------------------------
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]


With regards,
Apache Git Services

Reply via email to