本文整理了Java中org.apache.ignite.internal.util.typedef.F.viewReadOnly()
方法的一些代码示例,展示了F.viewReadOnly()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。F.viewReadOnly()
方法的具体详情如下:
包路径:org.apache.ignite.internal.util.typedef.F
类名称:F
方法名:viewReadOnly
暂无
代码示例来源:origin: apache/ignite
/**
* @param col Collection.
* @return Collection with masked {@code null} values.
*/
private Collection<Object> maskNulls(Collection<Object> col) {
assert col != null;
return F.viewReadOnly(col, new C1<Object, Object>() {
@Override public Object apply(Object e) {
return e != null ? e : NULL;
}
});
}
代码示例来源:origin: apache/ignite
/**
* @param col Collection.
* @return Collection with unmasked {@code null} values.
*/
private Collection<Object> unmaskNulls(Collection<Object> col) {
assert col != null;
return F.viewReadOnly(col, new C1<Object, Object>() {
@Override public Object apply(Object e) {
return e != NULL ? e : null;
}
});
}
代码示例来源:origin: apache/ignite
/**
* @return Collection of active endpoints.
*/
public Collection<IpcServerEndpoint> endpoints() {
return F.viewReadOnly(srvrs, new C1<IgfsServer, IpcServerEndpoint>() {
@Override public IpcServerEndpoint apply(IgfsServer e) {
return e.getIpcServerEndpoint();
}
});
}
代码示例来源:origin: apache/ignite
/** {@inheritDoc} */
@Override public Collection<BinaryType> metadata() throws BinaryObjectException {
return F.viewReadOnly(metadataLocCache.values(), new IgniteClosure<BinaryMetadataHolder, BinaryType>() {
@Override public BinaryType apply(BinaryMetadataHolder metaHolder) {
return metaHolder.metadata().wrap(binaryCtx);
}
});
}
代码示例来源:origin: apache/ignite
/**
* @return All configured cache instances.
*/
public Collection<IgniteInternalCache<?, ?>> caches() {
return F.viewReadOnly(jCacheProxies.values(), new IgniteClosure<IgniteCacheProxy<?, ?>,
IgniteInternalCache<?, ?>>() {
@Override public IgniteInternalCache<?, ?> apply(IgniteCacheProxy<?, ?> entries) {
return entries.internalProxy();
}
});
}
代码示例来源:origin: apache/ignite
/**
* Gets currently used deployments.
*
* @return Currently used deployments.
*/
public Collection<GridDeployment> getUsedDeployments() {
return F.viewReadOnly(tasks.values(), new C1<GridTaskWorker<?, ?>, GridDeployment>() {
@Override public GridDeployment apply(GridTaskWorker<?, ?> w) {
return w.getDeployment();
}
});
}
代码示例来源:origin: apache/ignite
/**
* Converts collection of grid nodes to collection of grid names.
*
* @param nodes Nodes.
* @return Grid names.
*/
public static Collection<String> nodes2names(@Nullable Collection<? extends ClusterNode> nodes) {
return F.viewReadOnly(nodes, new C1<ClusterNode, String>() {
@Override public String apply(ClusterNode n) {
return G.ignite(n.id()).name();
}
});
}
代码示例来源:origin: apache/ignite
/** {@inheritDoc} */
@Override public Collection<IgniteFileSystem> igfss() {
return F.viewReadOnly(igfsCache.values(), CTX_TO_IGFS);
}
代码示例来源:origin: apache/ignite
/**
* @return All configured cache instances.
*/
public Collection<IgniteCacheProxy<?, ?>> jcaches() {
return F.viewReadOnly(jCacheProxies.values(), new IgniteClosure<IgniteCacheProxyImpl<?, ?>, IgniteCacheProxy<?, ?>>() {
@Override public IgniteCacheProxy<?, ?> apply(IgniteCacheProxyImpl<?, ?> proxy) {
return proxy.gatewayWrapper();
}
});
}
代码示例来源:origin: apache/ignite
/**
* Returns a collection of live baseline nodes.
*
* @return A view of baseline nodes that are currently present in the cluster or {@code null} if baseline
* topology was not set.
*/
@Nullable public Collection<ClusterNode> aliveBaselineNodes() {
return baselineNodes == null ? null : F.viewReadOnly(baselineNodes, BASELINE_TO_CLUSTER, aliveBaselineNodePred);
}
代码示例来源:origin: apache/ignite
/**
* Converts collection of nodes to collection of node IDs.
*
* @param nodes Nodes.
* @return Node IDs.
*/
public static Collection<UUID> nodeIds(@Nullable Collection<? extends ClusterNode> nodes) {
return F.viewReadOnly(nodes, F.node2id());
}
代码示例来源:origin: apache/ignite
/**
* Returns only directly available nodes from given collection.
*
* @param nodes Nodes.
* @return Directly available subset.
*/
protected static Collection<GridClientNode> selectDirectNodes(Collection<? extends GridClientNode> nodes) {
return F.viewReadOnly(nodes, F.<GridClientNode>identity(), CONNECTABLE);
}
}
代码示例来源:origin: apache/ignite
/**
* @return Readers.
* @throws GridCacheEntryRemovedException If removed.
*/
public Collection<UUID> readers() throws GridCacheEntryRemovedException {
return F.viewReadOnly(checkReaders(), R2N);
}
代码示例来源:origin: apache/ignite
/** {@inheritDoc} */
@Override public Collection<GridCacheMapEntry> entries(int cacheId, final CacheEntryPredicate... filter) {
CacheMapHolder hld = entriesMapIfExists(cacheId);
if (hld == null)
return Collections.emptyList();
final IgnitePredicate<GridCacheMapEntry> p = new IgnitePredicate<GridCacheMapEntry>() {
@Override public boolean apply(GridCacheMapEntry entry) {
return entry.visitable(filter);
}
};
return F.viewReadOnly(hld.map.values(), F.<GridCacheMapEntry>identity(), p);
}
代码示例来源:origin: apache/ignite
/** {@inheritDoc} */
@Override public Collection<UUID> getIds(int part) {
assert part >= 0 && part < assignment.size() : "Affinity partition is out of range" +
" [part=" + part + ", partitions=" + assignment.size() + ']';
if (IGNITE_DISABLE_AFFINITY_MEMORY_OPTIMIZATION)
return assignments2ids(assignment.get(part));
else {
List<ClusterNode> nodes = assignment.get(part);
return nodes.size() > AffinityAssignment.IGNITE_AFFINITY_BACKUPS_THRESHOLD
? assignments2ids(nodes)
: F.viewReadOnly(nodes, F.node2id());
}
}
代码示例来源:origin: apache/ignite
/** {@inheritDoc} */
@Override public String toString() {
Collection<String> futs = F.viewReadOnly(futures(), new C1<IgniteInternalFuture<?>, String>() {
@Override public String apply(IgniteInternalFuture<?> f) {
return "[node=" + ((MiniFuture)f).nodeId +
", done=" + f.isDone() + "]";
}
});
return S.toString(GridCacheTxRecoveryFuture.class, this,
"innerFuts", futs,
"super", super.toString());
}
代码示例来源:origin: apache/ignite
/**
* @param nodes Collection of grid nodes.
* @return Collection of node consistent IDs for given collection of grid nodes.
*/
private static Collection<String> nodeConsistentIds(@Nullable Collection<? extends BaselineNode> nodes) {
if (nodes == null || nodes.isEmpty())
return Collections.emptyList();
return F.viewReadOnly(nodes, n -> String.valueOf(n.consistentId()));
}
代码示例来源:origin: apache/ignite
/** {@inheritDoc} */
@Override public String toString() {
Collection<String> futs = F.viewReadOnly(futures(), new C1<IgniteInternalFuture<?>, String>() {
@Override public String apply(IgniteInternalFuture<?> f) {
return f.toString();
}
});
return S.toString(GridDhtForceKeysFuture.class, this,
"innerFuts", futs,
"super", super.toString());
}
代码示例来源:origin: apache/ignite
/** {@inheritDoc} */
@Override public String toString() {
return S.toString(GridCacheMultiTxFuture.class, this,
"remaining", F.viewReadOnly(remainingTxs, CU.<K, V>tx2xidVersion()),
"super", super.toString()
);
}
}
代码示例来源:origin: apache/ignite
/** {@inheritDoc} */
@Override public Collection<UUID> getTopology() {
if (topPred != null)
return F.viewReadOnly(ctx.discovery().allNodes(), F.node2id(), topPred);
return top != null ? top : F.nodeIds(ctx.discovery().allNodes());
}
内容来源于网络,如有侵权,请联系作者删除!