cleans up deleted columns from cassandra cleanup compaction

@param key The partition key of the physical row to be deleted.
427759
@Override
    public void delete(DecoratedKey key, OpOrder.Group opGroup) {
        Log.debug("Removing row %s from index %s", key, logName);
        lock.writeLock().lock();
        try {
            rowService.delete(key);
            rowService = null;
        } catch (RuntimeException e) {
            Log.error(e, "Error deleting row %s", key);
            throw e;
        } finally {
            lock.writeLock().unlock();
        }
    }
1341667
public void deleteFromIndexes(DecoratedKey key, List<Cell> indexedColumnsInRow, OpOrder.Group opGroup)
    {
        // Update entire row only once per row level index
        Set<Class<? extends SecondaryIndex>> cleanedRowLevelIndexes = null;

        for (Cell cell : indexedColumnsInRow)
        {
            for (SecondaryIndex index : indexFor(cell.name()))
            {
                if (index instanceof PerRowSecondaryIndex)
                {
                    if (cleanedRowLevelIndexes == null)
                        cleanedRowLevelIndexes = new HashSet<>();
                    if (cleanedRowLevelIndexes.add(index.getClass()))
                        ((PerRowSecondaryIndex) index).delete(key, opGroup);
                }
                else
                {
                    ((PerColumnSecondaryIndex) index).deleteForCleanup(key.getKey(), cell, opGroup);
                }
            }
        }
    }
295809
protected void doDelete(String spaceId, String key) throws IOException {
        Term termDelete = buildIdTerm(spaceId, key);
        IndexWriter indexWriter = getIndexWriter();
        indexWriter.deleteDocuments(termDelete);
        if (!isAsyncWrite()) {
            indexWriter.commit();
        } else if (getIndexManager().getBackgroundCommitIndexPeriodMs() <= 0) {
            LOGGER.warn("Async-write is enable, autoCommitPeriodMs must be larger than 0!");
        }
    }
662561
public void deleteByKey(DatastoreKey key) {
    try {
      nativeWriter.delete(key.nativeKey());
    } catch (DatastoreException exp) {
      throw DatastoreUtils.wrap(exp);
    }
  }
1263869
static void removeFromCache(String key) {
        HashMap<String, MPApiResponse> mapCache = getMapCache();
        mapCache.remove(key);
    }
179511
private void deleteRow(String storeName, String rowKey) {
        List<String> rowKeys = m_rowDeletes.get(storeName);
        if (rowKeys == null) {
            rowKeys = new ArrayList<>();
            m_rowDeletes.put(storeName, rowKeys);
        }
        rowKeys.add(rowKey);
        m_totalUpdates++;
    }
379581
private void deleteColumn(String storeName, String rowKey, String colName) {
        Map<String, List<String>> rowMap = m_columnDeletes.get(storeName);
        if (rowMap == null) {
            rowMap = new HashMap<>();
            m_columnDeletes.put(storeName, rowMap);
        }
        List<String> colNames = rowMap.get(rowKey);
        if (colNames == null) {
            colNames = new ArrayList<>();
            rowMap.put(rowKey, colNames);
        }
        colNames.add(colName);
        m_totalUpdates++;
    }
1036348
@SuppressWarnings("PMD.EmptyCatchBlock")
    private synchronized void cleanup(final WatchKey key) {
        logger.trace("cleanUp {}", key);
        try {
            key.cancel();
        }catch(Exception ex) {
            //trap
        }
        Collection<SFMF4JWatchListener> listeners = listenersByWatchKey.remove(key);
        if (listeners != null && !listeners.isEmpty()) {
            logger.warn("Cleaning up key but listeners are still registered.");
        }
        String path = pathsByWatchKey.remove(key);
        if (path != null) {
            watchKeysByPath.remove(path);
        }
    }
1115991
@DELETE
	@Path("/{keyspace}/{columnFamily}/{key}/{columnName}")
	@Produces({ "application/json" })
	public void deleteColumn(@PathParam("keyspace") String keyspace, @PathParam("columnFamily") String columnFamily,
			@PathParam("key") String key, @PathParam("columnName") String columnName,
			@QueryParam("purgeIndex") boolean purgeIndex, @HeaderParam(CONSISTENCY_LEVEL_HEADER) String consistencyLevel)
			throws Exception {
		if (logger.isDebugEnabled())
			logger.debug("Deleting row [" + keyspace + "]:[" + columnFamily + "]:[" + key + "]");
		getCassandraStorage().deleteColumn(keyspace, columnFamily, key, columnName,
				config.getConsistencyLevel(consistencyLevel), purgeIndex);
	}
