Github user tnine commented on a diff in the pull request:

    https://github.com/apache/incubator-usergrid/pull/117#discussion_r21489983
  
    --- Diff: 
stack/corepersistence/queryindex/src/main/java/org/apache/usergrid/persistence/index/impl/EsEntityIndexImpl.java
 ---
    @@ -198,6 +197,23 @@ public void addAlias(final String indexSuffix) {
             }
         }
     
    +    @Override
    +    public String[] getIndexes(final AliasType aliasType) {
    +        final String aliasName = aliasType == AliasType.Read ? 
alias.getReadAlias() : alias.getWriteAlias();
    +        return getIndexes(aliasName);
    +    }
    +
    +    /**
    +     * get indexes for alias
    +     * @param aliasName
    +     * @return
    +     */
    +    private String[] getIndexes(final String aliasName){
    +        final AdminClient adminClient = esProvider.getClient().admin();
    +        //remove write alias, can only have one
    +        ImmutableOpenMap<String,List<AliasMetaData>> aliasMap = 
adminClient.indices().getAliases(new 
GetAliasesRequest(aliasName)).actionGet().getAliases();
    +        return aliasMap.keys().toArray(String.class);
    --- End diff --
    
    Can we verify which node this hits?  If only the master responds to this 
operation, can we hide it behind a cache with an internal refresh worker pool, 
and a timeout that's configurable?  I'm thinking 5 min or so should be 
sufficient if that's the case.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---

Reply via email to