You are viewing a plain text version of this content. The canonical link for it is here.
Posted to oak-commits@jackrabbit.apache.org by re...@apache.org on 2015/09/18 15:59:35 UTC

svn commit: r1703858 - /jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/document/rdb/RDBDocumentStore.java

Author: reschke
Date: Fri Sep 18 13:59:35 2015
New Revision: 1703858

URL: http://svn.apache.org/viewvc?rev=1703858&view=rev
Log:
OAK-3422: RDBDocumentStore: improve index diagnostics

Modified:
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/document/rdb/RDBDocumentStore.java

Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/document/rdb/RDBDocumentStore.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/document/rdb/RDBDocumentStore.java?rev=1703858&r1=1703857&r2=1703858&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/document/rdb/RDBDocumentStore.java (original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/document/rdb/RDBDocumentStore.java Fri Sep 18 13:59:35 2015
@@ -616,7 +616,7 @@ public class RDBDocumentStore implements
         }
     }
 
-    private String asQualifiedDbName(String one, String two) {
+    private static String asQualifiedDbName(String one, String two) {
         if (one == null && two == null) {
             return null;
         }
@@ -627,6 +627,21 @@ public class RDBDocumentStore implements
         }
     }
 
+    private static String indexTypeAsString(int type) {
+        switch (type) {
+            case DatabaseMetaData.tableIndexClustered:
+                return "clustered";
+            case DatabaseMetaData.tableIndexHashed:
+                return "hashed";
+            case DatabaseMetaData.tableIndexStatistic:
+                return "statistic";
+            case DatabaseMetaData.tableIndexOther:
+                return "other";
+            default:
+                return "indexType=" + type;
+        }
+    }
+
     private String dumpIndexData(DatabaseMetaData met, ResultSetMetaData rmet, String tableName) {
 
         ResultSet rs = null;
@@ -654,7 +669,7 @@ public class RDBDocumentStore implements
                         info.put("fields", new TreeMap<Integer, String>());
                     }
                     info.put("nonunique", rs.getBoolean(4));
-                    info.put("type", rs.getInt(7));
+                    info.put("type", indexTypeAsString(rs.getInt(7)));
                     String inSchema = rs.getString(2);
                     inSchema = inSchema == null ? "" : inSchema.trim();
                     // skip indices on tables in other schemas in case we have that information
@@ -685,6 +700,7 @@ public class RDBDocumentStore implements
                         sb.append(field);
                     }
                     sb.append(")");
+                    sb.append(" ").append(index.getValue().get("type"));
                 }
             }
             if (sb.length() != 0) {