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

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

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

F.asList介绍

暂无

代码示例

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

/** {@inheritDoc} */
  @Override public Map<? extends ComputeJob, ClusterNode> map(List<ClusterNode> subgrid, @Nullable Void arg) {
    return absMap(t.get1(), F.asList(t.get2()), subgrid, lb);
  }
}

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

/** {@inheritDoc} */
@Override public IgniteFuture<?> addData(Map.Entry<K, V> entry) {
  A.notNull(entry, "entry");
  return addData(F.asList(entry));
}

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

/** {@inheritDoc} */
@Override @Nullable public ClusterNode mapKeyToNode(K key) {
  A.notNull(key, "key");
  return F.first(mapKeysToNodes(F.asList(key)).keySet());
}

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

/**
 * @param c1 Policy collection.
 * @param c2 Expected list.
 */
protected static void check(Collection<EvictableEntry<String, String>> c1, MockEntry... c2) {
  check(c1, F.asList(c2));
}

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

/**
 * @return Paths.
 */
@GridSpiTestConfig(setterName="setDirectoryPaths")
public Collection<String> getDirectoryPaths() {
  return F.asList(PATH);
}

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

/**
 * @throws Exception If failed.
 */
@Test
public void testMergeJoinExchangesCoordinatorChange2_4_servers() throws Exception {
  mergeJoinExchangeCoordinatorChange2(4, 2, F.asList(1, 2, 3, 4), F.asList(5));
  stopAllGrids();
  mergeJoinExchangeCoordinatorChange2(4, 2, F.asList(1, 2, 3, 5), F.asList(4));
}

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

/** {@inheritDoc} */
@Override protected Void run(VisorCacheStopTaskArg arg) {
  Collection<String> cacheNames = F.isEmpty(arg.getCacheNames())
    ? F.asList(arg.getCacheName())
    : new HashSet<>(arg.getCacheNames());
  if (F.isEmpty(cacheNames))
    throw new IllegalStateException("Cache names was not specified.");
  ignite.destroyCaches(cacheNames);
  return null;
}

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

/**
 *
 */
@Test
public void testExecuteUpdate() throws SQLException {
  conn.createStatement().executeUpdate("update Person set firstName = 'Jack' where " +
      "cast(substring(_key, 2, 1) as int) % 2 = 0");
  assertEquals(Arrays.asList(F.asList("John"), F.asList("Jack"), F.asList("Mike")),
      jcache(0).query(new SqlFieldsQuery("select firstName from Person order by _key")).getAll());
}

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

/**
 * @throws SQLException If failed.
 */
@Test
public void testExecute() throws SQLException {
  conn.createStatement().execute("update Person set firstName = 'Jack' where " +
    "cast(substring(_key, 2, 1) as int) % 2 = 0");
  assertEquals(Arrays.asList(F.asList("John"), F.asList("Jack"), F.asList("Mike")),
    jcache(0).query(new SqlFieldsQuery("select firstName from Person order by _key")).getAll());
}

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

/**
   * @throws SQLException If failed.
   */
  @Test
  public void testExecuteUpdate() throws SQLException {
    conn.createStatement().executeUpdate("update Person set firstName = 'Jack' where " +
        "cast(substring(_key, 2, 1) as int) % 2 = 0");

    assertEquals(Arrays.asList(F.asList("John"), F.asList("Jack"), F.asList("Mike")),
        jcache(0).query(new SqlFieldsQuery("select firstName from Person order by _key")).getAll());
  }
}

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

/**
 * @param ctx Context.
 * @return Managers present in both, DHT and Near caches.
 */
@SuppressWarnings("IfMayBeConditional")
private Collection<GridCacheManager> dhtExcludes(GridCacheContext ctx) {
  if (ctx.config().getCacheMode() == LOCAL || !isNearEnabled(ctx))
    return Collections.emptyList();
  else
    return F.asList(ctx.queries(), ctx.continuousQueries(), ctx.store());
}

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

/**
 * @throws Exception If failed.
 */
@Override protected void afterTest() throws Exception {
  super.afterTest();
  U.stopLifecycleAware(log, F.asList(store));
}

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

