/** * Extract database column names from {@link JdbcTypeField}. * * @param dsc collection of {@link JdbcTypeField}. * @return Collection with database column names. */ private static Collection<String> databaseColumns(Collection<JdbcTypeField> dsc) { return F.transform(dsc, new C1<JdbcTypeField, String>() { /** {@inheritDoc} */ @Override public String apply(JdbcTypeField col) { return col.getDatabaseFieldName(); } }); }
/** {@inheritDoc} */ @Override public List<String> getUserAttributesFormatted() { assert cfg != null; return (List<String>)F.transform(cfg.getUserAttributes().entrySet(), new C1<Map.Entry<String, ?>, String>() { @Override public String apply(Map.Entry<String, ?> e) { return e.getKey() + ", " + e.getValue().toString(); } }); }
/** * Sets Shared memory IDs string read from system.input. * * @param shmemIds Shared memory IDs string. */ public void shmemIds(String shmemIds) { this.shmemIds = (shmemIds == null) ? null : F.transform(shmemIds.split(","), new C1<String, Integer>() { @Override public Integer apply(String s) { return Long.valueOf(s).intValue(); } }); } }
/** * Checks whether a node is alive or not. * * @param nodeId Node ID. * @return {@code True} if node is in the ring and is not being removed from. */ private boolean nodeAlive(UUID nodeId) { // Is node alive or about to be removed from the ring? TcpDiscoveryNode node = ring.node(nodeId); boolean nodeAlive = node != null && node.visible(); if (nodeAlive) { synchronized (mux) { nodeAlive = !F.transform(failedNodes.keySet(), F.node2id()).contains(nodeId) && !F.transform(leavingNodes, F.node2id()).contains(nodeId); } } return nodeAlive; }
Map<UUID, GridClientNodeImpl> updated = new HashMap<>(); Collection<GridClientNodeImpl> preparedNodes = F.transform(nodeList, new C1<GridClientNodeImpl, GridClientNodeImpl>() { @Override public GridClientNodeImpl apply(GridClientNodeImpl e) {
/** * @param fromIncl Inclusive start of the range. * @param toExcl Exclusive stop of the range. * @return Range of keys. */ private Set<String> rangeKeys(int fromIncl, int toExcl) { return new TreeSet<>(F.transform(F.range(fromIncl, toExcl), new C1<Integer, String>() { @Override public String apply(Integer i) { return "key" + i; } })); }
/** * Prepare list of node IDs. * * @param nodes Collection of nodes. * @return This helper for chaining method calls. */ public VisorGatewayArgument forNodes(Collection<ClusterNode> nodes) { put("p1", concat(F.transform(nodes, new C1<ClusterNode, UUID>() { /** {@inheritDoc} */ @Override public UUID apply(ClusterNode node) { return node.id(); } }).toArray(), ";")); return this; }
return F.transform(ignite.cluster().forPredicate(new IgnitePredicate<ClusterNode>() { @Override public boolean apply(ClusterNode node) { return taskArg.getConsistentIds().contains((String)node.consistentId().toString()); return F.transform(ignite.cluster().forServers().nodes(), new IgniteClosure<ClusterNode, UUID>() { @Override public UUID apply(ClusterNode node) { return node.id(); return F.transform(ignite.cluster().forClients().nodes(), new IgniteClosure<ClusterNode, UUID>() { @Override public UUID apply(ClusterNode node) { return node.id(); return F.transform(ignite.cluster().nodes(), new IgniteClosure<ClusterNode, UUID>() { @Override public UUID apply(ClusterNode node) { return node.id();
@Override public void run() throws Exception { Map<String, Integer> vals = new HashMap<>(); for (int i = 0; i < CNT; i++) vals.put("key" + i, i); jcache(0).putAll(vals); for (int i = 0; i < gridCount(); i++) { assertEquals(0, jcache(i).getEntry("key0").getValue()); assertEquals(0, jcache(i).getEntryAsync("key0").get().getValue()); assertTrue( F.transform( jcache(i).getEntries(vals.keySet()), new IgniteClosure<CacheEntry<Object, Object>, Object>() { @Override public Object apply(CacheEntry<Object, Object> entry) { return entry.getValue(); } }).containsAll(vals.values())); assertTrue( F.transform( jcache(i).getEntriesAsync(vals.keySet()).get(), new IgniteClosure<CacheEntry<Object, Object>, Object>() { @Override public Object apply(CacheEntry<Object, Object> entry) { return entry.getValue(); } }).containsAll(vals.values())); } } });
return F.transform(cacheNames, new C1<String, CacheSqlMetadata>() { @Override public CacheSqlMetadata apply(String cacheName) { Collection<GridQueryTypeDescriptor> types = ctx.query().types(cacheName);
return F.transform(cacheNames, new C1<String, GridCacheQueryManager.CacheSqlMetadata>() { @Override public GridCacheQueryManager.CacheSqlMetadata apply(String cacheName) { Collection<GridQueryTypeDescriptor> types = ctx.query().types(cacheName);
/** * @param ignite Ignite. * @return Local partitions. */ private Set<Integer> localPartitions(Ignite ignite) { GridCacheContext cctx = ((IgniteCacheProxy)ignite.cache(DEFAULT_CACHE_NAME)).context(); Collection<GridDhtLocalPartition> owningParts = F.view(cctx.topology().localPartitions(), new IgnitePredicate<GridDhtLocalPartition>() { @Override public boolean apply(GridDhtLocalPartition part) { return part.state() == GridDhtPartitionState.OWNING; } }); return new HashSet<>(F.transform(owningParts, new IgniteClosure<GridDhtLocalPartition, Integer>() { @Override public Integer apply(GridDhtLocalPartition part) { return part.id(); } })); }
", size=" + getSize() + ", dhtNodes=" + (getPrimaryNodes() == null ? "N/A" : F.transform(getPrimaryNodes(), new IgniteClosure<UUID, String>() { @Override public String apply(UUID id) { return U.id8(id); ", nearXid=" + getNearXid() + ", parentNodeIds=" + (getMasterNodeIds() == null ? "N/A" : F.transform(getMasterNodeIds(), new IgniteClosure<UUID, String>() { @Override public String apply(UUID id) { return U.id8(id);
assert conflictMap == null : conflictMap; drVers = F.transform(keys, new C1<K, GridCacheVersion>() { @Override public GridCacheVersion apply(K k) { return ctx.versions().next(opCtx.dataCenterId());
Collection<UUID> ids = F.transform(nodes, new C1<ClusterNode, UUID>() { @Override public UUID apply(ClusterNode node) { return node.id();
/** * Extract database column names from {@link JdbcTypeField}. * * @param dsc collection of {@link JdbcTypeField}. * @return Collection with database column names. */ private static Collection<String> databaseColumns(Collection<JdbcTypeField> dsc) { return F.transform(dsc, new C1<JdbcTypeField, String>() { /** {@inheritDoc} */ @Override public String apply(JdbcTypeField col) { return col.getDatabaseFieldName(); } }); }
/** {@inheritDoc} */ @SuppressWarnings("unchecked") @Override public List<String> getUserAttributesFormatted() { assert cfg != null; return (List<String>)F.transform(cfg.getUserAttributes().entrySet(), new C1<Map.Entry<String, ?>, String>() { @Override public String apply(Map.Entry<String, ?> e) { return e.getKey() + ", " + e.getValue().toString(); } }); }
/** * Checks whether a node is alive or not. * * @param nodeId Node ID. * @return {@code True} if node is in the ring and is not being removed from. */ private boolean nodeAlive(UUID nodeId) { // Is node alive or about to be removed from the ring? TcpDiscoveryNode node = ring.node(nodeId); boolean nodeAlive = node != null && node.visible(); if (nodeAlive) { synchronized (mux) { nodeAlive = !F.transform(failedNodes.keySet(), F.node2id()).contains(nodeId) && !F.transform(leavingNodes, F.node2id()).contains(nodeId); } } return nodeAlive; }
return F.transform(ignite.cluster().forPredicate(new IgnitePredicate<ClusterNode>() { @Override public boolean apply(ClusterNode node) { return taskArg.getConsistentIds().contains((String)node.consistentId().toString()); return F.transform(ignite.cluster().forServers().nodes(), new IgniteClosure<ClusterNode, UUID>() { @Override public UUID apply(ClusterNode node) { return node.id(); return F.transform(ignite.cluster().forClients().nodes(), new IgniteClosure<ClusterNode, UUID>() { @Override public UUID apply(ClusterNode node) { return node.id(); return F.transform(ignite.cluster().nodes(), new IgniteClosure<ClusterNode, UUID>() { @Override public UUID apply(ClusterNode node) { return node.id();
", size=" + getSize() + ", dhtNodes=" + (getPrimaryNodes() == null ? "N/A" : F.transform(getPrimaryNodes(), new IgniteClosure<UUID, String>() { @Override public String apply(UUID id) { return U.id8(id); ", nearXid=" + getNearXid() + ", parentNodeIds=" + (getMasterNodeIds() == null ? "N/A" : F.transform(getMasterNodeIds(), new IgniteClosure<UUID, String>() { @Override public String apply(UUID id) { return U.id8(id);