Search in sources :

Example 1 with SolrCoreStatus

use of org.platformlayer.service.solr.ops.SolrCoreHelpers.SolrCoreStatus in project platformlayer by platformlayer.

the class SolrCore method handler.

@Handler
public void handler(OpsTarget target) throws OpsException {
    SolrCoreHelpers helper = new SolrCoreHelpers(target, key);
    if (OpsContext.isConfigure()) {
        // TODO: only reload if changed??
        SolrCoreStatus status0 = helper.getStatus();
        helper.reload();
        // TODO: It looks like reload is async; hopefully this check deals with that
        SolrCoreStatus status1 = helper.getStatus();
        while (true) {
            String startTime0 = status0.getStartTime();
            String startTime1 = status1.getStartTime();
            if (!Objects.equal(startTime0, startTime1)) {
                break;
            }
            OpsSystem.safeSleep(TimeSpan.ONE_SECOND);
        }
    }
}
Also used : SolrCoreStatus(org.platformlayer.service.solr.ops.SolrCoreHelpers.SolrCoreStatus) Handler(org.platformlayer.ops.Handler)

Aggregations

Handler (org.platformlayer.ops.Handler)1 SolrCoreStatus (org.platformlayer.service.solr.ops.SolrCoreHelpers.SolrCoreStatus)1