private void clean(final IndexShard indexShard) {
        try {
            LOGGER.info(() -> "Changing shard status to closed (" + indexShard + ")");
            indexShard.setStatus(IndexShardStatus.CLOSED);
            indexShardDao.reset(indexShard.getId());
        } catch (final RuntimeException e) {
            LOGGER.error(e::getMessage, e);
        }

        try {
            LOGGER.info(() -> "Clearing any lingering locks (" + indexShard + ")");
            final Path dir = IndexShardUtil.getIndexPath(indexShard, pathCreator);
            deleteLockFiles(dir);
        } catch (final RuntimeException e) {
            LOGGER.error(e::getMessage, e);
        }
    }
This is called by the lifecycle service and remove writers that are past their TTL, TTI or LRU
items that exceed the capacity.
stroom-index/stroom-index-impl/src/main/java/stroom/index/impl/IndexShardWriterCacheImpl.java