710775
@Override
	public void removeByKey(String key) {
		for (CPDefinitionOptionValueRel cpDefinitionOptionValueRel : findByKey(
				key, QueryUtil.ALL_POS, QueryUtil.ALL_POS, null)) {
			remove(cpDefinitionOptionValueRel);
		}
	}
925082
@Override
    public synchronized void remove(String key) {
        boolean deleted = getFileForKey(key).delete();
        removeEntry(key);
        if (!deleted) {
            //todo add queue markers
//            JusLog.d("Could not delete cache entry for key=%s, filename=%s",
//                    key, getFilenameForKey(key));
        }
    }
326378
@ExperimentalApi("https://github.com/grpc/grpc-java/issues/4691")
  public <T> void discardAll(Key<T> key) {
    if (isEmpty()) {
      return;
    }
    int writeIdx = 0;
    int readIdx = 0;
    for (; readIdx < size; readIdx++) {
      if (bytesEqual(key.asciiName(), name(readIdx))) {
        continue;
      }
      name(writeIdx, name(readIdx));
      value(writeIdx, value(readIdx));
      writeIdx++;
    }
    int newSize = writeIdx;
    // Multiply by two since namesAndValues is interleaved.
    Arrays.fill(namesAndValues, writeIdx * 2, len(), null);
    size = newSize;
  }
705589
public static void cleanup_key(String blobKey, BlobStore blobStore, StormClusterState clusterState) {
        // we skip to clean up the non-exist keys
        if (blobKey.startsWith(JStormMetrics.NIMBUS_METRIC_KEY)
                || blobKey.startsWith(JStormMetrics.CLUSTER_METRIC_KEY)
                || blobKey.startsWith(JStormMetrics.SUPERVISOR_METRIC_KEY)) {
            return;
        }
        try {
            blobStore.deleteBlob(blobKey);
        } catch (Exception e) {
            LOG.warn("cleanup blob key {} error {}", blobKey, e);
        }

        try {
            if (blobStore instanceof LocalFsBlobStore) {
                clusterState.remove_blobstore_key(blobKey);
                clusterState.remove_key_version(blobKey);
            }
        } catch (Exception e) {
            LOG.warn("cleanup blob key {} error {}", blobKey, e);
        }
    }
449545
protected void deleteRecordFromCounterColumnFamily(Object pKey, String tableName, EntityMetadata metadata,
        ConsistencyLevel consistencyLevel) {
        ColumnPath path = new ColumnPath(tableName);

        Cassandra.Client conn = null;
        Object pooledConnection = null;
        try {
            pooledConnection = getConnection();
            conn = (org.apache.cassandra.thrift.Cassandra.Client) getConnection(pooledConnection);

            if (log.isInfoEnabled()) {
                log.info("Removing data for counter column family {}.", tableName);
            }

            conn.remove_counter((CassandraUtilities.toBytes(pKey, metadata.getIdAttribute().getJavaType())), path,
                consistencyLevel);

        } catch (Exception e) {
            log.error("Error during executing delete, Caused by: .", e);
            throw new PersistenceException(e);
        } finally {
            releaseConnection(pooledConnection);
        }
    }
1156063
public void remove(String key) {
        PER_THREAD_CONTEXTS.getUnchecked(Thread.currentThread()).remove(key);
        mdcBridge.remove(key);
    }
596792
public int delete(CMAApiKey key) {
    assertNotNull(key, "key");
    final String space = getSpaceIdOrThrow(key, "key");
    final String id = getResourceIdOrThrow(key, "key");

    return service.delete(space, id).blockingFirst().code();
  }
204707
public boolean delete(String key) {
        Jedis jedis = null;
        try {
            jedis = this.jedisPool.getResource();
            jedis.del(SafeEncoder.encode(key));
            logger.info("delete key:" + key);

            return true;
        } catch (Exception e) {
            logger.error(e.getMessage(), e);
            this.jedisPool.returnBrokenResource(jedis);
        } finally {
            if (jedis != null) {
                this.jedisPool.returnResource(jedis);
            }
        }
        return false;
    }