james-server-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From btell...@apache.org
Subject svn commit: r1685961 - /james/mailbox/trunk/cassandra/src/main/java/org/apache/james/mailbox/cassandra/CassandraTableManager.java
Date Wed, 17 Jun 2015 09:08:37 GMT
Author: btellier
Date: Wed Jun 17 09:08:36 2015
New Revision: 1685961

URL: http://svn.apache.org/r1685961
Log:
MAILBOX-239 Improve readability of Cassandra index creation

Modified:
    james/mailbox/trunk/cassandra/src/main/java/org/apache/james/mailbox/cassandra/CassandraTableManager.java

Modified: james/mailbox/trunk/cassandra/src/main/java/org/apache/james/mailbox/cassandra/CassandraTableManager.java
URL: http://svn.apache.org/viewvc/james/mailbox/trunk/cassandra/src/main/java/org/apache/james/mailbox/cassandra/CassandraTableManager.java?rev=1685961&r1=1685960&r2=1685961&view=diff
==============================================================================
--- james/mailbox/trunk/cassandra/src/main/java/org/apache/james/mailbox/cassandra/CassandraTableManager.java
(original)
+++ james/mailbox/trunk/cassandra/src/main/java/org/apache/james/mailbox/cassandra/CassandraTableManager.java
Wed Jun 17 09:08:36 2015
@@ -38,6 +38,8 @@ import java.util.Arrays;
 
 public class CassandraTableManager {
 
+    private final static String INDEX_PREFIX = "INDEX_";
+
     private Session session;
 
     enum TABLE {
@@ -108,12 +110,12 @@ public class CassandraTableManager {
     }
 
     enum INDEX {
-        MailboxPath(SchemaBuilder.createIndex(CassandraMailboxTable.TABLE_NAME)
+        MailboxPath(SchemaBuilder.createIndex(INDEX_PREFIX + CassandraMailboxTable.TABLE_NAME)
             .ifNotExists()
             .onTable(CassandraMailboxTable.TABLE_NAME)
             .andColumn(CassandraMailboxTable.PATH)),
         AggregateNamespaceUser(
-            SchemaBuilder.createIndex(CassandraMailboxTable.MAILBOX_BASE)
+            SchemaBuilder.createIndex(INDEX_PREFIX + CassandraMailboxTable.MAILBOX_BASE)
                 .ifNotExists()
                 .onTable(CassandraMailboxTable.TABLE_NAME)
                 .andColumn(CassandraMailboxTable.MAILBOX_BASE)
@@ -137,7 +139,7 @@ public class CassandraTableManager {
             );
         Arrays.asList(INDEX.values())
             .forEach(
-                (table) -> session.execute(table.createIndexStatement)
+                (index) -> session.execute(index.createIndexStatement)
             );
         return this;
     }



---------------------------------------------------------------------
To unsubscribe, e-mail: server-dev-unsubscribe@james.apache.org
For additional commands, e-mail: server-dev-help@james.apache.org


Mime
View raw message