当前位置: 首页>>代码示例>>Java>>正文


Java CoreDescriptor.getCloudDescriptor方法代码示例

本文整理汇总了Java中org.apache.solr.core.CoreDescriptor.getCloudDescriptor方法的典型用法代码示例。如果您正苦于以下问题:Java CoreDescriptor.getCloudDescriptor方法的具体用法?Java CoreDescriptor.getCloudDescriptor怎么用?Java CoreDescriptor.getCloudDescriptor使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.apache.solr.core.CoreDescriptor的用法示例。


在下文中一共展示了CoreDescriptor.getCloudDescriptor方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: DistributedUpdateProcessor

import org.apache.solr.core.CoreDescriptor; //导入方法依赖的package包/类
public DistributedUpdateProcessor(SolrQueryRequest req,
    SolrQueryResponse rsp, UpdateRequestProcessor next) {
  super(next);
  this.rsp = rsp;
  this.next = next;
  this.idField = req.getSchema().getUniqueKeyField();
  // version init

  this.updateHandler = req.getCore().getUpdateHandler();
  this.ulog = updateHandler.getUpdateLog();
  this.vinfo = ulog == null ? null : ulog.getVersionInfo();
  versionsStored = this.vinfo != null && this.vinfo.getVersionField() != null;
  returnVersions = req.getParams().getBool(UpdateParams.VERSIONS ,false);

  // TODO: better way to get the response, or pass back info to it?
  SolrRequestInfo reqInfo = returnVersions ? SolrRequestInfo.getRequestInfo() : null;

  this.req = req;
  
  CoreDescriptor coreDesc = req.getCore().getCoreDescriptor();
  
  this.zkEnabled  = coreDesc.getCoreContainer().isZooKeeperAware();
  zkController = req.getCore().getCoreDescriptor().getCoreContainer().getZkController();
  if (zkEnabled) {
    cmdDistrib = new SolrCmdDistributor(coreDesc.getCoreContainer().getUpdateShardHandler());
  }
  //this.rsp = reqInfo != null ? reqInfo.getRsp() : null;

  cloudDesc = coreDesc.getCloudDescriptor();
  
  if (cloudDesc != null) {
    collection = cloudDesc.getCollectionName();
  } else {
    collection = null;
  }

}
 
开发者ID:europeana,项目名称:search,代码行数:38,代码来源:DistributedUpdateProcessor.java

示例2: needsToBeAssignedShardId

import org.apache.solr.core.CoreDescriptor; //导入方法依赖的package包/类
private boolean needsToBeAssignedShardId(final CoreDescriptor desc,
    final ClusterState state, final String coreNodeName) {

  final CloudDescriptor cloudDesc = desc.getCloudDescriptor();
  
  final String shardId = state.getShardId(getNodeName(), desc.getName());

  if (shardId != null) {
    cloudDesc.setShardId(shardId);
    return false;
  }
  return true;
}
 
开发者ID:europeana,项目名称:search,代码行数:14,代码来源:ZkController.java

示例3: DistributedUpdateProcessor

import org.apache.solr.core.CoreDescriptor; //导入方法依赖的package包/类
public DistributedUpdateProcessor(SolrQueryRequest req,
    SolrQueryResponse rsp, UpdateRequestProcessor next) {
  super(next);
  this.rsp = rsp;
  this.next = next;
  this.idField = req.getSchema().getUniqueKeyField();
  // version init

  this.updateHandler = req.getCore().getUpdateHandler();
  this.ulog = updateHandler.getUpdateLog();
  this.vinfo = ulog == null ? null : ulog.getVersionInfo();
  versionsStored = this.vinfo != null && this.vinfo.getVersionField() != null;
  returnVersions = req.getParams().getBool(UpdateParams.VERSIONS ,false);

  // TODO: better way to get the response, or pass back info to it?
  SolrRequestInfo reqInfo = returnVersions ? SolrRequestInfo.getRequestInfo() : null;

  this.req = req;
  
  CoreDescriptor coreDesc = req.getCore().getCoreDescriptor();
  
  this.zkEnabled  = coreDesc.getCoreContainer().isZooKeeperAware();
  zkController = req.getCore().getCoreDescriptor().getCoreContainer().getZkController();
  if (zkEnabled) {
    numNodes =  zkController.getZkStateReader().getClusterState().getLiveNodes().size();
    cmdDistrib = new SolrCmdDistributor(numNodes, coreDesc.getCoreContainer().getZkController().getUpdateShardHandler());
  }
  //this.rsp = reqInfo != null ? reqInfo.getRsp() : null;

  cloudDesc = coreDesc.getCloudDescriptor();
  
  if (cloudDesc != null) {
    collection = cloudDesc.getCollectionName();
  }
}
 
