Tabnine Logo
ClusterBlocks.disableStatePersistence
Code IndexAdd Tabnine to your IDE (free)

How to use
disableStatePersistence
method
in
org.elasticsearch.cluster.block.ClusterBlocks

Best Java code snippets using org.elasticsearch.cluster.block.ClusterBlocks.disableStatePersistence (Showing top 20 results out of 315)

origin: org.elasticsearch/elasticsearch

  @Override
  public void clusterChanged(ClusterChangedEvent event) {
    if (event.state().blocks().disableStatePersistence() == false) {
      processDanglingIndices(event.state().metaData());
    }
  }
}
origin: org.elasticsearch/elasticsearch

private void applyChanges(UpdateTask task, ClusterState previousClusterState, ClusterState newClusterState) {
  ClusterChangedEvent clusterChangedEvent = new ClusterChangedEvent(task.source, newClusterState, previousClusterState);
  // new cluster state, notify all listeners
  final DiscoveryNodes.Delta nodesDelta = clusterChangedEvent.nodesDelta();
  if (nodesDelta.hasChanges() && logger.isInfoEnabled()) {
    String summary = nodesDelta.shortSummary();
    if (summary.length() > 0) {
      logger.info("{}, reason: {}", summary, task.source);
    }
  }
  nodeConnectionsService.connectToNodes(newClusterState.nodes());
  logger.debug("applying cluster state version {}", newClusterState.version());
  try {
    // nothing to do until we actually recover from the gateway or any other block indicates we need to disable persistency
    if (clusterChangedEvent.state().blocks().disableStatePersistence() == false && clusterChangedEvent.metaDataChanged()) {
      final Settings incomingSettings = clusterChangedEvent.state().metaData().settings();
      clusterSettings.applySettings(incomingSettings);
    }
  } catch (Exception ex) {
    logger.warn("failed to apply cluster settings", ex);
  }
  logger.debug("apply cluster state with version {}", newClusterState.version());
  callClusterStateAppliers(clusterChangedEvent);
  nodeConnectionsService.disconnectFromNodesExcept(newClusterState.nodes());
  logger.debug("set locally applied cluster state to version {}", newClusterState.version());
  state.set(newClusterState);
  callClusterStateListeners(clusterChangedEvent);
  task.listener.onSuccess(task.source);
}
origin: org.elasticsearch/elasticsearch

