|
24 | 24 | import com.carrotsearch.hppc.cursors.ObjectCursor; |
25 | 25 | import com.carrotsearch.hppc.cursors.ObjectObjectCursor; |
26 | 26 | import com.google.common.base.Predicate; |
27 | | -import com.google.common.collect.Collections2; |
28 | | -import com.google.common.collect.ImmutableList; |
29 | | -import com.google.common.collect.ImmutableMap; |
30 | | -import com.google.common.collect.Lists; |
| 27 | +import com.google.common.collect.*; |
31 | 28 | import org.elasticsearch.ElasticSearchIllegalArgumentException; |
32 | 29 | import org.elasticsearch.action.support.IgnoreIndices; |
33 | 30 | import org.elasticsearch.cluster.block.ClusterBlock; |
34 | 31 | import org.elasticsearch.cluster.block.ClusterBlockLevel; |
35 | 32 | import org.elasticsearch.common.Nullable; |
36 | 33 | import org.elasticsearch.common.Strings; |
37 | | -import org.elasticsearch.common.collect.ImmutableOpenMap; |
38 | 34 | import org.elasticsearch.common.collect.HppcMaps; |
| 35 | +import org.elasticsearch.common.collect.ImmutableOpenMap; |
39 | 36 | import org.elasticsearch.common.io.stream.StreamInput; |
40 | 37 | import org.elasticsearch.common.io.stream.StreamOutput; |
41 | 38 | import org.elasticsearch.common.regex.Regex; |
@@ -928,24 +925,8 @@ public boolean isPatternMatchingAllIndices(String[] indicesOrAliases, String[] c |
928 | 925 | } |
929 | 926 |
|
930 | 927 | @Override |
931 | | - public Iterator<IndexMetaData> iterator() { |
932 | | - final Iterator<ObjectCursor<IndexMetaData>> cursor = indices.values().iterator(); |
933 | | - return new Iterator<IndexMetaData>() { |
934 | | - @Override |
935 | | - public boolean hasNext() { |
936 | | - return cursor.hasNext(); |
937 | | - } |
938 | | - |
939 | | - @Override |
940 | | - public IndexMetaData next() { |
941 | | - return cursor.next().value; |
942 | | - } |
943 | | - |
944 | | - @Override |
945 | | - public void remove() { |
946 | | - throw new UnsupportedOperationException("Remove not supported"); |
947 | | - } |
948 | | - }; |
| 928 | + public UnmodifiableIterator<IndexMetaData> iterator() { |
| 929 | + return indices.valuesIt(); |
949 | 930 | } |
950 | 931 |
|
951 | 932 | public static boolean isGlobalStateEquals(MetaData metaData1, MetaData metaData2) { |
|
0 commit comments