开发者ID:pkarmstr,项目名称:NYBC,代码行数:36,代码来源:DistributedUpdateProcessor.java

示例4: markAllAsNotLeader

import org.apache.solr.core.CoreDescriptor; //导入方法依赖的package包/类
private void markAllAsNotLeader(
    final CurrentCoreDescriptorProvider registerOnReconnect) {
  List<CoreDescriptor> descriptors = registerOnReconnect
      .getCurrentDescriptors();
  if (descriptors != null) {
    for (CoreDescriptor descriptor : descriptors) {
      descriptor.getCloudDescriptor().isLeader = false;
    }
  }
}
 
开发者ID:pkarmstr,项目名称:NYBC,代码行数:11,代码来源:ZkController.java

示例5: publish

import org.apache.solr.core.CoreDescriptor; //导入方法依赖的package包/类
/**
 * Publish core state to overseer.
 */
public void publish(final CoreDescriptor cd, final String state, boolean updateLastState) throws KeeperException, InterruptedException {
  log.info("publishing core={} state={}", cd.getName(), state);
  //System.out.println(Thread.currentThread().getStackTrace()[3]);
  Integer numShards = cd.getCloudDescriptor().getNumShards();
  if (numShards == null) { //XXX sys prop hack
    log.info("numShards not found on descriptor - reading it from system property");
    numShards = Integer.getInteger(ZkStateReader.NUM_SHARDS_PROP);
  }
  
  String coreNodeName = cd.getCloudDescriptor().getCoreNodeName();
  //assert cd.getCloudDescriptor().getShardId() != null;
  ZkNodeProps m = new ZkNodeProps(Overseer.QUEUE_OPERATION, "state", 
      ZkStateReader.STATE_PROP, state, 
      ZkStateReader.BASE_URL_PROP, getBaseUrl(), 
      ZkStateReader.CORE_NAME_PROP, cd.getName(),
      ZkStateReader.ROLES_PROP, cd.getCloudDescriptor().getRoles(),
      ZkStateReader.NODE_NAME_PROP, getNodeName(),
      ZkStateReader.SHARD_ID_PROP, cd.getCloudDescriptor().getShardId(),
      ZkStateReader.COLLECTION_PROP, cd.getCloudDescriptor()
          .getCollectionName(),
      ZkStateReader.NUM_SHARDS_PROP, numShards != null ? numShards.toString()
          : null,
      ZkStateReader.CORE_NODE_NAME_PROP, coreNodeName != null ? coreNodeName
          : null);
  if (updateLastState) {
    cd.getCloudDescriptor().lastPublished = state;
  }
  overseerJobQueue.offer(ZkStateReader.toJSON(m));
}
 
开发者ID:pkarmstr,项目名称:NYBC,代码行数:33,代码来源:ZkController.java

示例6: needsToBeAssignedShardId

import org.apache.solr.core.CoreDescriptor; //导入方法依赖的package包/类
private boolean needsToBeAssignedShardId(final CoreDescriptor desc,
    final ClusterState state, final String coreNodeName) {

  final CloudDescriptor cloudDesc = desc.getCloudDescriptor();
  
  final String shardId = state.getShardId(coreNodeName);

  if (shardId != null) {
    cloudDesc.setShardId(shardId);
    return false;
  }
  return true;
}
 
开发者ID:pkarmstr,项目名称:NYBC,代码行数:14,代码来源:ZkController.java


注:本文中的org.apache.solr.core.CoreDescriptor.getCloudDescriptor方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。