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

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

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

F.asMap介绍

暂无

代码示例

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

/** {@inheritDoc} */
@Override public Map<IgniteTxKey, IgniteTxEntry> writeMap() {
  return entry != null ? F.asMap(entry.get(0).txKey(), entry.get(0)) :
    Collections.<IgniteTxKey, IgniteTxEntry>emptyMap();
}

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

/** {@inheritDoc} */
@Override public Map<IgniteTxKey, IgniteTxEntry> writeMap() {
  return entry != null ? F.asMap(entry.txKey(), entry) :
    Collections.<IgniteTxKey, IgniteTxEntry>emptyMap();
}

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

/** {@inheritDoc} */
@Override public Map<Integer, Integer> loadAll(Iterable<? extends Integer> keys) {
  assert keys != null;
  return F.asMap(1, 1, 2, 2, 3, 3);
}

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

/**
 * Convert Hadoop permission into IGFS file attribute.
 *
 * @param perm Hadoop permission.
 * @return IGFS attributes.
 */
private Map<String, String> permission(FsPermission perm) {
  if (perm == null)
    perm = FsPermission.getDefault();
  return F.asMap(IgfsUtils.PROP_PERMISSION, toString(perm));
}

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

/**
 * Convert Hadoop permission into IGFS file attribute.
 *
 * @param perm Hadoop permission.
 * @return IGFS attributes.
 */
private Map<String, String> permission(FsPermission perm) {
  if (perm == null)
    perm = FsPermission.getDefault();
  return F.asMap(IgfsUtils.PROP_PERMISSION, toString(perm));
}

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

/**
 * @param tx {@code True} is transaction is expected.
 * @param expMtd Expected method.
 * @param expCacheName Expected cache name.
 */
private void expectedData(boolean tx, String expMtd, String expCacheName) {
  expData.add(new ExpectedData(tx, expMtd, new HashMap<>(), expCacheName));
  if (tx)
    expData.add(new ExpectedData(true, "sessionEnd", F.<Object, Object>asMap(0, expMtd), expCacheName));
}

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

/** {@inheritDoc} */
@Override public Map<? extends ComputeJob, ClusterNode> map(List<ClusterNode> subgrid,
  @Nullable Void arg) {
  return F.asMap(new ComputeJobAdapter() {
    @TaskSessionResource
    private ComputeTaskSession ses;
    @Override public Object execute() {
      return ses.getTaskName();
    }
  }, F.rand(subgrid));
}

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

/** {@inheritDoc} */
@Override protected IgniteConfiguration getConfiguration(String igniteInstanceName) throws Exception {
  IgniteConfiguration cfg = super.getConfiguration(igniteInstanceName);
  if (include)
    cfg.setUserAttributes(F.asMap(INC_ATTR, true));
  return cfg;
}

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

/** */
@Test
public void testAtomicOrImplicitTxPutAll() throws Exception {
  doAtomicOrImplicitTxPutAll(F.asMap(1, okValue, 5, badValue), 1);
}

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

/** */
@Test
public void testTxPutAll() throws Exception {
  doTxPutAll(F.asMap(1, okValue, 5, badValue));
}

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

/** {@inheritDoc} */
@Override protected IgniteConfiguration getConfiguration(String igniteInstanceName) throws Exception {
  MvccFeatureChecker.skipIfNotSupported(MvccFeatureChecker.Feature.CACHE_STORE);
  IgniteConfiguration cfg = super.getConfiguration(igniteInstanceName);
  cfg.setCacheConfiguration(cacheConfiguration());
  cfg.setUserAttributes(F.asMap(IDX_ATTR, CNT.getAndIncrement()));
  return cfg;
}

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

/**
 * @throws Exception If failed.
 */
@Test
public void testSingleAttributeNullValue() throws Exception {
  IgnitePredicate<ClusterNode> filter = new AttributeNodeFilter("attr", null);
  assertTrue(filter.apply(nodeProxy(F.asMap("attr", null))));
  assertTrue(filter.apply(nodeProxy(Collections.<String, Object>emptyMap())));
  assertTrue(filter.apply(nodeProxy(F.asMap("wrong", "value"))));
  assertTrue(filter.apply(nodeProxy(F.asMap("wrong", null))));
  assertFalse(filter.apply(nodeProxy(F.asMap("attr", "value"))));
}

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

/** {@inheritDoc} */
@Override protected IgniteConfiguration getConfiguration(String igniteInstanceName) throws Exception {
  IgniteConfiguration cfg = super.getConfiguration(igniteInstanceName);
  ((TcpCommunicationSpi)cfg.getCommunicationSpi()).setSharedMemoryPort(-1);
  if (include)
    cfg.setUserAttributes(F.asMap("include", true));
  return cfg;
}

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

@Override public Object call() throws Exception {
    node2.binary().registerEnum(enumName,
        F.asMap(EnumType.ONE.name(), EnumType.TWO.ordinal()));
    return null;
  }
}, BinaryObjectException.class, "Conflicting enum values. Value ");

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

@Override public Object call() throws Exception {
    node2.binary().registerEnum(enumName,
        F.asMap(EnumType.TWO.name(), EnumType.ONE.ordinal()));
    return null;
  }
}, BinaryObjectException.class, "Conflicting enum values. Name ");

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

@Override public void run() throws Exception {
    cache.put(key1, okValue);
    cache.put(key2, okValue);
    cache.invokeAll(F.asMap(
      key1, new TestEntryProcessor(null),
      key2, new TestEntryProcessor(null)));
    assertEquals(0, cache.size());
  }
});

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

/** Register enum */
private void defineEnum() {
  node1.binary().registerEnum(EnumType.class.getName(),
      F.asMap(EnumType.ONE.name(), EnumType.ONE.ordinal(),
          EnumType.TWO.name(), EnumType.TWO.ordinal()));
}

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

@Override public Object call() throws Exception {
    node1.binary().registerEnum("invalidEnumType1",
      F.asMap(EnumType.ONE.name(), EnumType.ONE.ordinal(),
      EnumType.TWO.name(), EnumType.ONE.ordinal()));
    return null;
  }
}, BinaryObjectException.class, "Conflicting enum values");

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

@Override public void run() throws Exception {
    cache.put(key1, okValue);
    cache.put(key2, okValue);
    try (Transaction tx = ignite.transactions().txStart(concurrency, isolation)) {
      cache.invokeAll(F.asMap(
        key1, new TestEntryProcessor(null),
        key2, new TestEntryProcessor(null)));
      tx.commit();
    }
    assertEquals(0, cache.size());
  }
});

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

/**
 * @throws Exception If failed.
 */
@Test
public void testRemoveAllSkipStore() throws Exception {
  IgniteCache<String, Integer> jcache = jcache();
  jcache.putAll(F.asMap("1", 1, "2", 2, "3", 3));
  jcache.withSkipStore().removeAll();
  assertEquals((Integer)1, jcache.get("1"));
  assertEquals((Integer)2, jcache.get("2"));
  assertEquals((Integer)3, jcache.get("3"));
}

相关文章