Remove a missing Raided block from its codec queue.
541728
boolean remove(BlockInfo blockInfo, RaidCodec codec) {
    if(queues.get(codec).remove(blockInfo)) {
      if (NameNode.stateChangeLog.isDebugEnabled()) {
        NameNode.stateChangeLog.debug(
                                      "BLOCK* NameSystem.RaidMissingBlocks.remove:"
                                      + blockInfo
                                      + " file "+ blockInfo.getINode()
                                      + " codec " + codec.id);
      }
      return true;
    }
    return false;
  }
96517
def remove(self, recv):
        
        try:
            if recv.notify != self._put:
                raise ValueError
            self._receivers.remove(recv)
            recv.notify = None
        except (IndexError, ValueError):
            raise Error(self.not_present_msg)
137433
def delete_processing_block(processing_block_id):
    """"""
    scheduling_block_id = processing_block_id.split(':')[0]
    config = get_scheduling_block(scheduling_block_id)
    processing_blocks = config.get('processing_blocks')
    processing_block = list(filter(
        lambda x: x.get('id') == processing_block_id, processing_blocks))[0]
    config['processing_blocks'].remove(processing_block)
    DB.set('scheduling_block/{}'.format(config['id']), json.dumps(config))

    # Add a event to the scheduling block event list to notify
    # of a new scheduling block being added to the db.
    DB.rpush('processing_block_events',
             json.dumps(dict(type="deleted", id=processing_block_id)))
70428
private void discardTombstones() {
    if (activeTransactions.isEmpty()) {
      Iterator<Map.Entry<K, MapEntryValue>> iterator = entries().entrySet().iterator();
      while (iterator.hasNext()) {
        MapEntryValue value = iterator.next().getValue();
        if (value.type() == MapEntryValue.Type.TOMBSTONE) {
          iterator.remove();
        }
      }
    } else {
      long lowWaterMark = activeTransactions.values().stream()
          .mapToLong(TransactionScope::version)
          .min().getAsLong();
      Iterator<Map.Entry<K, MapEntryValue>> iterator = entries().entrySet().iterator();
      while (iterator.hasNext()) {
        MapEntryValue value = iterator.next().getValue();
        if (value.type() == MapEntryValue.Type.TOMBSTONE && value.version < lowWaterMark) {
          iterator.remove();
        }
      }
    }
  }
1236743
def _cleanup(self):
        """"""
        for filename in os.listdir(self._storage_dir):
            file_path = path.join(self._storage_dir, filename)
            file_stat = os.stat(file_path)
            evaluate = max(file_stat.st_ctime, file_stat.st_mtime)
            if evaluate + self._duration < time.time():
                LOGGER.debug('Removing stale file: %s', file_path)
                os.unlink(file_path)
450325
def _clean(cls, value, invalid):
        """"""
        cls._deprecation_warning()
        return BlockUsageLocator._clean(value, invalid)
621158
private byte[] skipBlocksNotInFilter() throws IOException {
		byte[] magicNo=new byte[4];
		byte[] blockSizeByte=new byte[4];
		// mark bytestream so we can peak into it
		this.bin.mark(8);
		// read magic
		int maxByteRead=4;
		int totalByteRead=0;
		int readByte;
		while ((readByte=this.bin.read(magicNo,totalByteRead,maxByteRead-totalByteRead))>-1) {
				totalByteRead+=readByte;
				if (totalByteRead>=maxByteRead) {
					break;
				}
		}
		if (totalByteRead!=maxByteRead) {
			return new byte[0];
		} 
		
		// read blocksize
	
		maxByteRead=4;
		totalByteRead=0;
		while ((readByte=this.bin.read(blockSizeByte,totalByteRead,maxByteRead-totalByteRead))>-1) {
				totalByteRead+=readByte;
				if (totalByteRead>=maxByteRead) {
					break;
				}
		}
		if (totalByteRead!=maxByteRead) {
			return new byte[0];
		} 
		
		long blockSize=BitcoinUtil.getSize(blockSizeByte)+8;
		// read the full block
		this.bin.reset();
		//filter by magic numbers?
		if (filterSpecificMagic) {
			for (int i=0;i<specificMagicByteArray.length;i++) {
				byte[] currentFilter=specificMagicByteArray[i];
				boolean doesMatchOneMagic=BitcoinUtil.compareMagics(currentFilter,magicNo);
				// correspond to filter? read it!
				if (doesMatchOneMagic) {
					return blockSizeByte;
				}
			}
			// Skip block if not found
			if (this.bin.skip(blockSize)!=blockSize) {
					LOG.error("Cannot skip block in InputStream");
			}
			return new byte[0];
		
		} else {
			return blockSizeByte;
		}
}
931146
public void removeEmptyBlocks() {
        Block curr = blocklistHead;
        Block prev = null;
        int effId = 0;
        while (curr != null) {
            if (!curr.isEmpty()) {
                curr.id = effId++;
                if (prev != null) {
                    prev.nextBlock = curr;
                } else {
                    blocklistHead = curr;
                }
                prev = curr;
            }
            curr = curr.nextBlock;
        }
        if (prev != null) {
            prev.nextBlock = null;
        } else {
            blocklistHead = null;
        }
        numBlocks = effId;
    }
