Close all resources allocated by the core if it is no longer in use... searcher updateHandler all CloseHooks will be notified All MBeans will be unregistered from MBeanServer if JMX was enabled The behavior of this method is determined by the result of decreme
()
| 1756 | * <ul> |
| 1757 | * <li>If reference count is > 0, the usage count is decreased by 1 and no resources are |
| 1758 | * released. |
| 1759 | * <li>If reference count is == 0, the resources are released. |
| 1760 | * <li>If reference count is < 0, and error is logged and no further action is taken. |
| 1761 | * </ul> |
| 1762 | * |
| 1763 | * @see #isClosed() |
| 1764 | */ |
| 1765 | @Override |
| 1766 | public void close() { |
| 1767 | try { |
| 1768 | int count = refCount.decrementAndGet(); |
| 1769 | if (count < 0) { |
| 1770 | log.error( |
| 1771 | "Too many close [count:{}] on {}. Please report this exception to users@solr.apache.org", |
| 1772 | count, |
| 1773 | this); |
| 1774 | assert false : "Too many closes on SolrCore"; |
| 1775 | } else if (count == 0) { |
| 1776 | doClose(); |
| 1777 | } |