mirror of https://github.com/apache/lucene.git
SOLR-9132: Don't require indexInfo from corestatus over reloads
This commit is contained in:
parent
cff2774a37
commit
3b49705c43
|
@ -49,6 +49,7 @@ import org.apache.solr.client.solrj.impl.HttpSolrClient;
|
|||
import org.apache.solr.client.solrj.request.CollectionAdminRequest;
|
||||
import org.apache.solr.client.solrj.request.CoreAdminRequest;
|
||||
import org.apache.solr.client.solrj.request.CoreAdminRequest.Create;
|
||||
import org.apache.solr.client.solrj.request.CoreStatus;
|
||||
import org.apache.solr.client.solrj.request.QueryRequest;
|
||||
import org.apache.solr.client.solrj.request.UpdateRequest;
|
||||
import org.apache.solr.client.solrj.response.CollectionAdminResponse;
|
||||
|
@ -590,11 +591,11 @@ public class CollectionsAPIDistributedZkTest extends SolrCloudTestCase {
|
|||
for (Slice shard : collectionState) {
|
||||
for (Replica replica : shard) {
|
||||
ZkCoreNodeProps coreProps = new ZkCoreNodeProps(replica);
|
||||
CoreAdminResponse mcr;
|
||||
CoreStatus coreStatus;
|
||||
try (HttpSolrClient server = getHttpSolrClient(coreProps.getBaseUrl())) {
|
||||
mcr = CoreAdminRequest.getStatus(coreProps.getCoreName(), server);
|
||||
coreStatus = CoreAdminRequest.getCoreStatus(coreProps.getCoreName(), false, server);
|
||||
}
|
||||
long before = mcr.getStartTime(coreProps.getCoreName()).getTime();
|
||||
long before = coreStatus.getCoreStartTime().getTime();
|
||||
urlToTime.put(coreProps.getCoreUrl(), before);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -620,8 +620,14 @@ public class CoreAdminRequest extends SolrRequest<CoreAdminResponse> {
|
|||
}
|
||||
|
||||
public static CoreStatus getCoreStatus(String coreName, SolrClient client) throws SolrServerException, IOException {
|
||||
return getCoreStatus(coreName, true, client);
|
||||
}
|
||||
|
||||
public static CoreStatus getCoreStatus(String coreName, boolean getIndexInfo, SolrClient client)
|
||||
throws SolrServerException, IOException {
|
||||
CoreAdminRequest req = new CoreAdminRequest();
|
||||
req.setAction(CoreAdminAction.STATUS);
|
||||
req.setIndexInfoNeeded(getIndexInfo);
|
||||
return new CoreStatus(req.process(client).getCoreStatus(coreName));
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue