java.util.concurrent.ConcurrentSkipListSet.remove()方法的使用及代码示例

x33g5p2x  于2022-01-18 转载在 其他  
字(6.1k)|赞(0)|评价(0)|浏览(136)

本文整理了Java中java.util.concurrent.ConcurrentSkipListSet.remove()方法的一些代码示例,展示了ConcurrentSkipListSet.remove()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。ConcurrentSkipListSet.remove()方法的具体详情如下:
包路径:java.util.concurrent.ConcurrentSkipListSet
类名称:ConcurrentSkipListSet
方法名:remove

ConcurrentSkipListSet.remove介绍

[英]Removes the specified element from this set if it is present. More formally, removes an element e such that o.equals(e), if this set contains such an element. Returns true if this set contained the element (or equivalently, if this set changed as a result of the call). (This set will not contain the element once the call returns.)
[中]从该集合中删除指定的元素(如果存在)。更正式地说,如果这个集合包含这样一个元素,则删除一个元素e,使o.equals(e)。如果此集合包含元素,则返回true(如果此集合因调用而更改,则返回等效值)。(一旦调用返回,此集合将不包含元素。)

代码示例

代码示例来源:origin: apache/incubator-druid

@Override
public void unmarkSegmentToDrop(DataSegment dataSegment)
{
 segmentsMarkedToDrop.remove(dataSegment);
}

代码示例来源:origin: ehcache/ehcache3

/**
 * Remove the contiguous seen msgIds from the nonContiguousMsgIds and update highestContiguousMsgId
 */
private void reconcile() {
 // If nonContiguousMsgIds is empty then nothing to reconcile.
 if (nonContiguousMsgIds.isEmpty()) {
  return;
 }
 // This happens when a passive is started after Active has moved on and
 // passive starts to see msgIDs starting from a number > 0.
 // Once the sync is completed, fast forward highestContiguousMsgId.
 // Post sync completion assuming platform will send all msgIds beyond highestContiguousMsgId.
 if (highestContiguousMsgId == -1L && isSyncCompleted) {
  Long min = nonContiguousMsgIds.last();
  LOGGER.info("Setting highestContiguousMsgId to {} from -1", min);
  highestContiguousMsgId = min;
  nonContiguousMsgIds.removeIf(msgId -> msgId <= min);
 }
 for (long msgId : nonContiguousMsgIds) {
  if (msgId <= highestContiguousMsgId) {
   nonContiguousMsgIds.remove(msgId);
  } else if (msgId > highestContiguousMsgId + 1) {
   break;
  } else {
   // the order is important..
   highestContiguousMsgId = msgId;
   nonContiguousMsgIds.remove(msgId);
  }
 }
}

代码示例来源:origin: apache/incubator-druid

@Override
public void unmarkSegmentToDrop(DataSegment dataSegment)
{
 segmentsMarkedToDrop.remove(dataSegment);
}

代码示例来源:origin: wildfly/wildfly

@Override
public boolean removeExternalContext(ServiceName serviceName) {
  return externalContexts.remove(serviceName);
}

代码示例来源:origin: wildfly/wildfly

public void remove(final ServiceName serviceName) {
  boundServices.remove(serviceName);
}

代码示例来源:origin: robovm/robovm

/**
 * Removes from this set all of its elements that are contained in
 * the specified collection.  If the specified collection is also
 * a set, this operation effectively modifies this set so that its
 * value is the <i>asymmetric set difference</i> of the two sets.
 *
 * @param  c collection containing elements to be removed from this set
 * @return {@code true} if this set changed as a result of the call
 * @throws ClassCastException if the types of one or more elements in this
 *         set are incompatible with the specified collection
 * @throws NullPointerException if the specified collection or any
 *         of its elements are null
 */
public boolean removeAll(Collection<?> c) {
  // Override AbstractSet version to avoid unnecessary call to size()
  boolean modified = false;
  for (Object e : c)
    if (remove(e))
      modified = true;
  return modified;
}

代码示例来源:origin: Graylog2/graylog2-server