/**
 * @throws Exception If failed.
 */
@Test
public void testRunAsyncMultiple() throws Exception {
  Collection<ClosureTestRunnable> jobs = F.asList(new ClosureTestRunnable(), new ClosureTestRunnable());
  IgniteFuture<?> fut = runAsync(0, jobs, null);
  assert fut.get() == null : "Execution result must be null.";
  assert execCntr.get() == jobs.size() :
    "Execution counter must be equal to " + jobs.size() + ", actual: " + execCntr.get();
}

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

/**
 * @param key Key.
 * @throws Exception If failed.
 */
private void zeroOnCreate(Integer key) throws Exception {
  IgniteCache<Integer, Integer> cache = jcache();
  cache.put(key, 1); // Create with zero duration, should not create cache entry.
  checkNoValue(F.asList(key));
}

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

/** {@inheritDoc} */
@Override protected void beforeTest() throws Exception {
  ctx.config().setCommunicationSpi(new TcpCommunicationSpi());
  ctx.config().setMarshaller(new JdkMarshaller());
  // Turn off peer class loading to simplify mocking.
  ctx.config().setPeerClassLoadingEnabled(false);
  // Register local and remote nodes in discovery manager.
  GridDiscoveryManager mockedDiscoveryMgr = Mockito.mock(GridDiscoveryManager.class);
  when(mockedDiscoveryMgr.localNode()).thenReturn(locNode);
  when(mockedDiscoveryMgr.remoteNodes()).thenReturn(F.<ClusterNode>asList(rmtNode));
  ctx.add(mockedDiscoveryMgr);
}

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

/**
 * @param nodeId Node ID to send message to.
 * @param msg Message to send.
 * @throws IgniteCheckedException If send failed.
 */
private void send0(UUID nodeId, Object msg) throws IgniteCheckedException {
  ClusterNode node = ctx.kernalContext().discovery().node(nodeId);
  if (msg instanceof Message)
    ctx.kernalContext().io().sendToGridTopic(node, GridTopic.TOPIC_HADOOP_MSG, (Message)msg, GridIoPolicy.PUBLIC_POOL);
  else
    ctx.kernalContext().io().sendUserMessage(F.asList(node), msg, GridTopic.TOPIC_HADOOP, false, 0, false);
}

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

/** {@inheritDoc} */
@Override protected void afterTest() throws Exception {
  for (String cacheName : new String[] {DEFAULT_CACHE_NAME, CU.UTILITY_CACHE_NAME}) {
    IgniteKernal kernal = (IgniteKernal)ignite(0);
    GridCacheAdapter<Object, Object> cache = kernal.context().cache().internalCache(cacheName);
    cache.removeAll(F.asList("1", "2", "3"));
  }
}

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

/**
 * @param key Key.
 * @throws Exception If failed.
 */
private void zeroOnAccess(Integer key) throws Exception {
  IgniteCache<Integer, Integer> cache = jcache();
  cache.put(key, 1); // Create.
  assertEquals((Integer)1, cache.get(key)); // Access should expire entry.
  waitExpired(F.asList(key));
  assertFalse(cache.iterator().hasNext());
}

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

/**
 * @param key Key.
 * @throws Exception If failed.
 */
private void zeroOnUpdate(Integer key) throws Exception {
  IgniteCache<Integer, Integer> cache = jcache();
  cache.put(key, 1); // Create.
  assertEquals((Integer)1, cache.get(key));
  cache.put(key, 2); // Update should expire entry.
  checkNoValue(F.asList(key));
}

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

/** */
@Test
public void testTopologyHeapSizeForNodesWithDifferentMacs() {
  GridTestNode node1 = getNode("123456789ABC", 1000);
  GridTestNode node2 = getNode("CBA987654321", 1000);
  double size1 = U.heapSize(node1, 10);
  double size2 = U.heapSize(node2, 10);
  double allSize = U.heapSize(F.asList((ClusterNode)node1, node2), 10);
  assertEquals(size1 + size2, allSize, 1E-5);
}

相关文章