/** * @param val Internal value. * @return User value. */ private Object convert(Object val) { if (val == null) return null; return locStore ? ((IgniteBiTuple<Object, GridCacheVersion>)val).get1() : val; }
/** * @return Written blocks. */ long writeBlocks() { return blocksWritten.get1().longValue(); }
/** * Returns annotated value. * * @param target Object to find a value in. * @return Value of annotated field or method. * @throws IgniteCheckedException If failed to find. */ public Object annotatedValue(Object target) throws IgniteCheckedException { IgniteBiTuple<Object, Boolean> res = annotatedValue(target, new HashSet<>(), false); assert res != null; return res.get1(); }
/** {@inheritDoc} */ @Override public Map<? extends ComputeJob, ClusterNode> map(List<ClusterNode> subgrid, @Nullable Void arg) { return absMap(t.get1(), t.get2(), subgrid, lb); } }
/** * @return Read blocks. */ long readBlocks() { return blocksRead.get1().longValue(); }
/** * Gets value of annotated field or method. * * @param target Object to find a value in. * @param annCls Annotation class. * @return Value of annotated field or method. * @throws IgniteCheckedException If failed to find. */ @Nullable public Object annotatedValue(Object target, Class<? extends Annotation> annCls) throws IgniteCheckedException { return annotatedValue(target, annCls, null, false).get1(); }
@Nullable @Override public Object next() { if (!hasNext()) throw new NoSuchElementException(); Object res = null; if (nextIdx == 1) res = get1(); else if (nextIdx == 2) res = get2(); nextIdx++; return res; }
/** {@inheritDoc} */ @Override public Map<? extends ComputeJob, ClusterNode> map(List<ClusterNode> subgrid, @Nullable Void arg) { return absMap(t.get1(), F.asList(t.get2()), subgrid, lb); } }
/** {@inheritDoc} */ @Override public WALRecord read(WALPointer ptr) throws IgniteCheckedException, StorageException { try (WALIterator it = replay(ptr)) { IgniteBiTuple<WALPointer, WALRecord> rec = it.next(); if (rec.get1().equals(ptr)) return rec.get2(); else throw new StorageException("Failed to read record by pointer [ptr=" + ptr + ", rec=" + rec + "]"); } }
/** * Adds given numbers to written bytes and write time. * * @param writtenBytes Number of bytes written. * @param writeTime Write time. */ void addWrittenBytesTime(long writtenBytes, long writeTime) { IgniteBiTuple<LongAdder, LongAdder> bytesWritten0 = bytesWritten; bytesWritten0.get1().add(writtenBytes); bytesWritten0.get2().add(writeTime); }
/** * Adds given numbers to read blocks counters. * * @param total Total number of blocks read. * @param secondary Number of blocks read form secondary FS. */ void addReadBlocks(int total, int secondary) { IgniteBiTuple<LongAdder, LongAdder> blocksRead0 = blocksRead; blocksRead0.get1().add(total); blocksRead0.get2().add(secondary); }
/** * @param key Key. * @param oldVal Expected old value. * @param newVal Expected new value. */ private void assertBeforePutValue(String key, @Nullable Object oldVal, @Nullable Object newVal) { IgniteBiTuple t = interceptor.beforePutMap.get(key); assertNotNull(t); assertEquals(t.get1(), oldVal); assertEquals(t.get2(), newVal); }
@Override public Object apply(Ignite ignite) { IgniteBiTuple<Integer, Integer> t = ignite.atomicStamped(STRUCTURE_NAME, 1, 1, false).get(); assert t.get1() > 0; assert t.get2() > 0; return null; } });
@Override public IgfsStatus call() throws Exception { IgniteBiTuple<Long, Long> space = igfsCtx.kernalContext().grid().compute().execute( new IgfsGlobalSpaceTask(name()), null); return new IgfsStatus(space.get1(), space.get2()); } });
/** {@inheritDoc} */ @Override protected IgniteConfiguration getConfiguration(String gridName) throws Exception { IgniteBiTuple<IgniteConfiguration, GridSpringResourceContext> cfgPair = IgnitionEx.loadConfiguration(cfgPath(getTestIgniteInstanceIndex(gridName))); IgniteConfiguration cfg = cfgPair.get1(); cfg.setIgniteInstanceName(gridName); return cfg; }
/** * @param gridIdx Grid index. * @param expCnts Expected counters */ private void printEventCounters(int gridIdx, IgniteBiTuple<Integer, Integer>[] expCnts) { info("Printing counters [gridIdx=" + gridIdx + ']'); for (IgniteBiTuple<Integer, Integer> t : expCnts) { Integer evtType = t.get1(); int actCnt = evtLsnr.eventCount(evtType); info("Event [evtType=" + evtType + ", expCnt=" + t.get2() + ", actCnt=" + actCnt + ']'); } }
/** * @param data Tests data. */ public ServiceDeploymentProcessIdSelfTest(IgniteBiTuple<DiscoveryEvent, AffinityTopologyVersion> data) { this.evt = data.get1(); this.topVer = data.get2(); if (evt instanceof DiscoveryCustomEvent) this.sut = new ServiceDeploymentProcessId(((DiscoveryCustomEvent)evt).customMessage().id()); else this.sut = new ServiceDeploymentProcessId(topVer); }
/** * @param nodeIp Node ip. * @param node Node. * @return {@code True} if addresses are equal, {@code false} otherwise. */ private boolean eqAddresses(IgniteBiTuple<Collection<String>, Collection<String>> nodeIp, GridClientNode node) { return F.eqOrdered(nodeIp.get1(), (Collection<String>)(node.attribute(restAddressAttributeName()))) && F.eqOrdered(nodeIp.get2(), (Collection<String>)(node.attribute(restHostNameAttributeName()))); }