本文整理了Java中org.apache.solr.hadoop.ZooKeeperInspector.getSortedSlices()
方法的一些代码示例,展示了ZooKeeperInspector.getSortedSlices()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。ZooKeeperInspector.getSortedSlices()
方法的具体详情如下:
包路径:org.apache.solr.hadoop.ZooKeeperInspector
类名称:ZooKeeperInspector
方法名:getSortedSlices
暂无
代码示例来源:origin: NGDATA/hbase-indexer
public static List<Slice> getSortedSlices(Collection<Slice> slices) {
return DELEGATE.getSortedSlices(slices);
}
代码示例来源:origin: com.ngdata/hbase-indexer-mr
public static List<Slice> getSortedSlices(Collection<Slice> slices) {
return DELEGATE.getSortedSlices(slices);
}
代码示例来源:origin: com.cloudera.search/search-mr
throw new IllegalArgumentException("Incompatible shards: + " + shards + " for docCollection: " + docCollection);
List<Slice> slices = new ZooKeeperInspector().getSortedSlices(docCollection.getSlices());
if (slices.size() != shards) {
throw new IllegalStateException("Incompatible sorted shards: + " + shards + " for docCollection: " + docCollection);
代码示例来源:origin: cloudera/search
throw new IllegalArgumentException("Incompatible shards: + " + shards + " for docCollection: " + docCollection);
List<Slice> slices = new ZooKeeperInspector().getSortedSlices(docCollection.getSlices());
if (slices.size() != shards) {
throw new IllegalStateException("Incompatible sorted shards: + " + shards + " for docCollection: " + docCollection);
代码示例来源:origin: cloudera/search
public List<List<String>> extractShardUrls(String zkHost, String collection) {
DocCollection docCollection = extractDocCollection(zkHost, collection);
List<Slice> slices = getSortedSlices(docCollection.getSlices());
List<List<String>> solrUrls = new ArrayList<List<String>>(slices.size());
for (Slice slice : slices) {
if (slice.getLeader() == null) {
throw new IllegalArgumentException("Cannot find SolrCloud slice leader. " +
"It looks like not all of your shards are registered in ZooKeeper yet");
}
Collection<Replica> replicas = slice.getReplicas();
List<String> urls = new ArrayList<String>(replicas.size());
for (Replica replica : replicas) {
ZkCoreNodeProps props = new ZkCoreNodeProps(replica);
urls.add(props.getCoreUrl());
}
solrUrls.add(urls);
}
return solrUrls;
}
代码示例来源:origin: com.cloudera.search/search-mr
public List<List<String>> extractShardUrls(String zkHost, String collection) {
DocCollection docCollection = extractDocCollection(zkHost, collection);
List<Slice> slices = getSortedSlices(docCollection.getSlices());
List<List<String>> solrUrls = new ArrayList<List<String>>(slices.size());
for (Slice slice : slices) {
if (slice.getLeader() == null) {
throw new IllegalArgumentException("Cannot find SolrCloud slice leader. " +
"It looks like not all of your shards are registered in ZooKeeper yet");
}
Collection<Replica> replicas = slice.getReplicas();
List<String> urls = new ArrayList<String>(replicas.size());
for (Replica replica : replicas) {
ZkCoreNodeProps props = new ZkCoreNodeProps(replica);
if (replica.getStr(Slice.LEADER) == null) {
urls.add(props.getCoreUrl()); // add followers at tail
} else {
urls.add(0, props.getCoreUrl()); // insert leader at head
}
}
solrUrls.add(urls);
}
return solrUrls;
}
内容来源于网络,如有侵权,请联系作者删除!