/** * Get native library name. * * @param lib Library. * @return Name. */ private static String nativeLibraryName(Object lib) { assert lib != null; return U.field(lib, "name"); }
/** */ private ZooKeeperServer getServer(ServerCnxnFactory fac) { ZooKeeperServer zs = U.field(fac, "zkServer"); return zs; }
@Override public void verify(BaselineTopology blt) { long activationHash = U.field(blt, "branchingPntHash"); assertEquals(expectedActivationHash, activationHash); } };
/** * @param proc Continuous processor. * @return Local event routines. */ private Collection<LocalRoutineInfo> localRoutines(GridContinuousProcessor proc) { return F.view(U.<Map<UUID, LocalRoutineInfo>>field(proc, "locInfos").values(), new IgnitePredicate<LocalRoutineInfo>() { @Override public boolean apply(LocalRoutineInfo info) { return info.handler().isEvents(); } }); }
/** * @param marsh Marshaller. * @return Binary context. */ protected BinaryContext binaryContext(BinaryMarshaller marsh) { GridBinaryMarshaller impl = U.field(marsh, "impl"); return impl.context(); }
/** * @param marsh Marshaller. * @return Binary context. */ protected BinaryContext binaryContext(BinaryMarshaller marsh) { GridBinaryMarshaller impl = U.field(marsh, "impl"); return impl.context(); }
@Override public void verify(BaselineTopology blt) { assertNotNull(blt); assertEquals(4, blt.consistentIds().size()); long activationHash = U.field(blt, "branchingPntHash"); assertEquals(expectedActivationHash, activationHash); } };
/** * @param po Binary object. * @param off Offset. * @return Value. */ private int intFromBinary(BinaryObject po, int off) { byte[] arr = U.field(po, "arr"); return Integer.reverseBytes(U.bytesToInt(arr, off)); }
@Override public void verify(BaselineTopology blt) { assertNotNull(blt); assertEquals(3, blt.consistentIds().size()); long activationHash = U.field(blt, "branchingPntHash"); assertEquals(expectedHash1, activationHash); } };
/** {@inheritDoc} */ @Override protected void beforeTestsStarted() throws Exception { super.beforeTestsStarted(); System.setProperty(IgniteSystemProperties.IGNITE_UPDATE_NOTIFIER, "true"); Properties props = U.field(IgniteProperties.class, "PROPS"); updateStatusParams = props.getProperty("ignite.update.status.params"); props.setProperty("ignite.update.status.params", "ver=" + IgniteProperties.get("ignite.version")); }
/** {@inheritDoc} */ @Override protected WALIterator getWalIterator( IgniteWriteAheadLogManager walMgr, boolean ignoreArchiveDir ) throws IgniteCheckedException { File walArchiveDir = U.field(walMgr, "walArchiveDir"); File walDir = U.field(walMgr, "walWorkDir"); IgniteWalIteratorFactory iterFactory = new IgniteWalIteratorFactory(); return ignoreArchiveDir ? iterFactory.iterator(walDir) : iterFactory.iterator(walArchiveDir, walDir); } }
/** * @param igniteClient Ignite client. * @param skip Skip. */ private void skipRead(IgniteEx igniteClient, boolean skip) { GridIoManager ioMgr = igniteClient.context().io(); TcpCommunicationSpi commSpi = (TcpCommunicationSpi)((Object[])U.field(ioMgr, "spis"))[0]; GridNioServer nioSrvr = U.field(commSpi, "nioSrvr"); GridTestUtils.setFieldValue(nioSrvr, "skipRead", skip); } }
/** * @return Indexing. */ private IgniteH2Indexing getIndexing() { return U.field(ignite0.context().query(), "idx"); }
/** * @param client Client. */ private void suspendClientMetricsUpdate(Ignite client) { assert client.cluster().localNode().isClient(); ClientImpl impl = U.field(client.configuration().getDiscoverySpi(), "impl"); Timer timer = U.field(impl, "timer"); timer.cancel(); System.out.println("Metrics update message suspended"); } }
/** * @return Cached two-step query, or {@code null} if none occurred. */ private GridCacheTwoStepQuery cachedTwoStepQuery() { GridQueryIndexing idx = grid(0).context().query().getIndexing(); Map<?, H2TwoStepCachedQuery> m = U.field(idx, "twoStepCache"); if (m.isEmpty()) return null; H2TwoStepCachedQuery q = m.values().iterator().next(); return q.query(); }
/** * @param ignite Node. * @return Completed txs map. */ private Map completedTxsMap(Ignite ignite) { IgniteTxManager tm = ((IgniteKernal)ignite).context().cache().context().tm(); return U.field(tm, "completedVersHashMap"); }
/** * */ private JdbcConnection connection() throws Exception { GridKernalContext ctx = ((IgniteEx)ignite).context(); GridQueryProcessor qryProcessor = ctx.query(); IgniteH2Indexing idx = U.field(qryProcessor, "idx"); String schemaName = idx.schema(DEFAULT_CACHE_NAME); return (JdbcConnection)idx.connections().connectionForThread().connection(schemaName); }
/** * @throws Exception If failed. */ @Test public void testTaskException() throws Exception { Map map = U.field(((IgniteKernal)grid(0)).context().io(), "msgSetMap"); int initSize = map.size(); ComputeTaskFuture<?> fut = executeAsync(compute(grid(0).cluster().forRemotes()), FailTask.class, null); testMessageSet(fut, initSize, map); }
/** * @throws Exception If failed. */ @Test public void testStandAloneIterator() throws Exception { IgniteEx ig = grid(); IgniteWriteAheadLogManager wal = ig.context().cache().context().wal(); File walArchiveDir = U.field(wal, "walArchiveDir"); IgniteWalIteratorFactory iteratorFactory = new IgniteWalIteratorFactory(); doTest(wal, iteratorFactory.iterator(walArchiveDir)); }