gpt4 book ai didi

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

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

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

ZkStateReader.getCollectionLive介绍

暂无

代码示例

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

@Override
public DocCollection get() {
 return getCollectionLive(ZkStateReader.this, collName);
}

代码示例来源:origin: org.apache.solr/solr-solrj

@Override
public synchronized DocCollection get(boolean allowCached) {
 gets.incrementAndGet();
 if (!allowCached || lastUpdateTime < 0 || System.nanoTime() - lastUpdateTime > LAZY_CACHE_TIME) {
  boolean shouldFetch = true;
  if (cachedDocCollection != null) {
   Stat exists = null;
   try {
    exists = zkClient.exists(getCollectionPath(collName), null, true);
   } catch (Exception e) {}
   if (exists != null && exists.getVersion() == cachedDocCollection.getZNodeVersion()) {
    shouldFetch = false;
   }
  }
  if (shouldFetch) {
   cachedDocCollection = getCollectionLive(ZkStateReader.this, collName);
   lastUpdateTime = System.nanoTime();
  }
 }
 return cachedDocCollection;
}

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

synchronized (this) {
 if (watchedCollections.contains(s)) {
  DocCollection live = getCollectionLive(this, s);
  if (live != null) {
   updateWatchedCollection(live);

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

zkClient.exists(fullpath, watcher, true);
DocCollection collection = getCollectionLive(this, coll);
if (collection != null) {
 updateWatchedCollection(collection);

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

public Integer compareStateVersions(String coll, int version) {
 DocCollection collection = clusterState.getCollectionOrNull(coll);
 if (collection == null) return null;
 if (collection.getZNodeVersion() < version) {
  log.debug("server older than client {}<{}", collection.getZNodeVersion(), version);
  DocCollection nu = getCollectionLive(this, coll);
  if (nu == null) return -1 ;
  if (nu.getZNodeVersion() > collection.getZNodeVersion()) {
   updateWatchedCollection(nu);
   collection = nu;
  }
 }
 
 if (collection.getZNodeVersion() == version) {
  return null;
 }
 
 log.debug("wrong version from client {}!={} ", version, collection.getZNodeVersion());
 
 return collection.getZNodeVersion();
}

代码示例来源:origin: org.apache.solr/solr-solrj

public Integer compareStateVersions(String coll, int version) {
 DocCollection collection = clusterState.getCollectionOrNull(coll);
 if (collection == null) return null;
 if (collection.getZNodeVersion() < version) {
  log.debug("Server older than client {}<{}", collection.getZNodeVersion(), version);
  DocCollection nu = getCollectionLive(this, coll);
  if (nu == null) return -1 ;
  if (nu.getZNodeVersion() > collection.getZNodeVersion()) {
   if (updateWatchedCollection(coll, nu)) {
    synchronized (getUpdateLock()) {
     constructState(Collections.singleton(coll));
    }
   }
   collection = nu;
  }
 }
 
 if (collection.getZNodeVersion() == version) {
  return null;
 }
 
 log.debug("Wrong version from client [{}]!=[{}]", version, collection.getZNodeVersion());
 
 return collection.getZNodeVersion();
}

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