You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@usergrid.apache.org by to...@apache.org on 2015/03/20 22:32:48 UTC
[15/31] incubator-usergrid git commit: create correct context
create correct context
Project: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/commit/1dd6ead8
Tree: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/tree/1dd6ead8
Diff: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/diff/1dd6ead8
Branch: refs/heads/USERGRID-486
Commit: 1dd6ead8a8426dc5e97910668d140da46767fa18
Parents: 735eedb
Author: Shawn Feldman <sf...@apache.org>
Authored: Thu Mar 19 17:48:42 2015 -0600
Committer: Shawn Feldman <sf...@apache.org>
Committed: Thu Mar 19 17:48:42 2015 -0600
----------------------------------------------------------------------
.../usergrid/persistence/index/impl/EsEntityIndexBatchImpl.java | 4 ++--
.../apache/usergrid/persistence/index/impl/IndexingUtils.java | 4 +++-
2 files changed, 5 insertions(+), 3 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/1dd6ead8/stack/corepersistence/queryindex/src/main/java/org/apache/usergrid/persistence/index/impl/EsEntityIndexBatchImpl.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/queryindex/src/main/java/org/apache/usergrid/persistence/index/impl/EsEntityIndexBatchImpl.java b/stack/corepersistence/queryindex/src/main/java/org/apache/usergrid/persistence/index/impl/EsEntityIndexBatchImpl.java
index 1082201..38bf381 100644
--- a/stack/corepersistence/queryindex/src/main/java/org/apache/usergrid/persistence/index/impl/EsEntityIndexBatchImpl.java
+++ b/stack/corepersistence/queryindex/src/main/java/org/apache/usergrid/persistence/index/impl/EsEntityIndexBatchImpl.java
@@ -98,7 +98,7 @@ public class EsEntityIndexBatchImpl implements EntityIndexBatch {
entity.setField(
new StringField(APPLICATION_ID_FIELDNAME, IndexingUtils.idString(applicationScope.getApplication()))
);
- final String context = createContextName(indexScope);
+ final String context = createContextName(applicationScope,indexScope);
if ( log.isDebugEnabled() ) {
log.debug( "Indexing entity {}:{}\n alias: {}\n" +
@@ -134,7 +134,7 @@ public class EsEntityIndexBatchImpl implements EntityIndexBatch {
ValidationUtils.verifyIdentity(id);
ValidationUtils.verifyVersion( version );
- final String context = createContextName(indexScope);
+ final String context = createContextName(applicationScope,indexScope);
final SearchType entityType =SearchType.fromId(id);
final String indexId = createIndexDocId( id, version, context );
http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/1dd6ead8/stack/corepersistence/queryindex/src/main/java/org/apache/usergrid/persistence/index/impl/IndexingUtils.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/queryindex/src/main/java/org/apache/usergrid/persistence/index/impl/IndexingUtils.java b/stack/corepersistence/queryindex/src/main/java/org/apache/usergrid/persistence/index/impl/IndexingUtils.java
index c74ce93..c365ff4 100644
--- a/stack/corepersistence/queryindex/src/main/java/org/apache/usergrid/persistence/index/impl/IndexingUtils.java
+++ b/stack/corepersistence/queryindex/src/main/java/org/apache/usergrid/persistence/index/impl/IndexingUtils.java
@@ -65,8 +65,10 @@ public class IndexingUtils {
* @param scope
* @return
*/
- public static String createContextName( IndexScope scope ) {
+ public static String createContextName(ApplicationScope applicationScope, IndexScope scope ) {
StringBuilder sb = new StringBuilder();
+ idString(sb,applicationScope.getApplication());
+ sb.append(SEPARATOR);
idString(sb, scope.getOwner());
sb.append( SEPARATOR );
sb.append( scope.getName() );