116971
private DiffPart decodeDelete(final int blockSize_S, final int blockSize_E)
		throws DecodingException
	{

		if (blockSize_S < 1 || blockSize_E < 1) {
			throw new DecodingException("Invalid value for blockSize_S: "
					+ blockSize_S + " or blockSize_E: " + blockSize_E);
		}

		int s = r.read(blockSize_S);
		int e = r.read(blockSize_E);

		DiffPart part = new DiffPart(DiffAction.DELETE);
		part.setStart(s);
		part.setLength(e);

		r.skip();

		return part;
	}
321741
def delete_scheduling_block(block_id):
    """"""
    DB.delete('scheduling_block/{}'.format(block_id))

    # Add a event to the scheduling block event list to notify
    # of a deleting a scheduling block from the db
    DB.rpush('scheduling_block_events',
             json.dumps(dict(type="deleted", id=block_id)))
1186217
def _delete_uncompressed(
        collection_name, spec, safe, last_error_args, opts, flags=0):
    """"""
    op_delete, max_bson_size = _delete(collection_name, spec, opts, flags)
    rid, msg = __pack_message(2006, op_delete)
    if safe:
        rid, gle, _ = __last_error(collection_name, last_error_args)
        return rid, msg + gle, max_bson_size
    return rid, msg, max_bson_size
1033619
def delete(self, filething=None):
        """"""

        fileobj = filething.fileobj
        data = _APEv2Data(fileobj)
        if data.start is not None and data.size is not None:
            delete_bytes(fileobj, data.end - data.start, data.start)
        self.clear()
671659
def remove(self, line):
        """"""
        nb = 0
        for block in self.blocks:
            nb += block.remove(line)

        return nb
822601
void clearReplicationQueues() {
    writeLock();
    try {
      synchronized (neededReplications) {
        neededReplications.clear();
      }
      underReplicatedBlocksCount = 0;

      corruptReplicas.clear();
      corruptReplicaBlocksCount = 0;

      overReplicatedBlocks.clear();
      raidEncodingTasks.clear();

      excessReplicateMap = new HashMap<String, LightWeightHashSet<Block>>();
      excessBlocksCount = 0;
    } finally {
      writeUnlock();
    }
  }
764953
public void clearAndReport() {
    synchronized (metrics) {
      for (Codec codec : Codec.getCodecs()) {
        String id = codec.id;
        int extra = 0;
        Map<Integer, MetricsLongValue> codecStatsMap =
          metrics.codecToMisplacedBlocks.get(id);
        // Reset the values.
        for (Entry<Integer, MetricsLongValue> e: codecStatsMap.entrySet()) {
          e.getValue().set(0);
        }
        for (Entry<Integer, Long> e : blockHistograms.get(id).entrySet()) {
          if (e.getKey() < RaidNodeMetrics.MAX_MONITORED_MISPLACED_BLOCKS - 1) {
            MetricsLongValue v = codecStatsMap.get(e.getKey());
            v.set(e.getValue());
          } else {
            extra += e.getValue();
          }
        }
        MetricsLongValue v = codecStatsMap.get(
            RaidNodeMetrics.MAX_MONITORED_MISPLACED_BLOCKS - 1);
        v.set(extra);
      }
    }
    lastBlockHistograms = blockHistograms;
    lastBlockHistogramsPerRack = blockHistogramsPerRack;
    lastUpdateFinishTime = RaidNode.now();
    lastUpdateUsedTime = lastUpdateFinishTime - lastUpdateStartTime;
    LOG.info("Reporting metrices:\n" + toString());
    createEmptyHistograms();
  }
858874
def _clear_block_deco(self):
        """"""
        for deco in self._block_decos:
            self.editor.decorations.remove(deco)
        self._block_decos[:] = []
308461
def gatk_remove_missingalt(in_file, data):
    
    base = in_file.split('.vcf.gz')[0]
    out_file = "%s-nomissingalt%s" % (base, '.vcf.gz')
    if utils.file_exists(out_file):
        return out_file
    no_gzip_out = out_file.replace(".vcf.gz", ".vcf")
    with file_transaction(no_gzip_out) as tx_out_file:
        with utils.open_gzipsafe(in_file) as in_handle, open(tx_out_file, "w") as out_handle:
            for line in in_handle:
                line = remove_missingalt(line)
                if line:
                    out_handle.write(line)
    return vcfutils.bgzip_and_index(no_gzip_out, data["config"])