mirror of https://github.com/apache/lucene.git
SOLR-13137: NPE when /admin/zookeeper/status endpoint hit in standalone mode
This commit is contained in:
parent
d4e016afdf
commit
b7f99fe55a
|
@ -247,6 +247,8 @@ Bug Fixes
|
||||||
* SOLR-13053: NodeAddedTrigger and NodeLostTrigger do not reserve added/removed time populated by restoreState
|
* SOLR-13053: NodeAddedTrigger and NodeLostTrigger do not reserve added/removed time populated by restoreState
|
||||||
(Cao Manh Dat)
|
(Cao Manh Dat)
|
||||||
|
|
||||||
|
* SOLR-13137: NPE when /admin/zookeeper/status endpoint hit in standalone mode (janhoy)
|
||||||
|
|
||||||
Improvements
|
Improvements
|
||||||
----------------------
|
----------------------
|
||||||
|
|
||||||
|
|
|
@ -32,7 +32,6 @@ import java.util.Map;
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
import org.apache.solr.common.SolrException;
|
import org.apache.solr.common.SolrException;
|
||||||
import org.apache.solr.common.params.SolrParams;
|
|
||||||
import org.apache.solr.common.util.NamedList;
|
import org.apache.solr.common.util.NamedList;
|
||||||
import org.apache.solr.core.CoreContainer;
|
import org.apache.solr.core.CoreContainer;
|
||||||
import org.apache.solr.handler.RequestHandlerBase;
|
import org.apache.solr.handler.RequestHandlerBase;
|
||||||
|
@ -73,10 +72,12 @@ public final class ZookeeperStatusHandler extends RequestHandlerBase {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void handleRequestBody(SolrQueryRequest req, SolrQueryResponse rsp) throws Exception {
|
public void handleRequestBody(SolrQueryRequest req, SolrQueryResponse rsp) throws Exception {
|
||||||
final SolrParams params = req.getParams();
|
|
||||||
Map<String, String> map = new HashMap<>(1);
|
|
||||||
NamedList values = rsp.getValues();
|
NamedList values = rsp.getValues();
|
||||||
values.add("zkStatus", getZkStatus(cores.getZkController().getZkServerAddress()));
|
if (cores.isZooKeeperAware()) {
|
||||||
|
values.add("zkStatus", getZkStatus(cores.getZkController().getZkServerAddress()));
|
||||||
|
} else {
|
||||||
|
throw new SolrException(SolrException.ErrorCode.BAD_REQUEST, "The Zookeeper status API is only available in Cloud mode");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
Loading…
Reference in New Issue