Removes the lock for the ke_search index process
7713
protected function execute(InputInterface $input, OutputInterface $output)
    {
        $io = new SymfonyStyle($input, $output);
        $io->title('Remove ke_search indexer lock');
        $indexerRunner = GeneralUtility::makeInstance(IndexerRunner::class);
        $indexerRunner->logger->log('notice', 'Remove indexer lock started by command controller.');
        $registry = GeneralUtility::makeInstance(Registry::class);

        try {
            $registry->get('tx_kesearch', 'startTimeOfIndexer');
            if (intval($registry->get('tx_kesearch', 'startTimeOfIndexer')) === 0) {
                $io->note('Indexer lock is not set.');
                $indexerRunner->logger->log('notice', 'Indexer lock is not set');
            } else {
                $registry->removeAllByNamespace('tx_kesearch');
                $io->success('Indexer lock was successfully removed');
                $indexerRunner->logger->log('notice', 'Indexer lock successful removed');
            }
        } catch (\Exception $e) {
            $io->warning('There was an error accessing the TYPO3 registry.');
            $indexerRunner->logger->log('warning', 'There was an error accessing the TYPO3 registry');
        }
    }
1019889
public void lock()
    {
        log.info("Elasticsearch has started and the maven process has been blocked. Press CTRL+C to stop the process.");

        synchronized (lock)
        {
            try
            {
                lock.wait();
            }
            catch (InterruptedException exception)
            {
                log.warn("RunElasticsearchNodeMojo interrupted");
            }
        }
    }
745201
private T doRemove(int index) {
        keys[index]   = 0;
        states[index] = REMOVED;
        final Object previous = values[index];
        values[index] = missingEntries;
        --size;
        ++count;
        return (T)previous;
    }
148498
void cleanUpStaleEntries() {
        for (KeyedRef<K, V> ref = q.poll(); ref != null; ref = q.poll()) {
            map.remove(ref.getKey(), ref); // CONCURRENT remove() operation
        }
    }
146294
private void remove(int index) {
        Validate.isFalse(index >= size);
        int shifted = size - index - 1;
        if (shifted > 0) {
            System.arraycopy(keys, index + 1, keys, index, shifted);
            System.arraycopy(vals, index + 1, vals, index, shifted);
        }
        size--;
        keys[size] = null; // release hold
        vals[size] = null;
    }
569643
private void removeFromIndexes(Object value, Object key, TransactionContext transactionContext) {
      performSearchWork(value, keyToString(key), WorkType.DELETE, transactionContext);
   }
546493
private function _close()
    {
        if ($this->_closed) {
            // index is already closed and resources are cleaned up
            return;
        }

        $this->commit();

        // Release "under processing" flag
        Zend_Search_Lucene_LockManager::releaseReadLock($this->_directory);

        if ($this->_closeDirOnExit) {
            $this->_directory->close();
        }

        $this->_directory    = null;
        $this->_writer       = null;
        $this->_segmentInfos = null;

        $this->_closed = true;
    }
717209
def Close(self):
    
    super(TimesketchOutputModule, self).Close()

    with self._timesketch.app_context():
      search_index = timesketch_sketch.SearchIndex.query.filter_by(
          index_name=self._index_name).first()
      search_index.status.remove(search_index.status[0])
      timesketch_db_session.add(search_index)
      timesketch_db_session.commit()
75004
def rm(self, index):
        
        if self.model.exists(index):
            self.model.remove(index)
746438
void removeToRelockList(final DeviceProxy dev) {
        // Check if admin device already exists.
        String adm;
        try {
            adm = dev.adm_name();
        } catch (final DevFailed e) {
            // Give up
            return;
        }
        if (relockMap.containsKey(adm)) {
            final LockedDeviceAmin lda = relockMap.get(adm);
            lda.remove(dev.get_name());
        }
    }
