IndicesShardStoresResponse() { this(ImmutableOpenMap.<String, ImmutableOpenIntMap<List<StoreStatus>>>of(), Collections.<Failure>emptyList()); }
public Entry(Snapshot snapshot, boolean includeGlobalState, boolean partial, State state, List<IndexId> indices, long startTime, long repositoryStateId, ImmutableOpenMap<ShardId, ShardSnapshotStatus> shards) { this.state = state; this.snapshot = snapshot; this.includeGlobalState = includeGlobalState; this.partial = partial; this.indices = indices; this.startTime = startTime; if (shards == null) { this.shards = ImmutableOpenMap.of(); this.waitingIndices = ImmutableOpenMap.of(); } else { this.shards = shards; this.waitingIndices = findWaitingIndices(shards); } this.repositoryStateId = repositoryStateId; }
@Override public void onFailure(Exception e) { if (e instanceof ReceiveTimeoutTransportException) { logger.error("NodeStatsAction timed out for ClusterInfoUpdateJob", e); } else { if (e instanceof ClusterBlockException) { if (logger.isTraceEnabled()) { logger.trace("Failed to execute NodeStatsAction for ClusterInfoUpdateJob", e); } } else { logger.warn("Failed to execute NodeStatsAction for ClusterInfoUpdateJob", e); } // we empty the usages list, to be safe - we don't know what's going on. leastAvailableSpaceUsages = ImmutableOpenMap.of(); mostAvailableSpaceUsages = ImmutableOpenMap.of(); } } });
@Override public void onFailure(Exception e) { if (e instanceof ReceiveTimeoutTransportException) { logger.error("IndicesStatsAction timed out for ClusterInfoUpdateJob", e); } else { if (e instanceof ClusterBlockException) { if (logger.isTraceEnabled()) { logger.trace("Failed to execute IndicesStatsAction for ClusterInfoUpdateJob", e); } } else { logger.warn("Failed to execute IndicesStatsAction for ClusterInfoUpdateJob", e); } // we empty the usages list, to be safe - we don't know what's going on. shardSizes = ImmutableOpenMap.of(); shardRoutingToDataPath = ImmutableOpenMap.of(); } } });
/** * Creates new restore metadata * * @param uuid uuid of the restore * @param snapshot snapshot * @param state current state of the restore process * @param indices list of indices being restored * @param shards map of shards being restored to their current restore status */ public Entry(String uuid, Snapshot snapshot, State state, List<String> indices, ImmutableOpenMap<ShardId, ShardRestoreStatus> shards) { this.snapshot = Objects.requireNonNull(snapshot); this.state = Objects.requireNonNull(state); this.indices = Objects.requireNonNull(indices); if (shards == null) { this.shards = ImmutableOpenMap.of(); } else { this.shards = shards; } this.uuid = Objects.requireNonNull(uuid); }
public static MultiFields empty() { return new MultiFields(ImmutableOpenMap.<String, FieldMapper>of()); }
ImmutableOpenMap<String, List<ShardId>> findWaitingIndices(ImmutableOpenMap<ShardId, ShardSnapshotStatus> shards) { Map<String, List<ShardId>> waitingIndicesMap = new HashMap<>(); for (ObjectObjectCursor<ShardId, ShardSnapshotStatus> entry : shards) { if (entry.value.state() == State.WAITING) { final String indexName = entry.key.getIndexName(); List<ShardId> waitingShards = waitingIndicesMap.get(indexName); if (waitingShards == null) { waitingShards = new ArrayList<>(); waitingIndicesMap.put(indexName, waitingShards); } waitingShards.add(entry.key); } } if (waitingIndicesMap.isEmpty()) { return ImmutableOpenMap.of(); } ImmutableOpenMap.Builder<String, List<ShardId>> waitingIndicesBuilder = ImmutableOpenMap.builder(); for (Map.Entry<String, List<ShardId>> entry : waitingIndicesMap.entrySet()) { waitingIndicesBuilder.put(entry.getKey(), Collections.unmodifiableList(entry.getValue())); } return waitingIndicesBuilder.build(); } }
public InternalClusterInfoService(Settings settings, ClusterService clusterService, ThreadPool threadPool, NodeClient client, Consumer<ClusterInfo> listener) { this.leastAvailableSpaceUsages = ImmutableOpenMap.of(); this.mostAvailableSpaceUsages = ImmutableOpenMap.of(); this.shardRoutingToDataPath = ImmutableOpenMap.of(); this.shardSizes = ImmutableOpenMap.of(); this.clusterService = clusterService; this.threadPool = threadPool; this.client = client; this.updateFrequency = INTERNAL_CLUSTER_INFO_UPDATE_INTERVAL_SETTING.get(settings); this.fetchTimeout = INTERNAL_CLUSTER_INFO_TIMEOUT_SETTING.get(settings); this.enabled = DiskThresholdSettings.CLUSTER_ROUTING_ALLOCATION_DISK_THRESHOLD_ENABLED_SETTING.get(settings); ClusterSettings clusterSettings = clusterService.getClusterSettings(); clusterSettings.addSettingsUpdateConsumer(INTERNAL_CLUSTER_INFO_TIMEOUT_SETTING, this::setFetchTimeout); clusterSettings.addSettingsUpdateConsumer(INTERNAL_CLUSTER_INFO_UPDATE_INTERVAL_SETTING, this::setUpdateFrequency); clusterSettings.addSettingsUpdateConsumer(DiskThresholdSettings.CLUSTER_ROUTING_ALLOCATION_DISK_THRESHOLD_ENABLED_SETTING, this::setEnabled); // Add InternalClusterInfoService to listen for Master changes this.clusterService.addLocalNodeMasterListener(this); // Add to listen for state changes (when nodes are added) this.clusterService.addListener(this); this.listener = listener; }
assert concreteIndices != null; if (concreteIndices.length == 0) { return ImmutableOpenMap.of();
"SegmentCommitInfo [{}]", segmentReader.directory(), segmentCommitInfo), e); return ImmutableOpenMap.of(); logger.warn(() -> new ParameterizedMessage("Couldn't list Compound Reader Directory [{}]", finalDirectory), e); return ImmutableOpenMap.of(); new ParameterizedMessage("Couldn't list Directory from SegmentReader [{}] and SegmentInfo [{}]", segmentReader, segmentReader.getSegmentInfo()), e); return ImmutableOpenMap.of();
@Override protected void doMasterOperation(final GetIndexRequest request, String[] concreteIndices, final ClusterState state, final ActionListener<GetIndexResponse> listener) { ImmutableOpenMap<String, ImmutableOpenMap<String, MappingMetaData>> mappingsResult = ImmutableOpenMap.of(); ImmutableOpenMap<String, List<AliasMetaData>> aliasesResult = ImmutableOpenMap.of(); ImmutableOpenMap<String, Settings> settings = ImmutableOpenMap.of(); ImmutableOpenMap<String, Settings> defaultSettings = ImmutableOpenMap.of(); Feature[] features = request.features(); boolean doneAliases = false;
@Override public ImmutableOpenMap<Object, Object> getContext() { return ImmutableOpenMap.of(); }
IndicesShardStoresResponse() { this(ImmutableOpenMap.<String, ImmutableOpenIntMap<List<StoreStatus>>>of(), Collections.<Failure>emptyList()); }
assert concreteIndices != null; if (concreteIndices.length == 0) { return ImmutableOpenMap.of();
@Override public synchronized ImmutableOpenMap<Object, Object> getContext() { return context != null ? ImmutableOpenMap.copyOf(context) : ImmutableOpenMap.of(); }
@Override protected AtomicParentChildFieldData empty(int maxDoc) { return new ParentChildAtomicFieldData(ImmutableOpenMap.<String, AtomicOrdinalsFieldData>of()); }
shards = ImmutableOpenMap.of();
RolloverInfo::readDiffFrom); } else { ImmutableOpenMap<String, RolloverInfo> emptyMap = ImmutableOpenMap.of(); rolloverInfos = DiffableUtils.diff(emptyMap, emptyMap, DiffableUtils.getStringKeySerializer());
public ImmutableOpenMap<String, AliasMetaData> getAliases(String alias) { ImmutableOpenMap<String, AliasMetaData> md = client.admin().cluster().state(new ClusterStateRequest()). actionGet().getState().getMetaData().aliases().get(alias); if (md == null) return ImmutableOpenMap.of(); return md; } private static Comparator<Long> reverseSorter = new Comparator<Long>() {