/** * Adds event of the job preparation. * * @param ts Timestamp of the event. */ public void onJobPrepare(long ts) { assert nodeId != null; evts.add(new T2<>("JOB prepare " + nodeId, ts)); }
/** * Adds event of the job start. * * @param ts Timestamp of the event. */ public void onJobStart(long ts) { assert nodeId != null; evts.add(new T2<>("JOB start " + nodeId, ts)); }
/** * @param nodeEvtData Node event data. * @param discoData Discovery data for node. */ void addJoinedNode(ZkJoinedNodeEvtData nodeEvtData, Map<Integer, Serializable> discoData) { if (nodes == null) nodes = new ArrayList<>(); nodes.add(new T2<>(nodeEvtData, discoData)); }
/** {@inheritDoc} */ @Override public Object getAttribute(String name) { if (!isValid) throw new IllegalStateException("Call on invalidated session!"); Object val = attrs.get(name); if (val != null && updates != null) updates.add(new T2<>(name, val)); return val; }
/** {@inheritDoc} */ @Override public void setAttribute(String name, Object val) { if (!isValid) throw new IllegalStateException("Call on invalidated session!"); attrs.put(name, val); if (updates != null) updates.add(new T2<>(name, val)); }
/** * @param entryProcessor Entry processor. * @param invokeArgs Optional arguments for EntryProcessor. */ public void addEntryProcessor(EntryProcessor<Object, Object, Object> entryProcessor, Object[] invokeArgs) { if (entryProcessorsCol == null) entryProcessorsCol = new LinkedList<>(); entryProcessorsCol.add(new T2<>(entryProcessor, invokeArgs)); // Must clear transform closure bytes since collection has changed. transformClosBytes = null; val.op(TRANSFORM); }
/** * Adds event of the task run. * * @param info Task info. * @param ts Timestamp of the event. */ public void onTaskStart(HadoopTaskInfo info, long ts) { evts.add(new T2<>(eventName(info, "start"), ts)); }
/** * Adds event of the task preparation. * * @param info Task info. * @param ts Timestamp of the event. */ public void onTaskPrepare(HadoopTaskInfo info, long ts) { evts.add(new T2<>(eventName(info, "prepare"), ts)); }
@Override public T2<UUID, ClusterMetrics> apply(byte[] bytes) { UUID nodeId = new UUID(U.bytesToLong(bytes, 0), U.bytesToLong(bytes, 8)); return new T2<>(nodeId, ClusterMetricsSnapshot.deserialize(bytes, 16)); } });
/** * @throws Exception If failed. */ @Test public void testPutLongStringKey() throws Exception { IgniteCache<String, String> cache = jcache(0, STR_CACHE_NAME); T2<String, String> val = new T2<>("12345", "2"); checkPutAll(shouldSucceed, cache, new T2<>("1", "1"), val); checkPutOps(shouldSucceed, cache, val); }
/** {@inheritDoc} */ @Override public Void call() throws Exception { CU.checkAttributeMismatch(strLog, cfg1, cfg2, node.id(), new T2<>("cacheMode", "Cache mode"), true); return null; } }, IgniteCheckedException.class, "Cache mode mismatch");
/** {@inheritDoc} */ @Override public T2<Long, Long> times(String path) throws IOException { BasicFileAttributes attrs = Files.getFileAttributeView(path(path), BasicFileAttributeView.class) .readAttributes(); return new T2<>(attrs.lastModifiedTime().toMillis(), attrs.lastAccessTime().toMillis()); }
/** * @throws Exception If failed. */ private void doCheckPutLongStringKey2(String cacheName) { IgniteCache<String, Organization> cache = jcache(0, cacheName); T2<String, Organization> key2 = new T2<>("12345", new Organization("1")); checkPutAll(shouldSucceed, cache, new T2<>("1", new Organization("1")), key2); checkPutOps(shouldSucceed, cache, key2); }
/** * @throws Exception If failed. */ @Test public void testPutTooLongDecimalKeyScaleFail() throws Exception { IgniteCache<BigDecimal, BigDecimal> cache = jcache(0, DEC_CACHE_NAME_FOR_SCALE); T2<BigDecimal, BigDecimal> val = new T2<>(d(3.456), d(12.34)); checkPutAll(shouldFail, cache, new T2<>(d(12.35), d(12.34)), val); checkPutOps(shouldFail, cache, val); }
/** * @throws Exception If failed. */ @Test public void testPutValidDecimalKeyAndValue() throws Exception { IgniteCache<BigDecimal, BigDecimal> cache = jcache(0, DEC_CACHE_NAME_FOR_SCALE); T2<BigDecimal, BigDecimal> val = new T2<>(d(12.37), d(12.34)); checkPutAll(shouldSucceed, cache, new T2<>(d(12.36), d(12.34)), val); checkPutOps(shouldSucceed, cache, val); checkReplaceOps(shouldSucceed, cache, val, d(12.34)); }
/** * @throws Exception If failed. */ @Test public void testPutTooLongStringKeyFieldFail() throws Exception { IgniteCache<Organization, Address> cache = jcache(0, OBJ_CACHE_NAME); T2<Organization, Address> val = new T2<>(new Organization("123456"), new Address("2")); checkPutAll(shouldFail, cache, new T2<>(new Organization("1"), new Address("1")), val); checkPutOps(shouldFail, cache, val); }
/** * @throws Exception If failed. */ @Test public void testPutLongStringValueField() throws Exception { IgniteCache<Organization, Address> cache = jcache(0, OBJ_CACHE_NAME); T2<Organization, Address> val = new T2<>(new Organization("3"), new Address("12345")); checkPutAll(shouldSucceed, cache, new T2<>(new Organization("1"), new Address("1")), val); checkPutOps(shouldSucceed, cache, val); checkReplaceOps(shouldSucceed, cache, val, new Address("1")); }
/** * @throws Exception If failed. */ @Test public void testPutValidDecimalKeyAndValueField2() throws Exception { IgniteCache<BigDecimal, Employee> cache = jcache(0, DEC_EMPL_CACHE_NAME_FOR_SCALE); T2<BigDecimal, Employee> val = new T2<>(d(12.37), new Employee(d(12.34))); checkPutAll(shouldSucceed, cache, new T2<>(d(12.36), new Employee(d(12.34))), val); checkPutOps(shouldSucceed, cache, val); checkReplaceOps(shouldSucceed, cache, val, new Employee(d(12.34))); }
/** * @throws Exception If failed. */ @Test public void testPutTooLongDecimalKeyFieldFail() throws Exception { IgniteCache<DecOrganization, Employee> cache = jcache(0, OBJ_CACHE_NAME_FOR_PREC); T2<DecOrganization, Employee> val = new T2<>(new DecOrganization(d(123.45)), new Employee(d(12.34))); checkPutAll(shouldFail, cache, new T2<>(new DecOrganization(d(12.35)), new Employee(d(12.34))), val); checkPutOps(shouldFail, cache, val); }
/** * @throws Exception If failed. */ @Test public void testPutValidDecimalKeyAndValueField() throws Exception { IgniteCache<DecOrganization, Employee> cache = jcache(0, OBJ_CACHE_NAME_FOR_SCALE); T2<DecOrganization, Employee> val = new T2<>(new DecOrganization(d(12.37)), new Employee(d(12.34))); checkPutAll(shouldSucceed, cache, new T2<>(new DecOrganization(d(12.36)), new Employee(d(12.34))), val); checkPutOps(shouldSucceed, cache, val); checkReplaceOps(shouldSucceed, cache, val, new Employee(d(12.34))); }