Skip to content
Browse files

put index aliases in the list of buckets

fixes #21
  • Loading branch information...
1 parent eca68ce commit e48b60866b05a5eadb1433afeec4056081ee8a94 @mschoch mschoch committed Mar 31, 2014
View
10 src/main/java/org/elasticsearch/transport/couchbase/capi/ElasticSearchCouchbaseBehavior.java
@@ -28,12 +28,13 @@
import org.elasticsearch.action.admin.indices.exists.indices.IndicesExistsResponse;
import org.elasticsearch.client.Client;
import org.elasticsearch.cluster.ClusterName;
+import org.elasticsearch.cluster.metadata.AliasMetaData;
import org.elasticsearch.cluster.metadata.IndexMetaData;
-
-import com.couchbase.capi.CouchbaseBehavior;
import org.elasticsearch.common.collect.ImmutableOpenMap;
import org.elasticsearch.common.hppc.cursors.ObjectCursor;
+import com.couchbase.capi.CouchbaseBehavior;
+
public class ElasticSearchCouchbaseBehavior implements CouchbaseBehavior {
protected Client client;
@@ -84,6 +85,11 @@ public String getPoolUUID(String pool) {
ImmutableOpenMap<String, IndexMetaData> indices = response.getState().getMetaData().getIndices();
for (ObjectCursor<String> index : indices.keys()) {
bucketNameList.add(index.value);
+ IndexMetaData indexMetaData = indices.get(index.value);
+ ImmutableOpenMap<String, AliasMetaData> aliases = indexMetaData.aliases();
+ for(ObjectCursor<String> alias : aliases.keys()) {
+ bucketNameList.add(alias.value);
+ }
}
return bucketNameList;

0 comments on commit e48b608

Please sign in to comment.
Something went wrong with that request. Please try again.