gpt4 book ai didi

org.apache.solr.common.cloud.ZkStateReader.updateClusterState()方法的使用及代码示例

转载 作者:知者 更新时间:2024-03-15 12:16:40 25 4
gpt4 key购买 nike

本文整理了Java中org.apache.solr.common.cloud.ZkStateReader.updateClusterState()方法的一些代码示例,展示了ZkStateReader.updateClusterState()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。ZkStateReader.updateClusterState()方法的具体详情如下:
包路径:org.apache.solr.common.cloud.ZkStateReader
类名称:ZkStateReader
方法名:updateClusterState

ZkStateReader.updateClusterState介绍

暂无

代码示例

代码示例来源:origin: thinkaurelius/titan

/**
 * Checks if the collection has already been created in Solr.
 */
private static boolean checkIfCollectionExists(CloudSolrClient server, String collection) throws KeeperException, InterruptedException {
  ZkStateReader zkStateReader = server.getZkStateReader();
  zkStateReader.updateClusterState(true);
  ClusterState clusterState = zkStateReader.getClusterState();
  return clusterState.getCollectionOrNull(collection) != null;
}

代码示例来源:origin: thinkaurelius/titan

zkStateReader.updateClusterState(true);
ClusterState clusterState = zkStateReader.getClusterState();
Map<String, Slice> slices = clusterState.getSlicesMap(collection);

代码示例来源:origin: thinkaurelius/titan

@Override
public void clearStorage() throws BackendException {
  try {
    if (mode!=Mode.CLOUD) throw new UnsupportedOperationException("Operation only supported for SolrCloud");
    logger.debug("Clearing storage from Solr: {}", solrClient);
    ZkStateReader zkStateReader = ((CloudSolrClient) solrClient).getZkStateReader();
    zkStateReader.updateClusterState(true);
    ClusterState clusterState = zkStateReader.getClusterState();
    for (String collection : clusterState.getCollections()) {
      logger.debug("Clearing collection [{}] in Solr",collection);
      UpdateRequest deleteAll = newUpdateRequest();
      deleteAll.deleteByQuery("*:*");
      solrClient.request(deleteAll, collection);
    }
  } catch (SolrServerException e) {
    logger.error("Unable to clear storage from index due to server error on Solr.", e);
    throw new PermanentBackendException(e);
  } catch (IOException e) {
    logger.error("Unable to clear storage from index due to low-level I/O error.", e);
    throw new PermanentBackendException(e);
  } catch (Exception e) {
    logger.error("Unable to clear storage from index due to general error.", e);
    throw new PermanentBackendException(e);
  }
}

代码示例来源:origin: com.hynnet/solr-solrj

public void updateLiveNodes() throws KeeperException, InterruptedException {
 updateClusterState(true);
}

代码示例来源:origin: com.hynnet/solr-solrj

public void updateClusterState() throws KeeperException, InterruptedException {
 updateClusterState(false);
}

代码示例来源:origin: com.hynnet/solr-solrj

/** This is not a public API. Only used by ZkController */
public void removeZKWatch(final String coll) {
 synchronized (this) {
  watchedCollections.remove(coll);
  watchedCollectionStates.remove(coll);
  try {
   updateClusterState();
  } catch (KeeperException e) {
   log.error("Error updating state",e);
  } catch (InterruptedException e) {
   log.error("Error updating state",e);
   Thread.currentThread().interrupt();
  }
 }
}

代码示例来源:origin: org.apache.atlas/atlas-titan

/**
 * Checks if the collection has already been created in Solr.
 */
private static boolean checkIfCollectionExists(CloudSolrClient server, String collection) throws KeeperException, InterruptedException {
  ZkStateReader zkStateReader = server.getZkStateReader();
  zkStateReader.updateClusterState();
  ClusterState clusterState = zkStateReader.getClusterState();
  return clusterState.getCollectionOrNull(collection) != null;
}

代码示例来源:origin: apache/incubator-atlas

/**
 * Checks if the collection has already been created in Solr.
 */
private static boolean checkIfCollectionExists(CloudSolrClient server, String collection) throws KeeperException, InterruptedException {
  ZkStateReader zkStateReader = server.getZkStateReader();
  zkStateReader.updateClusterState();
  ClusterState clusterState = zkStateReader.getClusterState();
  return clusterState.getCollectionOrNull(collection) != null;
}

代码示例来源:origin: org.apache.atlas/atlas-titan

zkStateReader.updateClusterState();
ClusterState clusterState = zkStateReader.getClusterState();
Map<String, Slice> slices = clusterState.getSlicesMap(collection);

代码示例来源:origin: apache/incubator-atlas

zkStateReader.updateClusterState();
ClusterState clusterState = zkStateReader.getClusterState();
Map<String, Slice> slices = clusterState.getSlicesMap(collection);

代码示例来源:origin: org.apache.atlas/atlas-titan

@Override
public void clearStorage() throws BackendException {
  try {
    if (mode!=Mode.CLOUD) throw new UnsupportedOperationException("Operation only supported for SolrCloud");
    logger.debug("Clearing storage from Solr: {}", solrClient);
    ZkStateReader zkStateReader = ((CloudSolrClient) solrClient).getZkStateReader();
    zkStateReader.updateClusterState();
    ClusterState clusterState = zkStateReader.getClusterState();
    for (String collection : clusterState.getCollections()) {
      logger.debug("Clearing collection [{}] in Solr",collection);
      UpdateRequest deleteAll = newUpdateRequest();
      deleteAll.deleteByQuery("*:*");
      solrClient.request(deleteAll, collection);
    }
  } catch (SolrServerException e) {
    logger.error("Unable to clear storage from index due to server error on Solr.", e);
    throw new PermanentBackendException(e);
  } catch (IOException e) {
    logger.error("Unable to clear storage from index due to low-level I/O error.", e);
    throw new PermanentBackendException(e);
  } catch (Exception e) {
    logger.error("Unable to clear storage from index due to general error.", e);
    throw new PermanentBackendException(e);
  }
}

代码示例来源:origin: apache/incubator-atlas

@Override
public void clearStorage() throws BackendException {
  try {
    if (mode!=Mode.CLOUD) throw new UnsupportedOperationException("Operation only supported for SolrCloud");
    logger.debug("Clearing storage from Solr: {}", solrClient);
    ZkStateReader zkStateReader = ((CloudSolrClient) solrClient).getZkStateReader();
    zkStateReader.updateClusterState();
    ClusterState clusterState = zkStateReader.getClusterState();
    for (String collection : clusterState.getCollections()) {
      logger.debug("Clearing collection [{}] in Solr",collection);
      UpdateRequest deleteAll = newUpdateRequest();
      deleteAll.deleteByQuery("*:*");
      solrClient.request(deleteAll, collection);
    }
  } catch (SolrServerException e) {
    logger.error("Unable to clear storage from index due to server error on Solr.", e);
    throw new PermanentBackendException(e);
  } catch (IOException e) {
    logger.error("Unable to clear storage from index due to low-level I/O error.", e);
    throw new PermanentBackendException(e);
  } catch (Exception e) {
    logger.error("Unable to clear storage from index due to general error.", e);
    throw new PermanentBackendException(e);
  }
}

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com