if (state.blocks().disableStatePersistence()) {
origin: org.elasticsearch/elasticsearch

@Override
public ClusterState execute(ClusterState currentState) {
  if (currentState.blocks().disableStatePersistence()) {
    return currentState;
origin: org.elasticsearch/elasticsearch

if (event.state().blocks().disableStatePersistence()) {
  return;
origin: org.elasticsearch/elasticsearch

@Override
public synchronized void applyClusterState(final ClusterChangedEvent event) {
  if (!lifecycle.started()) {
    return;
  }
  final ClusterState state = event.state();
  // we need to clean the shards and indices we have on this node, since we
  // are going to recover them again once state persistence is disabled (no master / not recovered)
  // TODO: feels hacky, a block disables state persistence, and then we clean the allocated shards, maybe another flag in blocks?
  if (state.blocks().disableStatePersistence()) {
    for (AllocatedIndex<? extends Shard> indexService : indicesService) {
      indicesService.removeIndex(indexService.index(), NO_LONGER_ASSIGNED,
        "cleaning index (disabled block persistence)"); // also cleans shards
    }
    return;
  }
  updateFailedShardsCache(state);
  deleteIndices(event); // also deletes shards of deleted indices
  removeUnallocatedIndices(event); // also removes shards of removed indices
  failMissingShards(state);
  removeShards(state);   // removes any local shards that doesn't match what the master expects
  updateIndices(event); // can also fail shards, but these are then guaranteed to be in failedShardsCache
  createIndices(state);
  createOrUpdateShards(state);
}
origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.elasticsearch

  @Override
  public void clusterChanged(ClusterChangedEvent event) {
    if (event.state().blocks().disableStatePersistence() == false) {
      processDanglingIndices(event.state().metaData());
    }
  }
}
origin: apache/servicemix-bundles

  @Override
  public void clusterChanged(ClusterChangedEvent event) {
    if (event.state().blocks().disableStatePersistence() == false) {
      processDanglingIndices(event.state().metaData());
    }
  }
}
origin: com.strapdata.elasticsearch/elasticsearch

  @Override
  public void clusterChanged(ClusterChangedEvent event) {
    if (event.state().blocks().disableStatePersistence() == false) {
      processDanglingIndices(event.state().metaData());
    }
  }
}
origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.elasticsearch

private void applyChanges(UpdateTask task, ClusterState previousClusterState, ClusterState newClusterState) {
  ClusterChangedEvent clusterChangedEvent = new ClusterChangedEvent(task.source, newClusterState, previousClusterState);
  // new cluster state, notify all listeners
  final DiscoveryNodes.Delta nodesDelta = clusterChangedEvent.nodesDelta();
  if (nodesDelta.hasChanges() && logger.isInfoEnabled()) {
    String summary = nodesDelta.shortSummary();
    if (summary.length() > 0) {
      logger.info("{}, reason: {}", summary, task.source);
    }
  }
  nodeConnectionsService.connectToNodes(newClusterState.nodes());
  logger.debug("applying cluster state version {}", newClusterState.version());
  try {
    // nothing to do until we actually recover from the gateway or any other block indicates we need to disable persistency
    if (clusterChangedEvent.state().blocks().disableStatePersistence() == false && clusterChangedEvent.metaDataChanged()) {
      final Settings incomingSettings = clusterChangedEvent.state().metaData().settings();
      clusterSettings.applySettings(incomingSettings);
    }
  } catch (Exception ex) {
    logger.warn("failed to apply cluster settings", ex);
  }
  logger.debug("apply cluster state with version {}", newClusterState.version());
  callClusterStateAppliers(clusterChangedEvent);
  nodeConnectionsService.disconnectFromNodesExcept(newClusterState.nodes());
  logger.debug("set locally applied cluster state to version {}", newClusterState.version());
  state.set(newClusterState);
  callClusterStateListeners(clusterChangedEvent);
  task.listener.onSuccess(task.source);
}
origin: harbby/presto-connectors

@Override
public void clusterChanged(ClusterChangedEvent event) {
  if (event.state().blocks().disableStatePersistence()) {
    return;
origin: apache/servicemix-bundles

private void applyChanges(UpdateTask task, ClusterState previousClusterState, ClusterState newClusterState) {
  ClusterChangedEvent clusterChangedEvent = new ClusterChangedEvent(task.source, newClusterState, previousClusterState);
  // new cluster state, notify all listeners
  final DiscoveryNodes.Delta nodesDelta = clusterChangedEvent.nodesDelta();
  if (nodesDelta.hasChanges() && logger.isInfoEnabled()) {
    String summary = nodesDelta.shortSummary();
    if (summary.length() > 0) {
      logger.info("{}, reason: {}", summary, task.source);
    }
  }
  nodeConnectionsService.connectToNodes(newClusterState.nodes());
  logger.debug("applying cluster state version {}", newClusterState.version());
  try {
    // nothing to do until we actually recover from the gateway or any other block indicates we need to disable persistency
    if (clusterChangedEvent.state().blocks().disableStatePersistence() == false && clusterChangedEvent.metaDataChanged()) {
      final Settings incomingSettings = clusterChangedEvent.state().metaData().settings();
      clusterSettings.applySettings(incomingSettings);
    }
  } catch (Exception ex) {
    logger.warn("failed to apply cluster settings", ex);
  }
  logger.debug("apply cluster state with version {}", newClusterState.version());
  callClusterStateAppliers(clusterChangedEvent);
  nodeConnectionsService.disconnectFromNodesExcept(newClusterState.nodes());
  logger.debug("set locally applied cluster state to version {}", newClusterState.version());
  state.set(newClusterState);
  callClusterStateListeners(clusterChangedEvent);
  task.listener.onSuccess(task.source);
}
origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.elasticsearch

@Override
public ClusterState execute(ClusterState currentState) {
  if (currentState.blocks().disableStatePersistence()) {
    return currentState;
origin: com.strapdata.elasticsearch/elasticsearch

@Override
public ClusterState execute(ClusterState currentState) {
  if (currentState.blocks().disableStatePersistence()) {
    return currentState;
origin: apache/servicemix-bundles

@Override
public ClusterState execute(ClusterState currentState) {
  if (currentState.blocks().disableStatePersistence()) {
    return currentState;
origin: apache/servicemix-bundles

@Override
public synchronized void applyClusterState(final ClusterChangedEvent event) {
  if (!lifecycle.started()) {
    return;
  }
  final ClusterState state = event.state();
  // we need to clean the shards and indices we have on this node, since we
  // are going to recover them again once state persistence is disabled (no master / not recovered)
  // TODO: feels hacky, a block disables state persistence, and then we clean the allocated shards, maybe another flag in blocks?
  if (state.blocks().disableStatePersistence()) {
    for (AllocatedIndex<? extends Shard> indexService : indicesService) {
      indicesService.removeIndex(indexService.index(), NO_LONGER_ASSIGNED,
        "cleaning index (disabled block persistence)"); // also cleans shards
    }
    return;
  }
  updateFailedShardsCache(state);
  deleteIndices(event); // also deletes shards of deleted indices
  removeUnallocatedIndices(event); // also removes shards of removed indices
  failMissingShards(state);
  removeShards(state);   // removes any local shards that doesn't match what the master expects
  updateIndices(event); // can also fail shards, but these are then guaranteed to be in failedShardsCache
  createIndices(state);
  createOrUpdateShards(state);
}
origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.elasticsearch

@Override
public synchronized void applyClusterState(final ClusterChangedEvent event) {
  if (!lifecycle.started()) {
    return;
  }
  final ClusterState state = event.state();
  // we need to clean the shards and indices we have on this node, since we
  // are going to recover them again once state persistence is disabled (no master / not recovered)
  // TODO: feels hacky, a block disables state persistence, and then we clean the allocated shards, maybe another flag in blocks?
  if (state.blocks().disableStatePersistence()) {
    for (AllocatedIndex<? extends Shard> indexService : indicesService) {
      indicesService.removeIndex(indexService.index(), NO_LONGER_ASSIGNED,
        "cleaning index (disabled block persistence)"); // also cleans shards
    }
    return;
  }
  updateFailedShardsCache(state);
  deleteIndices(event); // also deletes shards of deleted indices
  removeUnallocatedIndices(event); // also removes shards of removed indices
  failMissingShards(state);
  removeShards(state);   // removes any local shards that doesn't match what the master expects
  updateIndices(event); // can also fail shards, but these are then guaranteed to be in failedShardsCache
  createIndices(state);
  createOrUpdateShards(state);
}
origin: harbby/presto-connectors

@Override
public ClusterState execute(ClusterState currentState) {
  if (currentState.blocks().disableStatePersistence()) {
    return currentState;
origin: harbby/presto-connectors

@Override
public void clusterChanged(ClusterChangedEvent event) {
  if (!event.routingTableChanged()) {
    return;
  }
  if (event.state().blocks().disableStatePersistence()) {
    return;
  }
  for (IndexRoutingTable indexRoutingTable : event.state().routingTable()) {
    // Note, closed indices will not have any routing information, so won't be deleted
    for (IndexShardRoutingTable indexShardRoutingTable : indexRoutingTable) {
      if (shardCanBeDeleted(event.state(), indexShardRoutingTable)) {
        ShardId shardId = indexShardRoutingTable.shardId();
        if (indicesService.canDeleteShardContent(shardId, event.state().getMetaData().index(shardId.getIndex()))) {
          deleteShardIfExistElseWhere(event.state(), indexShardRoutingTable);
        }
      }
    }
  }
}
origin: harbby/presto-connectors

if (event.state().blocks().disableStatePersistence()) {
  for (IndexService indexService : indicesService) {
    String index = indexService.index().getName();
org.elasticsearch.cluster.blockClusterBlocksdisableStatePersistence

Javadoc

Returns true if one of the global blocks as its disable state persistence flag set.

Popular methods of ClusterBlocks

  • globalBlockedException
  • indicesBlockedException
  • builder
  • globalBlockedRaiseException
  • indexBlockedException
  • <init>
  • diff
  • global
  • globalBlocked
  • hasGlobalBlock
    Is there a global block with the provided status?
  • indexBlocked
  • indexBlockedRaiseException
  • indexBlocked,
  • indexBlockedRaiseException,
  • indices,
  • readBlockSet,
  • readDiffFrom,
  • writeBlockSet,
  • writeTo,
  • blocksForIndex,
  • generateLevelHolders

Popular in Java

  • Start an intent from android
  • getSystemService (Context)
  • onRequestPermissionsResult (Fragment)
  • addToBackStack (FragmentTransaction)
  • OutputStream (java.io)
    A writable sink for bytes.Most clients will use output streams that write data to the file system (
  • Arrays (java.util)
    This class contains various methods for manipulating arrays (such as sorting and searching). This cl
  • Map (java.util)
    A Map is a data structure consisting of a set of keys and values in which each key is mapped to a si
  • SortedSet (java.util)
    SortedSet is a Set which iterates over its elements in a sorted order. The order is determined eithe
  • HttpServlet (javax.servlet.http)
    Provides an abstract class to be subclassed to create an HTTP servlet suitable for a Web site. A sub
  • XPath (javax.xml.xpath)
    XPath provides access to the XPath evaluation environment and expressions. Evaluation of XPath Expr
  • Top Vim plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now