private ChunkEntry getAndCleanupEntry(String id) {
  final ChunkEntry entry = chunks.remove(id);
  sortedEvictionSet.remove(entry);
  waitingMessages.dec();
  return entry;
}

代码示例来源:origin: gocd/gocd

public void run() {
    try {
      createCachedFile(artifactLocation);
    } catch (Exception e) {
      pendingExceptions.putIfAbsent(artifactLocation, e);
    } finally {
      pendingCacheFiles.remove(artifactLocation);
    }
  }
};

代码示例来源:origin: gocd/gocd

public void markPipelineAsCanBeTriggered(PipelineConfig pipelineConfig) {
  triggeredPipelines.remove(pipelineConfig.name());
}

代码示例来源:origin: apache/incubator-druid

@Override
public void unannounceSegment(DataSegment segment)
{
 segmentsAnnouncedByMe.remove(segment);
 announceCount.decrementAndGet();
}

代码示例来源:origin: apache/incubator-druid

@Override
 public void unannounceSegments(Iterable<DataSegment> segments)
 {
  for (DataSegment segment : segments) {
   segmentsAnnouncedByMe.remove(segment);
  }
  announceCount.addAndGet(-Iterables.size(segments));
 }
};

代码示例来源:origin: apache/incubator-druid

@Override
public void unregister(final String service)
{
 log.info("Unregistering chat handler[%s]", service);
 final ChatHandler handler = handlers.get(service);
 if (handler == null) {
  log.warn("handler[%s] not currently registered, ignoring.", service);
  return;
 }
 if (announcements.contains(service)) {
  try {
   serviceAnnouncer.unannounce(makeDruidNode(service));
  }
  catch (Exception e) {
   log.warn(e, "Failed to unregister service[%s]", service);
  }
  announcements.remove(service);
 }
 handlers.remove(service, handler);
}

代码示例来源:origin: wildfly/wildfly

public void dropLocal(@NotNull final Transaction transaction) {
  final Xid xid = getXid(transaction);
  final SimpleXid gtid = SimpleXid.of(xid).withoutBranch();
  final Entry entry = known.remove(gtid);
  if (entry != null) {
    timeoutSet.remove(entry.getXidKey());
  }
}

代码示例来源:origin: apache/incubator-druid

@Override
 public void run()
 {
  try {
   synchronized (segmentDeleteLock) {
    if (segmentsToDelete.remove(segment)) {
     segmentManager.dropSegment(segment);
     File segmentInfoCacheFile = new File(config.getInfoDir(), segment.getId().toString());
     if (!segmentInfoCacheFile.delete()) {
      log.warn("Unable to delete segmentInfoCacheFile[%s]", segmentInfoCacheFile);
     }
    }
   }
  }
  catch (Exception e) {
   log.makeAlert(e, "Failed to remove segment! Possible resource leak!")
     .addData("segment", segment)
     .emit();
  }
 }
};

代码示例来源:origin: igniterealtime/Openfire

if (adminCollection) {
  if (members.contains(user)) {
    members.remove(user);
    administrators.remove(user);

代码示例来源:origin: apache/incubator-druid

segmentsToDelete.remove(segment);

代码示例来源:origin: io.druid/druid-server

@Override
public void unmarkSegmentToDrop(DataSegment dataSegment)
{
 segmentsMarkedToDrop.remove(dataSegment);
}

代码示例来源:origin: Unidata/thredds

synchronized HTTPSession removeMethod(HTTPMethod m)
{
  this.methods.remove(m);
  connmgr.freeManager(m);
  return this;
}

代码示例来源:origin: tomahawk-player/tomahawk-android

public void blacklistTrackResult(Result result) {
  sBlacklistedResults.add(result.getCacheKey());
  if (result.getCacheKey().equals(mResultHint)) {
    mResultHint = null;
  }
  mTrackResults.remove(result);
  mTrackResultScores.remove(result);
}

代码示例来源:origin: rometools/rome

@Override
  public void run() {
    pendings.remove(not.subscriber.getCallback());
    enqueueNotification(not);
  }
}, TWO_MINUTES);

相关文章

微信公众号

最新文章

更多