Github user dsmiley commented on a diff in the pull request:
https://github.com/apache/lucene-solr/pull/52#discussion_r71725010
--- Diff:
solr/core/src/java/org/apache/solr/handler/admin/CoreAdminOperation.java ---
@@ -919,7 +928,93 @@ public void call(CallInfo callInfo) throws Exception {
}
}
}
+ },
+ CREATESNAPSHOT_OP(CREATESNAPSHOT) {
+ @Override
+ public void call(CallInfo callInfo) throws Exception {
+ CoreContainer cc = callInfo.handler.getCoreContainer();
+ final SolrParams params = callInfo.req.getParams();
+
+ String commitName =
params.required().get(CoreAdminParams.COMMIT_NAME);
+ String cname = params.required().get(CoreAdminParams.CORE);
+ try (SolrCore core = cc.getCore(cname)) {
+ if (core == null) {
+ throw new SolrException(ErrorCode.SERVER_ERROR, "Unable to
locate core " + cname);
+ }
+ if (core.getDeletionPolicy().getLatestCommit() == null) {
--- End diff --
Firstly, this check can go below after we get it on line 949; why get it
twice. Secondly... I wonder if it's null in an initial empty-index case? If
it is, this error message is wrong/confusing... and perhaps we can support that
or no?
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]