/** {@inheritDoc} */ @Override public Map<IgniteTxKey, IgniteTxEntry> writeMap() { return entry != null ? F.asMap(entry.get(0).txKey(), entry.get(0)) : Collections.<IgniteTxKey, IgniteTxEntry>emptyMap(); }
/** {@inheritDoc} */ @Override public Map<IgniteTxKey, IgniteTxEntry> writeMap() { return entry != null ? F.asMap(entry.txKey(), entry) : Collections.<IgniteTxKey, IgniteTxEntry>emptyMap(); }
/** {@inheritDoc} */ @Override public Map<Integer, Integer> loadAll(Iterable<? extends Integer> keys) { assert keys != null; return F.asMap(1, 1, 2, 2, 3, 3); }
/** * 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)); }
/** * 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)); }
/** * @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)); }
/** {@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)); }
/** {@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; }
/** */ @Test public void testAtomicOrImplicitTxPutAll() throws Exception { doAtomicOrImplicitTxPutAll(F.asMap(1, okValue, 5, badValue), 1); }
/** */ @Test public void testTxPutAll() throws Exception { doTxPutAll(F.asMap(1, okValue, 5, badValue)); }
/** {@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; }
/** * @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")))); }
/** {@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; }
@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 ");
@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 ");
@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()); } });
/** 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())); }
@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");
@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()); } });
/** * @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")); }