Examples of DocRouter


Examples of org.apache.solr.common.cloud.DocRouter

    shardNumbers = new HashMap(10 * slices.size()); // sparse for performance
    for (int i = 0; i < slices.size(); i++) {
      shardNumbers.put(slices.get(i).getName(), i);
    }
    LOG.debug("Using SolrCloud docCollection: {}", docCollection);
    DocRouter docRouter = docCollection.getRouter();
    if (docRouter == null) {
      throw new IllegalArgumentException("docRouter must not be null");
    }
    LOG.info("Using SolrCloud docRouterClass: {}", docRouter.getClass());   
  }
View Full Code Here

Examples of org.apache.solr.common.cloud.DocRouter

    return conf;
  }
 
  @Override
  public int getPartition(Text key, SolrInputDocumentWritable value, int numPartitions) {
    DocRouter docRouter = docCollection.getRouter();
    SolrInputDocument doc = value.getSolrInputDocument();
    String keyStr = key.toString();
   
    // TODO: scalability: replace linear search in HashBasedRouter.hashToSlice() with binary search on sorted hash ranges
    Slice slice = docRouter.getTargetSlice(keyStr, doc, emptySolrParams, docCollection);
   
//    LOG.info("slice: {}", slice);
    if (slice == null) {
      throw new IllegalStateException("No matching slice found! The slice seems unavailable. docRouterClass: "
          + docRouter.getClass().getName());
    }
    int rootShard = shardNumbers.get(slice.getName());
    if (rootShard < 0 || rootShard >= shards) {
      throw new IllegalStateException("Illegal shard number " + rootShard + " for slice: " + slice + ", docCollection: "
          + docCollection);
View Full Code Here

Examples of org.apache.solr.common.cloud.DocRouter

    shardNumbers = new HashMap(10 * slices.size()); // sparse for performance
    for (int i = 0; i < slices.size(); i++) {
      shardNumbers.put(slices.get(i).getName(), i);
    }
    LOG.debug("Using SolrCloud docCollection: {}", docCollection);
    DocRouter docRouter = docCollection.getRouter();
    if (docRouter == null) {
      throw new IllegalArgumentException("docRouter must not be null");
    }
    LOG.info("Using SolrCloud docRouterClass: {}", docRouter.getClass());   
  }
View Full Code Here

Examples of org.apache.solr.common.cloud.DocRouter

    return conf;
  }
 
  @Override
  public int getPartition(Text key, SolrInputDocumentWritable value, int numPartitions) {
    DocRouter docRouter = docCollection.getRouter();
    SolrInputDocument doc = value.getSolrInputDocument();
    String keyStr = key.toString();
   
    // TODO: scalability: replace linear search in HashBasedRouter.hashToSlice() with binary search on sorted hash ranges
    Slice slice = docRouter.getTargetSlice(keyStr, doc, emptySolrParams, docCollection);
   
//    LOG.info("slice: {}", slice);
    if (slice == null) {
      throw new IllegalStateException("No matching slice found! The slice seems unavailable. docRouterClass: "
          + docRouter.getClass().getName());
    }
    int rootShard = shardNumbers.get(slice.getName());
    if (rootShard < 0 || rootShard >= shards) {
      throw new IllegalStateException("Illegal shard number " + rootShard + " for slice: " + slice + ", docCollection: "
          + docCollection);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.