move impl
Project: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/commit/9e8d506c Tree: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/tree/9e8d506c Diff: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/diff/9e8d506c Branch: refs/heads/two-dot-o-dev Commit: 9e8d506c3bc5d96a6f24a32f01a3fa7b54531a51 Parents: 4b7b122 Author: Shawn Feldman <[email protected]> Authored: Thu Mar 26 15:10:03 2015 -0600 Committer: Shawn Feldman <[email protected]> Committed: Thu Mar 26 15:10:03 2015 -0600 ---------------------------------------------------------------------- .../persistence/index/IndexIdentifierImpl.java | 65 ------------------- .../persistence/index/guice/IndexModule.java | 7 +- .../index/impl/IndexIdentifierImpl.java | 68 ++++++++++++++++++++ 3 files changed, 69 insertions(+), 71 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/9e8d506c/stack/corepersistence/queryindex/src/main/java/org/apache/usergrid/persistence/index/IndexIdentifierImpl.java ---------------------------------------------------------------------- diff --git a/stack/corepersistence/queryindex/src/main/java/org/apache/usergrid/persistence/index/IndexIdentifierImpl.java b/stack/corepersistence/queryindex/src/main/java/org/apache/usergrid/persistence/index/IndexIdentifierImpl.java deleted file mode 100644 index 1d18733..0000000 --- a/stack/corepersistence/queryindex/src/main/java/org/apache/usergrid/persistence/index/IndexIdentifierImpl.java +++ /dev/null @@ -1,65 +0,0 @@ -/* - * - * * Licensed to the Apache Software Foundation (ASF) under one or more - * * contributor license agreements. 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. For additional information regarding - * * copyright in this work, please see the NOTICE file in the top level - * * directory of this distribution. - * - */ - -package org.apache.usergrid.persistence.index; - -import com.google.inject.Inject; - -/** - * Class is used to generate an index name and alias name - */ -public class IndexIdentifierImpl implements IndexIdentifier { - private final IndexFig config; - - @Inject - public IndexIdentifierImpl(IndexFig config) { - this.config = config; - } - - /** - * Get the alias name - * @return - */ - @Override - public IndexAlias getAlias() { - return new IndexAlias(config,config.getIndexPrefix()); - } - - /** - * Get index name, send in additional parameter to add incremental indexes - * @param suffix - * @return - */ - @Override - public String getIndex(String suffix) { - if (suffix != null) { - return config.getIndexPrefix() + "_" + suffix; - } else { - return config.getIndexPrefix(); - } - } - - - @Override - public String toString() { - return "index id"+config.getIndexPrefix(); - } - -} http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/9e8d506c/stack/corepersistence/queryindex/src/main/java/org/apache/usergrid/persistence/index/guice/IndexModule.java ---------------------------------------------------------------------- diff --git a/stack/corepersistence/queryindex/src/main/java/org/apache/usergrid/persistence/index/guice/IndexModule.java b/stack/corepersistence/queryindex/src/main/java/org/apache/usergrid/persistence/index/guice/IndexModule.java index aba49f6..922a916 100644 --- a/stack/corepersistence/queryindex/src/main/java/org/apache/usergrid/persistence/index/guice/IndexModule.java +++ b/stack/corepersistence/queryindex/src/main/java/org/apache/usergrid/persistence/index/guice/IndexModule.java @@ -26,13 +26,8 @@ import org.apache.usergrid.persistence.core.migration.data.MigrationPlugin; import org.apache.usergrid.persistence.core.scope.ApplicationScope; import org.apache.usergrid.persistence.index.*; import com.google.inject.AbstractModule; -import com.google.inject.assistedinject.FactoryModuleBuilder; -import org.apache.usergrid.persistence.index.impl.BufferQueue; -import org.apache.usergrid.persistence.index.impl.EsEntityIndexFactoryImpl; -import org.apache.usergrid.persistence.index.impl.EsEntityIndexImpl; -import org.apache.usergrid.persistence.index.impl.EsIndexBufferConsumerImpl; -import org.apache.usergrid.persistence.index.impl.EsIndexBufferProducerImpl; +import org.apache.usergrid.persistence.index.impl.*; import org.apache.usergrid.persistence.index.migration.EsIndexDataMigrationImpl; import org.apache.usergrid.persistence.index.migration.EsIndexMigrationPlugin; import org.apache.usergrid.persistence.index.migration.IndexMigration; http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/9e8d506c/stack/corepersistence/queryindex/src/main/java/org/apache/usergrid/persistence/index/impl/IndexIdentifierImpl.java ---------------------------------------------------------------------- diff --git a/stack/corepersistence/queryindex/src/main/java/org/apache/usergrid/persistence/index/impl/IndexIdentifierImpl.java b/stack/corepersistence/queryindex/src/main/java/org/apache/usergrid/persistence/index/impl/IndexIdentifierImpl.java new file mode 100644 index 0000000..0139858 --- /dev/null +++ b/stack/corepersistence/queryindex/src/main/java/org/apache/usergrid/persistence/index/impl/IndexIdentifierImpl.java @@ -0,0 +1,68 @@ +/* + * + * * Licensed to the Apache Software Foundation (ASF) under one or more + * * contributor license agreements. 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. For additional information regarding + * * copyright in this work, please see the NOTICE file in the top level + * * directory of this distribution. + * + */ + +package org.apache.usergrid.persistence.index.impl; + +import com.google.inject.Inject; +import org.apache.usergrid.persistence.index.IndexAlias; +import org.apache.usergrid.persistence.index.IndexFig; +import org.apache.usergrid.persistence.index.IndexIdentifier; + +/** + * Class is used to generate an index name and alias name + */ +public class IndexIdentifierImpl implements IndexIdentifier { + private final IndexFig config; + + @Inject + public IndexIdentifierImpl(IndexFig config) { + this.config = config; + } + + /** + * Get the alias name + * @return + */ + @Override + public IndexAlias getAlias() { + return new IndexAlias(config,config.getIndexPrefix()); + } + + /** + * Get index name, send in additional parameter to add incremental indexes + * @param suffix + * @return + */ + @Override + public String getIndex(String suffix) { + if (suffix != null) { + return config.getIndexPrefix() + "_" + suffix; + } else { + return config.getIndexPrefix(); + } + } + + + @Override + public String toString() { + return "index id"+config.getIndexPrefix(); + } + +}