1200050
public void clear() {
        // The alternative is to iterate through the keys and call #remove(),
        // which
        // adds unnecessary contention on the eviction lock and buffers.
        evictionLock.lock();
        try {
            Node node;
            while ((node = evictionDeque.poll()) != null) {
                data.remove(node.key, node);
                node.makeDead();
            }

            // Drain the buffers and run only the write tasks
            for (int i = 0; i < buffers.length; i++) {
                Queue<Task> buffer = buffers[i];
                int removed = 0;
                Task task;
                while ((task = buffer.poll()) != null) {
                    if (task.isWrite()) {
                        task.run();
                    }
                    removed++;
                }
                bufferLengths.addAndGet(i, -removed);
            }
        } finally {
            evictionLock.unlock();
        }
    }
75803
@Deprecated
	private static void removeIndexInElasticsearch(Client client, String index) throws Exception {
		logger.trace("removeIndex([{}])", index);

		assert client != null;
		assert index != null;

        AcknowledgedResponse response = client.admin().indices().prepareDelete(index).get();
		if (!response.isAcknowledged()) {
			logger.warn("Could not delete index [{}]", index);
			throw new Exception("Could not delete index ["+index+"].");
		}

		logger.trace("/removeIndex([{}])", index);
	}
32856
public void clearIndex(Index index) {
    BulkIndexer.delete(esClient, IndexType.main(index, index.getName()), esClient.prepareSearch(index).setQuery(matchAllQuery()));
  }
836861
public function clearSearchIndexAction()
    {
        // get uri builder
        $uriBuilder = GeneralUtility::makeInstance(UriBuilder::class);

        // admin only access
        if ($this->getBackendUser()->isAdmin()) {
            if ($this->do == 'clear') {
                $databaseConnection = Db::getDatabaseConnection('tx_kesearch_index');
                $databaseConnection->truncate('tx_kesearch_index');
            }
        }

        // build "clear index" link
        $moduleUrl = $uriBuilder->buildUriFromRoute(
            'web_KeSearchBackendModule',
            [
                'id' => $this->id,
                'do' => 'clear'
            ]
        );

        $this->view->assign('moduleUrl', $moduleUrl);
        $this->view->assign('isAdmin', $this->getBackendUser()->isAdmin());
        $this->view->assign('indexCount', $this->getNumberOfRecordsInIndex());

    }
394836
public void removeSearchIndex(I_CmsSearchIndex searchIndex) {

        // shut down index to remove potential config files of Solr indexes
        searchIndex.shutDown();
        if (searchIndex instanceof CmsSolrIndex) {
            CmsSolrIndex solrIndex = (CmsSolrIndex)searchIndex;
            m_coreContainer.unload(solrIndex.getCoreName(), true, true, true);
        }
        m_indexes.remove(searchIndex);
        initOfflineIndexes();

        if (LOG.isInfoEnabled()) {
            LOG.info(
                Messages.get().getBundle().key(
                    Messages.LOG_REMOVE_SEARCH_INDEX_2,
                    searchIndex.getName(),
                    searchIndex.getProject()));
        }
    }
768283
private void cleanUp(final DataSet ds) {
		Set<String> indexedKeys = Sets.newHashSet();
		for (String key : ds.getDataView().keySet()) {
			// Search for indexed entries
			if (key.contains("#")) {
				// Remember key (without index)
				indexedKeys.add(key.substring(0, key.indexOf("#")));
			}
		}
		// Remove all indexes
		for (String indexedKey : indexedKeys) {
			ds.removeValue(indexedKey);
		}
	}
347393
private boolean cleanLockedObjects( LockedObject lo,
                                        boolean temporary ) {

        if (lo.children == null) {
            if (lo.owner == null) {
                if (temporary) {
                    lo.removeTempLockedObject();
                } else {
                    lo.removeLockedObject();
                }

                return true;
            }
            return false;
        }
        boolean canDelete = true;
        int limit = lo.children.length;
        for (int i = 0; i < limit; i++) {
            if (!cleanLockedObjects(lo.children[i], temporary)) {
                canDelete = false;
            } else {

                // because the deleting shifts the array
                i--;
                limit--;
            }
        }
        if (canDelete) {
            if (lo.owner == null) {
                if (temporary) {
                    lo.removeTempLockedObject();
                } else {
                    lo.removeLockedObject();
                }
                return true;
            }
            return false;
        }
        return false;
    }