@Override public boolean mustAck(DiscoveryNode discoveryNode) { // repository is created on both master and data nodes return discoveryNode.isMasterNode() || discoveryNode.isDataNode(); } });
@Override public void close() { if (DiscoveryNode.isDataNode(settings)) { clusterService.removeListener(this); } }
@Override public boolean mustAck(DiscoveryNode discoveryNode) { // repository was created on both master and data nodes return discoveryNode.isMasterNode() || discoveryNode.isDataNode(); } });
@Override protected void doStart() { // Doesn't make sense to manage shards on non-master and non-data nodes if (DiscoveryNode.isDataNode(settings) || DiscoveryNode.isMasterNode(settings)) { clusterService.addHighPriorityApplier(this); } }
@Override protected void doStop() { if (DiscoveryNode.isDataNode(settings) || DiscoveryNode.isMasterNode(settings)) { clusterService.removeApplier(this); } }
/** * Handle case where a disco node cannot be found in the routing table. Usually means that it's not a data node. */ protected RerouteExplanation explainOrThrowMissingRoutingNode(RoutingAllocation allocation, boolean explain, DiscoveryNode discoNode) { if (!discoNode.isDataNode()) { return explainOrThrowRejectedCommand(explain, allocation, "allocation can only be done on data nodes, not [" + node + "]"); } else { return explainOrThrowRejectedCommand(explain, allocation, "could not find [" + node + "] among the routing nodes"); } }
public RepositoriesService(Settings settings, ClusterService clusterService, TransportService transportService, Map<String, Repository.Factory> typesRegistry, Map<String, Repository.Factory> internalTypesRegistry, ThreadPool threadPool) { this.typesRegistry = typesRegistry; this.internalTypesRegistry = internalTypesRegistry; this.clusterService = clusterService; this.threadPool = threadPool; // Doesn't make sense to maintain repositories on non-master and non-data nodes // Nothing happens there anyway if (DiscoveryNode.isDataNode(settings) || DiscoveryNode.isMasterNode(settings)) { clusterService.addStateApplier(this); } this.verifyAction = new VerifyNodeRepositoryAction(transportService, clusterService, this); }
protected static boolean isDataOnlyNode(ClusterState state) { return ((state.nodes().getLocalNode().isMasterNode() == false) && state.nodes().getLocalNode().isDataNode()); }
this.metaStateService = metaStateService; if (DiscoveryNode.isDataNode(settings)) { ensureNoPre019ShardState(nodeEnv); if (DiscoveryNode.isMasterNode(settings) || DiscoveryNode.isDataNode(settings)) { nodeEnv.ensureAtomicMoveSupported(); if (DiscoveryNode.isMasterNode(settings) || DiscoveryNode.isDataNode(settings)) { try { ensureNoPre019State();
@Inject public IndicesStore(Settings settings, IndicesService indicesService, ClusterService clusterService, TransportService transportService, ThreadPool threadPool) { this.settings = settings; this.indicesService = indicesService; this.clusterService = clusterService; this.transportService = transportService; this.threadPool = threadPool; transportService.registerRequestHandler(ACTION_SHARD_EXISTS, ShardActiveRequest::new, ThreadPool.Names.SAME, new ShardActiveRequestHandler()); this.deleteShardTimeout = INDICES_STORE_DELETE_SHARD_TIMEOUT.get(settings); // Doesn't make sense to delete shards on non-data nodes if (DiscoveryNode.isDataNode(settings)) { // we double check nothing has changed when responses come back from other nodes. // it's easier to do that check when the current cluster state is visible. // also it's good in general to let things settle down clusterService.addListener(this); } }
@Inject public SnapshotShardsService(Settings settings, ClusterService clusterService, SnapshotsService snapshotsService, ThreadPool threadPool, TransportService transportService, IndicesService indicesService, ActionFilters actionFilters, IndexNameExpressionResolver indexNameExpressionResolver) { super(settings); this.settings = settings; this.indicesService = indicesService; this.snapshotsService = snapshotsService; this.transportService = transportService; this.clusterService = clusterService; this.threadPool = threadPool; if (DiscoveryNode.isDataNode(settings)) { // this is only useful on the nodes that can hold data clusterService.addListener(this); } // The constructor of UpdateSnapshotStatusAction will register itself to the TransportService. this.updateSnapshotStatusHandler = new UpdateSnapshotStatusAction(settings, UPDATE_SNAPSHOT_STATUS_ACTION_NAME, transportService, clusterService, threadPool, actionFilters, indexNameExpressionResolver); if (DiscoveryNode.isMasterNode(settings)) { // This needs to run only on nodes that can become masters transportService.registerRequestHandler(UPDATE_SNAPSHOT_STATUS_ACTION_NAME_V6, UpdateSnapshotStatusRequestV6::new, ThreadPool.Names.SAME, new UpdateSnapshotStateRequestHandlerV6()); } }
boolean success = true; if (state.nodes().getLocalNode().isMasterNode() || state.nodes().getLocalNode().isDataNode()) { if (previousMetaData == null) { try {
if (addedNode.isDataNode()) { dataNodeAdded = true; break; if (removedNode.isDataNode()) { if (logger.isTraceEnabled()) { logger.trace("Removing node from cluster info: {}", removedNode.getId());
if (fromRoutingNode == null && !fromDiscoNode.isDataNode()) { throw new IllegalArgumentException("[move_allocation] can't move [" + index + "][" + shardId + "] from " + fromDiscoNode + " to " + toDiscoNode + ": source [" + fromDiscoNode.getName() if (toRoutingNode == null && !toDiscoNode.isDataNode()) { throw new IllegalArgumentException("[move_allocation] can't move [" + index + "][" + shardId + "] from " + fromDiscoNode + " to " + toDiscoNode + ": source [" + toDiscoNode.getName()
Version maxNonClientNodeVersion = null; for (ObjectObjectCursor<String, DiscoveryNode> nodeEntry : nodes) { if (nodeEntry.value.isDataNode()) { dataNodesBuilder.put(nodeEntry.key, nodeEntry.value); if (nodeEntry.value.isDataNode() || nodeEntry.value.isMasterNode()) { if (minNonClientNodeVersion == null) { minNonClientNodeVersion = version;
@Override public void close() { if (DiscoveryNode.isDataNode(settings)) { clusterService.removeListener(this); } }
if (DiscoveryNode.isMasterNode(settings) || DiscoveryNode.isDataNode(settings)) { onDiskMetadata = injector.getInstance(GatewayMetaState.class).loadMetaState(); } else {
/** * Builds a default connection profile based on the provided settings. * * @param settings to build the connection profile from * @return the connection profile */ public static ConnectionProfile buildDefaultConnectionProfile(Settings settings) { int connectionsPerNodeRecovery = TransportSettings.CONNECTIONS_PER_NODE_RECOVERY.get(settings); int connectionsPerNodeBulk = TransportSettings.CONNECTIONS_PER_NODE_BULK.get(settings); int connectionsPerNodeReg = TransportSettings.CONNECTIONS_PER_NODE_REG.get(settings); int connectionsPerNodeState = TransportSettings.CONNECTIONS_PER_NODE_STATE.get(settings); int connectionsPerNodePing = TransportSettings.CONNECTIONS_PER_NODE_PING.get(settings); Builder builder = new Builder(); builder.setConnectTimeout(TransportSettings.CONNECT_TIMEOUT.get(settings)); builder.setHandshakeTimeout(TransportSettings.CONNECT_TIMEOUT.get(settings)); builder.setPingInterval(TransportSettings.PING_SCHEDULE.get(settings)); builder.setCompressionEnabled(TransportSettings.TRANSPORT_COMPRESS.get(settings)); builder.addConnections(connectionsPerNodeBulk, TransportRequestOptions.Type.BULK); builder.addConnections(connectionsPerNodePing, TransportRequestOptions.Type.PING); // if we are not master eligible we don't need a dedicated channel to publish the state builder.addConnections(DiscoveryNode.isMasterNode(settings) ? connectionsPerNodeState : 0, TransportRequestOptions.Type.STATE); // if we are not a data-node we don't need any dedicated channels for recovery builder.addConnections(DiscoveryNode.isDataNode(settings) ? connectionsPerNodeRecovery : 0, TransportRequestOptions.Type.RECOVERY); builder.addConnections(connectionsPerNodeReg, TransportRequestOptions.Type.REG); return builder.build(); }
@Override public boolean test(NodeAndClient nodeAndClient) { return DiscoveryNode.isDataNode(nodeAndClient.node.settings()) || DiscoveryNode.isMasterNode(nodeAndClient.node.settings()); } }
@Override public boolean test(NodeAndClient nodeAndClient) { return DiscoveryNode.isMasterNode(nodeAndClient.node.settings()) == false && DiscoveryNode.isDataNode(nodeAndClient.node.settings()) == false; } }