Repository: james-project Updated Branches: refs/heads/master 4870766d4 -> 6b5d52789
JAMES-1945 Define new columns for first UNSEEN UID Project: http://git-wip-us.apache.org/repos/asf/james-project/repo Commit: http://git-wip-us.apache.org/repos/asf/james-project/commit/fda6bc69 Tree: http://git-wip-us.apache.org/repos/asf/james-project/tree/fda6bc69 Diff: http://git-wip-us.apache.org/repos/asf/james-project/diff/fda6bc69 Branch: refs/heads/master Commit: fda6bc69d6ed7cb7e512c2b3367328afd667eedf Parents: cf05c79 Author: Benoit Tellier <[email protected]> Authored: Tue Feb 21 14:21:29 2017 +0700 Committer: Antoine Duprat <[email protected]> Committed: Tue Feb 21 14:56:02 2017 +0100 ---------------------------------------------------------------------- .../modules/CassandraFirstUnseenModule.java | 66 ++++++++++++++++++++ .../table/CassandraFirstUnseenTable.java | 27 ++++++++ 2 files changed, 93 insertions(+) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/james-project/blob/fda6bc69/mailbox/cassandra/src/main/java/org/apache/james/mailbox/cassandra/modules/CassandraFirstUnseenModule.java ---------------------------------------------------------------------- diff --git a/mailbox/cassandra/src/main/java/org/apache/james/mailbox/cassandra/modules/CassandraFirstUnseenModule.java b/mailbox/cassandra/src/main/java/org/apache/james/mailbox/cassandra/modules/CassandraFirstUnseenModule.java new file mode 100644 index 0000000..27d9cc7 --- /dev/null +++ b/mailbox/cassandra/src/main/java/org/apache/james/mailbox/cassandra/modules/CassandraFirstUnseenModule.java @@ -0,0 +1,66 @@ +/**************************************************************** + * Licensed to the Apache Software Foundation (ASF) under one * + * or more contributor license agreements. See the NOTICE file * + * distributed with this work for additional information * + * regarding copyright ownership. The ASF licenses this file * + * to you under the Apache License, Version 2.0 (the * + * "License"); you may not use this file except in compliance * + * with the License. You may obtain a copy of the License at * + * * + * http://www.apache.org/licenses/LICENSE-2.0 * + * * + * Unless required by applicable law or agreed to in writing, * + * software distributed under the License is distributed on an * + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * + * KIND, either express or implied. See the License for the * + * specific language governing permissions and limitations * + * under the License. * + ****************************************************************/ + +package org.apache.james.mailbox.cassandra.modules; + +import java.util.List; + +import org.apache.james.backends.cassandra.components.CassandraIndex; +import org.apache.james.backends.cassandra.components.CassandraModule; +import org.apache.james.backends.cassandra.components.CassandraTable; +import org.apache.james.backends.cassandra.components.CassandraType; +import org.apache.james.mailbox.cassandra.table.CassandraFirstUnseenTable; + +import com.datastax.driver.core.DataType; +import com.datastax.driver.core.schemabuilder.SchemaBuilder; +import com.google.common.collect.ImmutableList; + +public class CassandraFirstUnseenModule implements CassandraModule { + + private final List<CassandraTable> tables; + private final List<CassandraIndex> index; + private final List<CassandraType> types; + + public CassandraFirstUnseenModule() { + tables = ImmutableList.of(new CassandraTable(CassandraFirstUnseenTable.TABLE_NAME, + SchemaBuilder.createTable(CassandraFirstUnseenTable.TABLE_NAME) + .ifNotExists() + .addPartitionKey(CassandraFirstUnseenTable.MAILBOX_ID, DataType.timeuuid()) + .addClusteringColumn(CassandraFirstUnseenTable.UID, DataType.bigint()) + .withOptions() + .clusteringOrder(CassandraFirstUnseenTable.UID, SchemaBuilder.Direction.ASC))); + index = ImmutableList.of(); + types = ImmutableList.of(); + } + + @Override + public List<CassandraTable> moduleTables() { + return tables; + } + + @Override + public List<CassandraIndex> moduleIndex() { + return index; + } + + @Override + public List<CassandraType> moduleTypes() { + return types; + } +} http://git-wip-us.apache.org/repos/asf/james-project/blob/fda6bc69/mailbox/cassandra/src/main/java/org/apache/james/mailbox/cassandra/table/CassandraFirstUnseenTable.java ---------------------------------------------------------------------- diff --git a/mailbox/cassandra/src/main/java/org/apache/james/mailbox/cassandra/table/CassandraFirstUnseenTable.java b/mailbox/cassandra/src/main/java/org/apache/james/mailbox/cassandra/table/CassandraFirstUnseenTable.java new file mode 100644 index 0000000..bf6583a --- /dev/null +++ b/mailbox/cassandra/src/main/java/org/apache/james/mailbox/cassandra/table/CassandraFirstUnseenTable.java @@ -0,0 +1,27 @@ +/**************************************************************** + * Licensed to the Apache Software Foundation (ASF) under one * + * or more contributor license agreements. See the NOTICE file * + * distributed with this work for additional information * + * regarding copyright ownership. The ASF licenses this file * + * to you under the Apache License, Version 2.0 (the * + * "License"); you may not use this file except in compliance * + * with the License. You may obtain a copy of the License at * + * * + * http://www.apache.org/licenses/LICENSE-2.0 * + * * + * Unless required by applicable law or agreed to in writing, * + * software distributed under the License is distributed on an * + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * + * KIND, either express or implied. See the License for the * + * specific language governing permissions and limitations * + * under the License. * + ****************************************************************/ + +package org.apache.james.mailbox.cassandra.table; + +public interface CassandraFirstUnseenTable { + String TABLE_NAME = "firstUnseen"; + + String MAILBOX_ID = "mailboxId"; + String UID = "uid"; +} --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
