org.apache.ignite.internal.util.typedef.F.retain()方法的使用及代码示例

x33g5p2x  于2022-01-19 转载在 其他  
字(3.0k)|赞(0)|评价(0)|浏览(86)

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

F.retain介绍

暂无

代码示例

代码示例来源:origin: apache/ignite

/** {@inheritDoc} */
@Override public <T extends Event> Collection<T> localEvents(IgnitePredicate<T> p) {
  A.notNull(p, "p");
  cleanupQueue();
  return F.retain((Collection<T>)evts, true, p);
}

代码示例来源:origin: apache/ignite

/** {@inheritDoc} */
@Override public Collection<IgniteInternalCache<?, ?>> cachesx(
  IgnitePredicate<? super IgniteInternalCache<?, ?>>[] p) {
  guard();
  try {
    checkClusterState();
    return F.retain(ctx.cache().caches(), true, p);
  }
  finally {
    unguard();
  }
}

代码示例来源:origin: apache/ignite

assert !set.retainAll(c);
Collection<Integer> c2 = F.retain(c1, true, c);

代码示例来源:origin: apache/ignite

nodes = F.retain(allNodes, true,
  new P1<ClusterNode>() {
    @Override public boolean apply(ClusterNode node) {

代码示例来源:origin: apache/ignite

/** {@inheritDoc} */
@Override public ClusterNode failover(FailoverContext ctx, List<ClusterNode> top) {
  failedOverJobs.add(ctx.getJobResult().getJobContext());
  // Clear failed nodes list - allow to failover on the same node.
  ctx.getJobResult().getJobContext().setAttribute(FAILED_NODE_LIST_ATTR, null);
  // Account for maximum number of failover attempts since we clear failed node list.
  Integer failoverCnt = ctx.getJobResult().getJobContext().getAttribute(FAILOVER_NUMBER_ATTR);
  if (failoverCnt == null)
    ctx.getJobResult().getJobContext().setAttribute(FAILOVER_NUMBER_ATTR, 1);
  else {
    if (failoverCnt >= getMaximumFailoverAttempts()) {
      U.warn(log, "Job failover failed because number of maximum failover attempts is exceeded " +
        "[failedJob=" + ctx.getJobResult().getJob() + ", maxFailoverAttempts=" +
        getMaximumFailoverAttempts() + ']');
      return null;
    }
    ctx.getJobResult().getJobContext().setAttribute(FAILOVER_NUMBER_ATTR, failoverCnt + 1);
  }
  List<ClusterNode> cp = new ArrayList<>(top);
  // Keep collection type.
  F.retain(cp, false, new IgnitePredicate<ClusterNode>() {
    @Override public boolean apply(ClusterNode node) {
      return F.isAll(node, filter);
    }
  });
  return super.failover(ctx, cp); //use cp to ensure we don't failover on failed node
}

代码示例来源:origin: org.apache.ignite/ignite-core

/** {@inheritDoc} */
@Override public <T extends Event> Collection<T> localEvents(IgnitePredicate<T> p) {
  A.notNull(p, "p");
  cleanupQueue();
  return F.retain((Collection<T>)evts, true, p);
}

代码示例来源:origin: org.apache.ignite/ignite-core

overflow = ((Collection)val).size() - COLLECTION_LIMIT;
bracket = ']';
val = F.retain((Collection) val, true, COLLECTION_LIMIT);

代码示例来源:origin: org.apache.ignite/ignite-core

/** {@inheritDoc} */
@Override public Collection<IgniteInternalCache<?, ?>> cachesx(
  IgnitePredicate<? super IgniteInternalCache<?, ?>>[] p) {
  guard();
  try {
    checkClusterState();
    return F.retain(ctx.cache().caches(), true, p);
  }
  finally {
    unguard();
  }
}

代码示例来源:origin: org.apache.ignite/ignite-core

nodes = F.retain(allNodes, true,
  new P1<ClusterNode>() {
    @Override public boolean apply(ClusterNode node) {

相关文章