/** * @param ctx Kernal context. */ @SuppressWarnings("deprecation") public CacheObjectBinaryProcessorImpl(GridKernalContext ctx) { super(ctx); marsh = ctx.grid().configuration().getMarshaller(); }
@Override public boolean apply() { info("Lock event count: " + lockEvtCnt.get()); if (atomicityMode() == ATOMIC) return lockEvtCnt.get() == 0; if (cacheMode() == PARTITIONED && nearEnabled()) { if (!grid(0).configuration().isClientMode()) return lockEvtCnt.get() == 4; } return lockEvtCnt.get() == 2; } }, 15000));
/** * @param ig Ignite. * @return BlockTcpCommunicationSpi. */ private BlockTcpCommunicationSpi unwrapSPI(IgniteEx ig) { return ((BlockTcpCommunicationSpi)ig.configuration().getCommunicationSpi()); }
/** {@inheritDoc} */ @Override protected VisorBinaryMetadataCollectorTaskResult run(VisorBinaryMetadataCollectorTaskArg arg) { Marshaller marsh = ignite.configuration().getMarshaller(); IgniteBinary binary = marsh == null || marsh instanceof BinaryMarshaller ? ignite.binary() : null; return new VisorBinaryMetadataCollectorTaskResult(0L, VisorBinaryMetadata.list(binary)); }
/** {@inheritDoc} */ @Override protected void beforeTest() throws Exception { marsh = grid().configuration().getMarshaller(); igniteInstanceName = grid().configuration().getIgniteInstanceName(); }
@Override public boolean apply() { info("Lock event count: " + lockEvtCnt.get()); if (atomicityMode() == ATOMIC) return lockEvtCnt.get() == 0; if (cacheMode() == PARTITIONED && nearEnabled()) { if (!grid(0).configuration().isClientMode()) return lockEvtCnt.get() == 4; } return lockEvtCnt.get() == 2; } }, 15000));
/** * @return Tested grid in client mode or not. */ protected boolean isClientMode() { return grid(testedNodeIdx).configuration().isClientMode(); }
/** */ private byte[] bigArray(IgniteEx grid) { int arrSz = grid.configuration().getDataStorageConfiguration().getPageSize() * 3; byte[] bigArr = new byte[arrSz]; for (int i=0; i<bigArr.length; i++) bigArr[i] = (byte)i; return bigArr; } }
/** * */ public boolean onlyClient(){ for (int i = 0; i < gridCount(); i++) if (!grid(i).configuration().isClientMode()) return false; return true; }
/** * @return Count of clients. */ protected int clientsCount() { int cnt = 0; for (int i = 0; i < gridCount(); i++) { if (grid(i).configuration().isClientMode()) cnt++; } return cnt; }
/** * @param gridIdx Grid index. * @return Failure handler configured for grid with given index. */ private TestFailureHandler failureHandler(int gridIdx) { FailureHandler hnd = grid(gridIdx).configuration().getFailureHandler(); assertTrue(hnd instanceof TestFailureHandler); return (TestFailureHandler)hnd; }
/** * @return Count of server nodes at topology. */ protected int serversGridCount() { int cnt = 0; for (int i = 0; i < gridCount(); i++) { if (!grid(i).configuration().isClientMode()) cnt++; } return cnt; }
/** * * @param g */ protected void checkIsClientFlag(IgniteEx g) { boolean isClientDiscovery = g.context().discovery().localNode().isClient(); boolean isClientConfig = g.configuration().isClientMode() == null ? false : g.configuration().isClientMode(); assertEquals(isClientConfig, isClientDiscovery); }
/** Checks that a bean with the specified group and name is available and has the expected attribute */ private void checkBean(String grp, String name, String attributeName, Object expAttributeVal) throws Exception { ObjectName mBeanName = IgniteUtils.makeMBeanName(grid().name(), grp, name); Object attributeVal = grid().configuration().getMBeanServer().getAttribute(mBeanName, attributeName); assertEquals(expAttributeVal, attributeVal); } }
/** Checks that a bean with the specified group and name is available and has the expected attribute */ private void checkBean(String grp, String name, String attributeName, Object expAttributeVal) throws Exception { ObjectName mBeanName = IgniteUtils.makeMBeanName(grid().name(), grp, name); Object attributeVal = grid().configuration().getMBeanServer().getAttribute(mBeanName, attributeName); assertEquals(expAttributeVal, attributeVal); } }
/** * @throws Exception If failed. */ @Test public void testUnsupportedCommands() throws Exception { GridTestKernalContext ctx = newContext(grid().configuration()); ctx.add(new GridTimeoutProcessor(ctx)); QueryCommandHandler cmdHnd = new QueryCommandHandler(ctx); Collection<GridRestCommand> commands = cmdHnd.supportedCommands(); assertFalse(commands.contains(GridRestCommand.LOG)); }
/** */ private static void blockProbe(IgniteEx ign, Transaction tx) { ((TestRecordingCommunicationSpi)ign.configuration().getCommunicationSpi()) .blockMessages((node, msg) -> { if (msg instanceof DeadlockProbe) { DeadlockProbe msg0 = (DeadlockProbe)msg; GridNearTxLocal tx0 = ((TransactionProxyImpl)tx).tx(); return msg0.initiatorVersion().equals(tx0.xidVersion()); } return false; }); }
/** {@inheritDoc} */ @Override protected void beforeTestsStarted() throws Exception { super.beforeTestsStarted(); startGridsMultiThreaded(SRVS); clientMode = true; startGridsMultiThreaded(SRVS, CLIENTS); for (int i = 0; i < CLIENTS; i++) assertTrue(grid(SRVS + i).configuration().isClientMode()); }
/** {@inheritDoc} */ @Override protected void beforeTest() throws Exception { IgniteEx grid = grid(0); igfs = grid.fileSystem(igfsName()); FileSystemConfiguration[] cfgs = grid.configuration().getFileSystemConfiguration(); assert cfgs.length == 1; metaCacheName = cfgs[0].getMetaCacheConfiguration().getName(); metaCache = ((IgniteKernal)grid).internalCache(metaCacheName); }
/** {@inheritDoc} */ @Override protected void beforeTestsStarted() throws Exception { super.beforeTestsStarted(); startGrid(); ConnectorConfiguration connCfg = new ConnectorConfiguration(); connCfg.setIdleQueryCursorCheckFrequency(1000); connCfg.setIdleQueryCursorTimeout(1000); grid().configuration().setConnectorConfiguration(connCfg); }