Search in sources :

Example 6 with EXIT_CODE_OK

use of org.apache.ignite.internal.commandline.CommandHandler.EXIT_CODE_OK in project ignite by apache.

the class KillCommandsCommandShTest method testCancelConsistencyTask.

/**
 */
@Test
public void testCancelConsistencyTask() throws InterruptedException {
    String consistencyCacheName = "consistencyCache";
    CacheConfiguration<Integer, Integer> cfg = new CacheConfiguration<>();
    cfg.setName(consistencyCacheName);
    cfg.setBackups(SERVER_NODE_CNT - 1);
    cfg.setAffinity(new RendezvousAffinityFunction().setPartitions(1));
    IgniteCache<Integer, Integer> cache = client.getOrCreateCache(cfg);
    int entries = 10_000;
    for (int i = 0; i < entries; i++) cache.put(i, i);
    AtomicInteger getCnt = new AtomicInteger();
    CountDownLatch thLatch = new CountDownLatch(1);
    Thread th = new Thread(() -> {
        IgnitePredicate<ComputeJobView> repairJobFilter = job -> job.taskClassName().equals(VisorConsistencyRepairTask.class.getName());
        for (IgniteEx node : srvs) {
            SystemView<ComputeJobView> jobs = node.context().systemView().view(JOBS_VIEW);
            // Found.
            assertTrue(F.iterator0(jobs, true, repairJobFilter).hasNext());
        }
        int res = execute("--consistency", "status");
        assertEquals(EXIT_CODE_OK, res);
        assertContains(log, testOut.toString(), "Status: 1024/" + entries);
        assertNotContains(log, testOut.toString(), VisorConsistencyStatusTask.NOTHING_FOUND);
        testOut.reset();
        res = execute("--kill", "consistency");
        assertEquals(EXIT_CODE_OK, res);
        try {
            assertTrue(GridTestUtils.waitForCondition(() -> {
                for (IgniteEx node : srvs) {
                    SystemView<ComputeJobView> jobs = node.context().systemView().view(JOBS_VIEW);
                    if (// Found.
                    F.iterator0(jobs, true, repairJobFilter).hasNext())
                        return false;
                }
                return true;
            }, // Missed.
            5000L));
        } catch (IgniteInterruptedCheckedException e) {
            fail();
        }
        thLatch.countDown();
    });
    // GridNearGetRequest messages count required to pefrom getAll() with readRepair from all nodes twice.
    // First will be finished (which generates status), second will be frozen.
    int twiceGetMsgCnt = SERVER_NODE_CNT * (SERVER_NODE_CNT - 1) * 2;
    for (IgniteEx server : srvs) {
        TestRecordingCommunicationSpi spi = ((TestRecordingCommunicationSpi) server.configuration().getCommunicationSpi());
        AtomicInteger locLimit = new AtomicInteger(SERVER_NODE_CNT - 1);
        spi.blockMessages((node, message) -> {
            if (message instanceof GridNearGetRequest) {
                // Each node should perform get twice.
                if (getCnt.incrementAndGet() == twiceGetMsgCnt)
                    th.start();
                // Cancellation should stop the process.
                assertTrue(getCnt.get() <= twiceGetMsgCnt);
                // Blocking to freeze '--consistency repair' operation (except first get).
                return locLimit.decrementAndGet() < 0;
            }
            return false;
        });
    }
    injectTestSystemOut();
    assertEquals(EXIT_CODE_UNEXPECTED_ERROR, execute("--consistency", "repair", ConsistencyCommand.STRATEGY, ReadRepairStrategy.LWW.toString(), ConsistencyCommand.PARTITION, "0", ConsistencyCommand.CACHE, consistencyCacheName));
    assertContains(log, testOut.toString(), "Operation execution cancelled.");
    assertContains(log, testOut.toString(), VisorConsistencyRepairTask.NOTHING_FOUND);
    assertNotContains(log, testOut.toString(), VisorConsistencyRepairTask.CONSISTENCY_VIOLATIONS_FOUND);
    thLatch.await();
    for (IgniteEx server : srvs) {
        // Restoring messaging for other tests.
        TestRecordingCommunicationSpi spi = ((TestRecordingCommunicationSpi) server.configuration().getCommunicationSpi());
        spi.stopBlock();
    }
    testOut.reset();
    int res = execute("--consistency", "status");
    assertEquals(EXIT_CODE_OK, res);
    assertContains(log, testOut.toString(), VisorConsistencyStatusTask.NOTHING_FOUND);
    assertNotContains(log, testOut.toString(), "Status");
}
Also used : CacheAtomicityMode(org.apache.ignite.cache.CacheAtomicityMode) KillCommandsTests.doTestScanQueryCancel(org.apache.ignite.util.KillCommandsTests.doTestScanQueryCancel) KillCommandsTests.doTestCancelService(org.apache.ignite.util.KillCommandsTests.doTestCancelService) IgniteEx(org.apache.ignite.internal.IgniteEx) EXIT_CODE_OK(org.apache.ignite.internal.commandline.CommandHandler.EXIT_CODE_OK) RendezvousAffinityFunction(org.apache.ignite.cache.affinity.rendezvous.RendezvousAffinityFunction) ArrayList(java.util.ArrayList) KillCommandsTests.doTestCancelSQLQuery(org.apache.ignite.util.KillCommandsTests.doTestCancelSQLQuery) KillCommandsTests.doTestCancelTx(org.apache.ignite.util.KillCommandsTests.doTestCancelTx) AtomicInteger(java.util.concurrent.atomic.AtomicInteger) IgnitePredicate(org.apache.ignite.lang.IgnitePredicate) IgniteInterruptedCheckedException(org.apache.ignite.internal.IgniteInterruptedCheckedException) VisorConsistencyStatusTask(org.apache.ignite.internal.visor.consistency.VisorConsistencyStatusTask) GridTestUtils.assertNotContains(org.apache.ignite.testframework.GridTestUtils.assertNotContains) GridNearGetRequest(org.apache.ignite.internal.processors.cache.distributed.near.GridNearGetRequest) F(org.apache.ignite.internal.util.typedef.F) KillCommandsTests.doTestCancelComputeTask(org.apache.ignite.util.KillCommandsTests.doTestCancelComputeTask) SystemView(org.apache.ignite.spi.systemview.view.SystemView) JOBS_VIEW(org.apache.ignite.internal.processors.job.GridJobProcessor.JOBS_VIEW) ReadRepairStrategy(org.apache.ignite.cache.ReadRepairStrategy) Test(org.junit.Test) UUID(java.util.UUID) IgniteCache(org.apache.ignite.IgniteCache) ConsistencyCommand(org.apache.ignite.internal.commandline.consistency.ConsistencyCommand) EXIT_CODE_UNEXPECTED_ERROR(org.apache.ignite.internal.commandline.CommandHandler.EXIT_CODE_UNEXPECTED_ERROR) GridTestUtils(org.apache.ignite.testframework.GridTestUtils) GridTestUtils.assertContains(org.apache.ignite.testframework.GridTestUtils.assertContains) CountDownLatch(java.util.concurrent.CountDownLatch) List(java.util.List) CacheConfiguration(org.apache.ignite.configuration.CacheConfiguration) PAGES_CNT(org.apache.ignite.util.KillCommandsTests.PAGES_CNT) AbstractSnapshotSelfTest.doSnapshotCancellationTest(org.apache.ignite.internal.processors.cache.persistence.snapshot.AbstractSnapshotSelfTest.doSnapshotCancellationTest) VisorConsistencyRepairTask(org.apache.ignite.internal.visor.consistency.VisorConsistencyRepairTask) ComputeJobView(org.apache.ignite.spi.systemview.view.ComputeJobView) KillCommandsTests.doTestCancelContinuousQuery(org.apache.ignite.util.KillCommandsTests.doTestCancelContinuousQuery) TestRecordingCommunicationSpi(org.apache.ignite.internal.TestRecordingCommunicationSpi) PAGE_SZ(org.apache.ignite.util.KillCommandsTests.PAGE_SZ) IgniteUuid(org.apache.ignite.lang.IgniteUuid) CountDownLatch(java.util.concurrent.CountDownLatch) AtomicInteger(java.util.concurrent.atomic.AtomicInteger) ComputeJobView(org.apache.ignite.spi.systemview.view.ComputeJobView) SystemView(org.apache.ignite.spi.systemview.view.SystemView) IgniteInterruptedCheckedException(org.apache.ignite.internal.IgniteInterruptedCheckedException) TestRecordingCommunicationSpi(org.apache.ignite.internal.TestRecordingCommunicationSpi) AtomicInteger(java.util.concurrent.atomic.AtomicInteger) IgniteEx(org.apache.ignite.internal.IgniteEx) VisorConsistencyRepairTask(org.apache.ignite.internal.visor.consistency.VisorConsistencyRepairTask) GridNearGetRequest(org.apache.ignite.internal.processors.cache.distributed.near.GridNearGetRequest) RendezvousAffinityFunction(org.apache.ignite.cache.affinity.rendezvous.RendezvousAffinityFunction) CacheConfiguration(org.apache.ignite.configuration.CacheConfiguration) Test(org.junit.Test) AbstractSnapshotSelfTest.doSnapshotCancellationTest(org.apache.ignite.internal.processors.cache.persistence.snapshot.AbstractSnapshotSelfTest.doSnapshotCancellationTest)

Example 7 with EXIT_CODE_OK

use of org.apache.ignite.internal.commandline.CommandHandler.EXIT_CODE_OK in project ignite by apache.

the class GridCommandHandlerDefragmentationTest method testDefragmentationCancelInProgress.

/**
 * @throws Exception If failed.
 */
@Test
public void testDefragmentationCancelInProgress() throws Exception {
    IgniteEx ig = startGrid(0);
    ig.cluster().state(ClusterState.ACTIVE);
    IgniteCache<Object, Object> cache = ig.getOrCreateCache(DEFAULT_CACHE_NAME);
    for (int i = 0; i < 1024; i++) cache.put(i, i);
    forceCheckpoint(ig);
    String grid0ConsId = ig.configuration().getConsistentId().toString();
    ListeningTestLogger testLog = new ListeningTestLogger();
    CommandHandler cmd = createCommandHandler(testLog);
    assertEquals(EXIT_CODE_OK, execute(cmd, "--defragmentation", "schedule", "--nodes", grid0ConsId));
    String port = grid(0).localNode().attribute(IgniteNodeAttributes.ATTR_REST_TCP_PORT).toString();
    stopGrid(0);
    blockCdl = new CountDownLatch(128);
    UnaryOperator<IgniteConfiguration> cfgOp = cfg -> {
        DataStorageConfiguration dsCfg = cfg.getDataStorageConfiguration();
        FileIOFactory delegate = dsCfg.getFileIOFactory();
        dsCfg.setFileIOFactory((file, modes) -> {
            if (file.getName().contains("dfrg")) {
                if (blockCdl.getCount() == 0) {
                    try {
                        // Slow down defragmentation process.
                        // This'll be enough for the test since we have, like, 900 partitions left.
                        Thread.sleep(100);
                    } catch (InterruptedException ignore) {
                    // No-op.
                    }
                } else
                    blockCdl.countDown();
            }
            return delegate.create(file, modes);
        });
        return cfg;
    };
    IgniteInternalFuture<?> fut = GridTestUtils.runAsync(() -> {
        try {
            startGrid(0, cfgOp);
        } catch (Exception e) {
            // No-op.
            throw new RuntimeException(e);
        }
    });
    blockCdl.await();
    LogListener logLsnr = LogListener.matches("Defragmentation cancelled successfully.").build();
    testLog.registerListener(logLsnr);
    assertEquals(EXIT_CODE_OK, execute(cmd, "--port", port, "--defragmentation", "cancel"));
    assertTrue(logLsnr.check());
    fut.get();
    testLog.clearListeners();
    logLsnr = LogListener.matches("Defragmentation is already completed or has been cancelled previously.").build();
    testLog.registerListener(logLsnr);
    assertEquals(EXIT_CODE_OK, execute(cmd, "--port", port, "--defragmentation", "cancel"));
    assertTrue(logLsnr.check());
}
Also used : IgniteInternalFuture(org.apache.ignite.internal.IgniteInternalFuture) ListeningTestLogger(org.apache.ignite.testframework.ListeningTestLogger) LogListener(org.apache.ignite.testframework.LogListener) Arrays(java.util.Arrays) IgniteNodeAttributes(org.apache.ignite.internal.IgniteNodeAttributes) ClusterState(org.apache.ignite.cluster.ClusterState) UnaryOperator(java.util.function.UnaryOperator) IgniteEx(org.apache.ignite.internal.IgniteEx) Formatter(java.util.logging.Formatter) EXIT_CODE_OK(org.apache.ignite.internal.commandline.CommandHandler.EXIT_CODE_OK) GridCacheDatabaseSharedManager(org.apache.ignite.internal.processors.cache.persistence.GridCacheDatabaseSharedManager) EXIT_CODE_INVALID_ARGUMENTS(org.apache.ignite.internal.commandline.CommandHandler.EXIT_CODE_INVALID_ARGUMENTS) FileIOFactory(org.apache.ignite.internal.processors.cache.persistence.file.FileIOFactory) DataStorageConfiguration(org.apache.ignite.configuration.DataStorageConfiguration) StreamHandler(java.util.logging.StreamHandler) ACTIVE(org.apache.ignite.cluster.ClusterState.ACTIVE) DefragmentationParameters(org.apache.ignite.internal.processors.cache.persistence.defragmentation.maintenance.DefragmentationParameters) CommandHandler(org.apache.ignite.internal.commandline.CommandHandler) Test(org.junit.Test) Ignite(org.apache.ignite.Ignite) LogRecord(java.util.logging.LogRecord) Logger(java.util.logging.Logger) MaintenanceTask(org.apache.ignite.maintenance.MaintenanceTask) IgniteCache(org.apache.ignite.IgniteCache) GridTestUtils(org.apache.ignite.testframework.GridTestUtils) CountDownLatch(java.util.concurrent.CountDownLatch) List(java.util.List) IgniteConfiguration(org.apache.ignite.configuration.IgniteConfiguration) Pattern(java.util.regex.Pattern) Collections(java.util.Collections) FileIOFactory(org.apache.ignite.internal.processors.cache.persistence.file.FileIOFactory) LogListener(org.apache.ignite.testframework.LogListener) ListeningTestLogger(org.apache.ignite.testframework.ListeningTestLogger) CommandHandler(org.apache.ignite.internal.commandline.CommandHandler) CountDownLatch(java.util.concurrent.CountDownLatch) DataStorageConfiguration(org.apache.ignite.configuration.DataStorageConfiguration) IgniteConfiguration(org.apache.ignite.configuration.IgniteConfiguration) IgniteEx(org.apache.ignite.internal.IgniteEx) Test(org.junit.Test)

Example 8 with EXIT_CODE_OK

use of org.apache.ignite.internal.commandline.CommandHandler.EXIT_CODE_OK in project ignite by apache.

the class GridCommandHandlerIndexingCheckSizeTest method validateCheckSizes.

/**
 * Checking whether cache and index size check is correct.
 *
 * @param node Node.
 * @param cacheName Cache name.
 * @param rmvByTbl Number of deleted items per table.
 * @param cacheSizeExp Function for getting expected cache size.
 * @param idxSizeExp Function for getting expected index size.
 */
private void validateCheckSizes(IgniteEx node, String cacheName, Map<String, AtomicInteger> rmvByTbl, Function<AtomicInteger, Integer> cacheSizeExp, Function<AtomicInteger, Integer> idxSizeExp) {
    requireNonNull(node);
    requireNonNull(cacheName);
    requireNonNull(rmvByTbl);
    requireNonNull(cacheSizeExp);
    requireNonNull(idxSizeExp);
    injectTestSystemOut();
    assertEquals(EXIT_CODE_OK, execute(CACHE.text(), VALIDATE_INDEXES.text(), cacheName, CHECK_SIZES.argName()));
    String out = testOut.toString();
    assertContains(log, out, "issues found (listed above)");
    assertContains(log, out, "Size check");
    Map<String, ValidateIndexesCheckSizeResult> valIdxCheckSizeResults = ((VisorValidateIndexesTaskResult) lastOperationResult).results().get(node.localNode().id()).checkSizeResult();
    assertEquals(rmvByTbl.size(), valIdxCheckSizeResults.size());
    for (Map.Entry<String, AtomicInteger> rmvByTblEntry : rmvByTbl.entrySet()) {
        ValidateIndexesCheckSizeResult checkSizeRes = valIdxCheckSizeResults.entrySet().stream().filter(e -> e.getKey().contains(rmvByTblEntry.getKey())).map(Map.Entry::getValue).findAny().orElse(null);
        assertNotNull(checkSizeRes);
        assertEquals((int) cacheSizeExp.apply(rmvByTblEntry.getValue()), checkSizeRes.cacheSize());
        Collection<ValidateIndexesCheckSizeIssue> issues = checkSizeRes.issues();
        assertFalse(issues.isEmpty());
        issues.forEach(issue -> {
            assertEquals((int) idxSizeExp.apply(rmvByTblEntry.getValue()), issue.indexSize());
            Throwable err = issue.error();
            assertNotNull(err);
            assertEquals("Cache and index size not same.", err.getMessage());
        });
    }
}
Also used : Person(org.apache.ignite.util.GridCommandHandlerIndexingUtils.Person) CHECK_SIZES(org.apache.ignite.internal.commandline.cache.argument.ValidateIndexesCommandArg.CHECK_SIZES) GridCommandHandlerIndexingUtils.organizationEntity(org.apache.ignite.util.GridCommandHandlerIndexingUtils.organizationEntity) SqlFieldsQuery(org.apache.ignite.cache.query.SqlFieldsQuery) HashMap(java.util.HashMap) Random(java.util.Random) IgniteEx(org.apache.ignite.internal.IgniteEx) GridCommandHandlerIndexingUtils.createAndFillCache(org.apache.ignite.util.GridCommandHandlerIndexingUtils.createAndFillCache) Function(java.util.function.Function) EXIT_CODE_OK(org.apache.ignite.internal.commandline.CommandHandler.EXIT_CODE_OK) ArrayList(java.util.ArrayList) CACHE_NAME(org.apache.ignite.util.GridCommandHandlerIndexingUtils.CACHE_NAME) GridCommandHandlerIndexingUtils.personEntity(org.apache.ignite.util.GridCommandHandlerIndexingUtils.personEntity) AtomicInteger(java.util.concurrent.atomic.AtomicInteger) Arrays.asList(java.util.Arrays.asList) Map(java.util.Map) ThreadLocalRandom(java.util.concurrent.ThreadLocalRandom) Objects.requireNonNull(java.util.Objects.requireNonNull) Cache(javax.cache.Cache) GridCommandHandlerIndexingUtils.breakCacheDataTree(org.apache.ignite.util.GridCommandHandlerIndexingUtils.breakCacheDataTree) QueryEntity(org.apache.ignite.cache.QueryEntity) ValidateIndexesCommandArg(org.apache.ignite.internal.commandline.cache.argument.ValidateIndexesCommandArg) ValidateIndexesCheckSizeIssue(org.apache.ignite.internal.visor.verify.ValidateIndexesCheckSizeIssue) GridTestUtils.assertNotContains(org.apache.ignite.testframework.GridTestUtils.assertNotContains) VisorValidateIndexesTaskResult(org.apache.ignite.internal.visor.verify.VisorValidateIndexesTaskResult) Collections.emptyMap(java.util.Collections.emptyMap) VALIDATE_INDEXES(org.apache.ignite.internal.commandline.cache.CacheSubcommands.VALIDATE_INDEXES) GridCommandHandlerIndexingUtils.breakSqlIndex(org.apache.ignite.util.GridCommandHandlerIndexingUtils.breakSqlIndex) Collection(java.util.Collection) IgniteCheckedException(org.apache.ignite.IgniteCheckedException) IgniteException(org.apache.ignite.IgniteException) Test(org.junit.Test) CacheSubcommands(org.apache.ignite.internal.commandline.cache.CacheSubcommands) CacheObject(org.apache.ignite.internal.processors.cache.CacheObject) CacheDataRow(org.apache.ignite.internal.processors.cache.persistence.CacheDataRow) IgniteCache(org.apache.ignite.IgniteCache) GridTestUtils.assertContains(org.apache.ignite.testframework.GridTestUtils.assertContains) CACHE(org.apache.ignite.internal.commandline.CommandList.CACHE) List(java.util.List) IgniteConfiguration(org.apache.ignite.configuration.IgniteConfiguration) String.valueOf(java.lang.String.valueOf) Organization(org.apache.ignite.util.GridCommandHandlerIndexingUtils.Organization) IgniteDataStreamer(org.apache.ignite.IgniteDataStreamer) GROUP_NAME(org.apache.ignite.util.GridCommandHandlerIndexingUtils.GROUP_NAME) ValidateIndexesCheckSizeResult(org.apache.ignite.internal.visor.verify.ValidateIndexesCheckSizeResult) DataRegionConfiguration(org.apache.ignite.configuration.DataRegionConfiguration) ValidateIndexesCheckSizeIssue(org.apache.ignite.internal.visor.verify.ValidateIndexesCheckSizeIssue) AtomicInteger(java.util.concurrent.atomic.AtomicInteger) VisorValidateIndexesTaskResult(org.apache.ignite.internal.visor.verify.VisorValidateIndexesTaskResult) ValidateIndexesCheckSizeResult(org.apache.ignite.internal.visor.verify.ValidateIndexesCheckSizeResult) HashMap(java.util.HashMap) Map(java.util.Map) Collections.emptyMap(java.util.Collections.emptyMap)

Example 9 with EXIT_CODE_OK

use of org.apache.ignite.internal.commandline.CommandHandler.EXIT_CODE_OK in project ignite by apache.

the class GridCommandHandlerTest method testPersistenceBackupAllCachesCommand.

/**
 * Test verifies that persistence backup command to backup all caches backs up all cache directories.
 *
 * @throws Exception If failed.
 */
@Test
public void testPersistenceBackupAllCachesCommand() throws Exception {
    String cacheName0 = DEFAULT_CACHE_NAME + "0";
    String cacheName1 = DEFAULT_CACHE_NAME + "1";
    File mntcNodeWorkDir = startGridAndPutNodeToMaintenance(new CacheConfiguration[] { cacheConfiguration(cacheName0), cacheConfiguration(cacheName1) }, s -> s.equals(cacheName0));
    IgniteEx ig1 = startGrid(1);
    String port = ig1.localNode().attribute(IgniteNodeAttributes.ATTR_REST_TCP_PORT).toString();
    assertEquals(EXIT_CODE_OK, execute("--persistence", "backup", "all", "--host", "localhost", "--port", port));
    Set<String> backedUpCacheDirs = Arrays.stream(mntcNodeWorkDir.listFiles()).filter(File::isDirectory).filter(f -> f.getName().startsWith("backup_")).map(f -> f.getName().substring("backup_".length())).collect(Collectors.toCollection(TreeSet::new));
    Set<String> allCacheDirs = Arrays.stream(mntcNodeWorkDir.listFiles()).filter(File::isDirectory).filter(f -> f.getName().startsWith("cache-")).map(File::getName).collect(Collectors.toCollection(TreeSet::new));
    assertEqualsCollections(backedUpCacheDirs, allCacheDirs);
    checkCacheAndBackupDirsContent(mntcNodeWorkDir);
}
Also used : RandomAccessFile(java.io.RandomAccessFile) BlockedWarmUpConfiguration(org.apache.ignite.internal.processors.cache.warmup.BlockedWarmUpConfiguration) Arrays(java.util.Arrays) GridCacheMvccCandidate(org.apache.ignite.internal.processors.cache.GridCacheMvccCandidate) EVT_NODE_LEFT(org.apache.ignite.events.EventType.EVT_NODE_LEFT) UnaryOperator(java.util.function.UnaryOperator) GridConcurrentHashSet(org.apache.ignite.internal.client.util.GridConcurrentHashSet) EntryProcessor(javax.cache.processor.EntryProcessor) BooleanSupplier(java.util.function.BooleanSupplier) GridFunc(org.apache.ignite.internal.util.lang.GridFunc) GridTestUtils.runAsync(org.apache.ignite.testframework.GridTestUtils.runAsync) FileIO(org.apache.ignite.internal.processors.cache.persistence.file.FileIO) REENCRYPTION_RESUME(org.apache.ignite.internal.commandline.encryption.EncryptionSubcommands.REENCRYPTION_RESUME) Matcher(java.util.regex.Matcher) EXIT_CODE_INVALID_ARGUMENTS(org.apache.ignite.internal.commandline.CommandHandler.EXIT_CODE_INVALID_ARGUMENTS) Map(java.util.Map) GridAbsPredicate(org.apache.ignite.internal.util.lang.GridAbsPredicate) Path(java.nio.file.Path) GridDhtTxFinishRequest(org.apache.ignite.internal.processors.cache.distributed.dht.GridDhtTxFinishRequest) VisorTxInfo(org.apache.ignite.internal.visor.tx.VisorTxInfo) IgniteCacheGroupsWithRestartsTest(org.apache.ignite.internal.processors.cache.persistence.db.IgniteCacheGroupsWithRestartsTest) IgniteInClosure(org.apache.ignite.lang.IgniteInClosure) INACTIVE(org.apache.ignite.cluster.ClusterState.INACTIVE) GridClientFactory(org.apache.ignite.internal.client.GridClientFactory) CommandHandler(org.apache.ignite.internal.commandline.CommandHandler) IgniteCheckedException(org.apache.ignite.IgniteCheckedException) VisorFindAndDeleteGarbageInPersistenceTaskResult(org.apache.ignite.internal.visor.cache.VisorFindAndDeleteGarbageInPersistenceTaskResult) Set(java.util.Set) ChangeGlobalStateFinishMessage(org.apache.ignite.internal.processors.cluster.ChangeGlobalStateFinishMessage) READ_COMMITTED(org.apache.ignite.transactions.TransactionIsolation.READ_COMMITTED) MASTER_KEY_NAME_2(org.apache.ignite.internal.encryption.AbstractEncryptionTest.MASTER_KEY_NAME_2) IgniteCache(org.apache.ignite.IgniteCache) EXIT_CODE_CONNECTION_FAILED(org.apache.ignite.internal.commandline.CommandHandler.EXIT_CODE_CONNECTION_FAILED) Serializable(java.io.Serializable) CountDownLatch(java.util.concurrent.CountDownLatch) IgniteConfiguration(org.apache.ignite.configuration.IgniteConfiguration) READ_ONLY_SAFE(org.apache.ignite.cache.PartitionLossPolicy.READ_ONLY_SAFE) REENCRYPTION_SUSPEND(org.apache.ignite.internal.commandline.encryption.EncryptionSubcommands.REENCRYPTION_SUSPEND) AbstractSnapshotSelfTest.doSnapshotCancellationTest(org.apache.ignite.internal.processors.cache.persistence.snapshot.AbstractSnapshotSelfTest.doSnapshotCancellationTest) PESSIMISTIC(org.apache.ignite.transactions.TransactionConcurrency.PESSIMISTIC) GridClientImpl(org.apache.ignite.internal.client.impl.GridClientImpl) GridClusterStateProcessor(org.apache.ignite.internal.processors.cluster.GridClusterStateProcessor) Message(org.apache.ignite.plugin.extensions.communication.Message) GridCacheContext(org.apache.ignite.internal.processors.cache.GridCacheContext) TcpCommunicationSpi(org.apache.ignite.spi.communication.tcp.TcpCommunicationSpi) IgniteBiPredicate(org.apache.ignite.lang.IgniteBiPredicate) ClusterState(org.apache.ignite.cluster.ClusterState) U(org.apache.ignite.internal.util.typedef.internal.U) CACHE_GROUP_KEY_IDS(org.apache.ignite.internal.commandline.encryption.EncryptionSubcommands.CACHE_GROUP_KEY_IDS) EntryProcessorException(javax.cache.processor.EntryProcessorException) EXIT_CODE_OK(org.apache.ignite.internal.commandline.CommandHandler.EXIT_CODE_OK) TreeSet(java.util.TreeSet) ArrayList(java.util.ArrayList) REENCRYPTION_RATE(org.apache.ignite.internal.commandline.encryption.EncryptionSubcommands.REENCRYPTION_RATE) GridCacheDatabaseSharedManager(org.apache.ignite.internal.processors.cache.persistence.GridCacheDatabaseSharedManager) ClusterNode(org.apache.ignite.cluster.ClusterNode) BlockedWarmUpStrategy(org.apache.ignite.internal.processors.cache.warmup.BlockedWarmUpStrategy) ACTIVE_READ_ONLY(org.apache.ignite.cluster.ClusterState.ACTIVE_READ_ONLY) IgniteInternalTx(org.apache.ignite.internal.processors.cache.transactions.IgniteInternalTx) ThreadLocalRandom(java.util.concurrent.ThreadLocalRandom) IgniteInterruptedCheckedException(org.apache.ignite.internal.IgniteInterruptedCheckedException) REENCRYPTION_STATUS(org.apache.ignite.internal.commandline.encryption.EncryptionSubcommands.REENCRYPTION_STATUS) ACTIVE(org.apache.ignite.cluster.ClusterState.ACTIVE) DEFAULT_TARGET_FOLDER(org.apache.ignite.internal.processors.diagnostic.DiagnosticProcessor.DEFAULT_TARGET_FOLDER) Files(java.nio.file.Files) IOException(java.io.IOException) IgniteSnapshotManager(org.apache.ignite.internal.processors.cache.persistence.snapshot.IgniteSnapshotManager) VisorTxTaskResult(org.apache.ignite.internal.visor.tx.VisorTxTaskResult) Test(org.junit.Test) Ignite(org.apache.ignite.Ignite) Field(java.lang.reflect.Field) BaselineNode(org.apache.ignite.cluster.BaselineNode) File(java.io.File) TRANSACTIONAL(org.apache.ignite.cache.CacheAtomicityMode.TRANSACTIONAL) IgniteTxEntry(org.apache.ignite.internal.processors.cache.transactions.IgniteTxEntry) GridNearLockResponse(org.apache.ignite.internal.processors.cache.distributed.near.GridNearLockResponse) WithSystemProperty(org.apache.ignite.testframework.junits.WithSystemProperty) AtomicLong(java.util.concurrent.atomic.AtomicLong) TransactionRollbackException(org.apache.ignite.transactions.TransactionRollbackException) TreeMap(java.util.TreeMap) Paths(java.nio.file.Paths) CacheConfiguration(org.apache.ignite.configuration.CacheConfiguration) IgniteFinishedFutureImpl(org.apache.ignite.internal.util.future.IgniteFinishedFutureImpl) IgniteDataStreamer(org.apache.ignite.IgniteDataStreamer) LongMetric(org.apache.ignite.spi.metric.LongMetric) IgniteUuid(org.apache.ignite.lang.IgniteUuid) IgniteInternalFuture(org.apache.ignite.internal.IgniteInternalFuture) IgniteAtomicSequence(org.apache.ignite.IgniteAtomicSequence) CheckpointState(org.apache.ignite.internal.processors.cache.persistence.CheckpointState) GridNearTxFinishRequest(org.apache.ignite.internal.processors.cache.distributed.near.GridNearTxFinishRequest) SNAPSHOT_METRICS(org.apache.ignite.internal.processors.cache.persistence.snapshot.IgniteSnapshotManager.SNAPSHOT_METRICS) IgniteNodeAttributes(org.apache.ignite.internal.IgniteNodeAttributes) Transaction(org.apache.ignite.transactions.Transaction) CONFIRM_MSG(org.apache.ignite.internal.commandline.CommandHandler.CONFIRM_MSG) GridTestUtils.assertThrows(org.apache.ignite.testframework.GridTestUtils.assertThrows) IgniteEx(org.apache.ignite.internal.IgniteEx) RendezvousAffinityFunction(org.apache.ignite.cache.affinity.rendezvous.RendezvousAffinityFunction) MutableEntry(javax.cache.processor.MutableEntry) CHANGE_CACHE_GROUP_KEY(org.apache.ignite.internal.commandline.encryption.EncryptionSubcommands.CHANGE_CACHE_GROUP_KEY) AtomicInteger(java.util.concurrent.atomic.AtomicInteger) X(org.apache.ignite.internal.util.typedef.X) PARTITIONED(org.apache.ignite.cache.CacheMode.PARTITIONED) TestStorageUtils.corruptDataEntry(org.apache.ignite.util.TestStorageUtils.corruptDataEntry) DEACTIVATE(org.apache.ignite.internal.commandline.CommandList.DEACTIVATE) IgniteFuture(org.apache.ignite.lang.IgniteFuture) File.separatorChar(java.io.File.separatorChar) Collection(java.util.Collection) IgniteException(org.apache.ignite.IgniteException) OPTIMISTIC(org.apache.ignite.transactions.TransactionConcurrency.OPTIMISTIC) UUID(java.util.UUID) TransactionProxyImpl(org.apache.ignite.internal.processors.cache.transactions.TransactionProxyImpl) IGNITE_CLUSTER_NAME(org.apache.ignite.IgniteSystemProperties.IGNITE_CLUSTER_NAME) Collectors(java.util.stream.Collectors) GridIoMessage(org.apache.ignite.internal.managers.communication.GridIoMessage) GRID_NOT_IDLE_MSG(org.apache.ignite.internal.processors.cache.verify.IdleVerifyUtility.GRID_NOT_IDLE_MSG) GridTestUtils(org.apache.ignite.testframework.GridTestUtils) Nullable(org.jetbrains.annotations.Nullable) List(java.util.List) EVT_NODE_FAILED(org.apache.ignite.events.EventType.EVT_NODE_FAILED) CU(org.apache.ignite.internal.util.typedef.internal.CU) Pattern(java.util.regex.Pattern) ShutdownPolicy(org.apache.ignite.ShutdownPolicy) TestRecordingCommunicationSpi(org.apache.ignite.internal.TestRecordingCommunicationSpi) ClusterStateTestUtils(org.apache.ignite.internal.processors.cache.ClusterStateTestUtils) NotNull(org.jetbrains.annotations.NotNull) IdleVerifyResultV2(org.apache.ignite.internal.processors.cache.verify.IdleVerifyResultV2) GridJobExecuteResponse(org.apache.ignite.internal.GridJobExecuteResponse) GridCacheEntryEx(org.apache.ignite.internal.processors.cache.GridCacheEntryEx) IntStream(java.util.stream.IntStream) LongAdder(java.util.concurrent.atomic.LongAdder) GridTestUtils.waitForCondition(org.apache.ignite.testframework.GridTestUtils.waitForCondition) AtomicBoolean(java.util.concurrent.atomic.AtomicBoolean) IgniteSnapshotManager.resolveSnapshotWorkDirectory(org.apache.ignite.internal.processors.cache.persistence.snapshot.IgniteSnapshotManager.resolveSnapshotWorkDirectory) HashMap(java.util.HashMap) Function(java.util.function.Function) WarmUpTestPluginProvider(org.apache.ignite.internal.processors.cache.warmup.WarmUpTestPluginProvider) ToFileDumpProcessor(org.apache.ignite.internal.processors.cache.persistence.diagnostic.pagelocktracker.dumpprocessors.ToFileDumpProcessor) IgnitePredicate(org.apache.ignite.lang.IgnitePredicate) FileIOFactory(org.apache.ignite.internal.processors.cache.persistence.file.FileIOFactory) IGNITE_PDS_SKIP_CHECKPOINT_ON_NODE_STOP(org.apache.ignite.internal.processors.cache.persistence.GridCacheDatabaseSharedManager.IGNITE_PDS_SKIP_CHECKPOINT_ON_NODE_STOP) G(org.apache.ignite.internal.util.typedef.G) F(org.apache.ignite.internal.util.typedef.F) GridNearTxLocal(org.apache.ignite.internal.processors.cache.distributed.near.GridNearTxLocal) OpenOption(java.nio.file.OpenOption) AbstractSnapshotSelfTest.snp(org.apache.ignite.internal.processors.cache.persistence.snapshot.AbstractSnapshotSelfTest.snp) FindAndDeleteGarbageArg(org.apache.ignite.internal.commandline.cache.argument.FindAndDeleteGarbageArg) FULL_SYNC(org.apache.ignite.cache.CacheWriteSynchronizationMode.FULL_SYNC) EXIT_CODE_UNEXPECTED_ERROR(org.apache.ignite.internal.commandline.CommandHandler.EXIT_CODE_UNEXPECTED_ERROR) GridTestUtils.assertContains(org.apache.ignite.testframework.GridTestUtils.assertContains) TimeUnit(java.util.concurrent.TimeUnit) BitSet(java.util.BitSet) Collections(java.util.Collections) DataRegionConfiguration(org.apache.ignite.configuration.DataRegionConfiguration) TransactionTimeoutException(org.apache.ignite.transactions.TransactionTimeoutException) IgniteEx(org.apache.ignite.internal.IgniteEx) RandomAccessFile(java.io.RandomAccessFile) File(java.io.File) IgniteCacheGroupsWithRestartsTest(org.apache.ignite.internal.processors.cache.persistence.db.IgniteCacheGroupsWithRestartsTest) AbstractSnapshotSelfTest.doSnapshotCancellationTest(org.apache.ignite.internal.processors.cache.persistence.snapshot.AbstractSnapshotSelfTest.doSnapshotCancellationTest) Test(org.junit.Test)

Example 10 with EXIT_CODE_OK

use of org.apache.ignite.internal.commandline.CommandHandler.EXIT_CODE_OK in project ignite by apache.

the class GridCommandHandlerTest method testPersistenceCleanSpecifiedCachesCommand.

/**
 * Test verifies persistence clean command with explicit list of caches to be cleaned.
 *
 * @throws Exception If failed.
 */
@Test
public void testPersistenceCleanSpecifiedCachesCommand() throws Exception {
    String cacheName0 = DEFAULT_CACHE_NAME + "0";
    String cacheName1 = DEFAULT_CACHE_NAME + "1";
    String cacheName2 = DEFAULT_CACHE_NAME + "2";
    String cacheName3 = DEFAULT_CACHE_NAME + "3";
    String nonExistingCacheName = DEFAULT_CACHE_NAME + "4";
    File mntcNodeWorkDir = startGridAndPutNodeToMaintenance(new CacheConfiguration[] { cacheConfiguration(cacheName0), cacheConfiguration(cacheName1), cacheConfiguration(cacheName2), cacheConfiguration(cacheName3) }, s -> !s.equals(cacheName3));
    IgniteEx ig1 = startGrid(1);
    String port = ig1.localNode().attribute(IgniteNodeAttributes.ATTR_REST_TCP_PORT).toString();
    assertEquals(EXIT_CODE_INVALID_ARGUMENTS, execute("--persistence", "clean", "caches", nonExistingCacheName, "--host", "localhost", "--port", port));
    assertEquals(EXIT_CODE_OK, execute("--persistence", "clean", "caches", cacheName0 + "," + cacheName1, "--host", "localhost", "--port", port));
    boolean cleanedEmpty = Arrays.stream(mntcNodeWorkDir.listFiles()).filter(f -> f.getName().contains(cacheName0) || f.getName().contains(cacheName1)).map(f -> f.listFiles().length == 1).reduce(true, (t, u) -> t && u);
    assertTrue(cleanedEmpty);
    boolean nonCleanedNonEmpty = Arrays.stream(mntcNodeWorkDir.listFiles()).filter(f -> f.getName().contains(cacheName2) || f.getName().contains(cacheName3)).map(f -> f.listFiles().length > 1).reduce(true, (t, u) -> t && u);
    assertTrue(nonCleanedNonEmpty);
    stopGrid(1);
    ig1 = startGrid(1);
    assertTrue(ig1.context().maintenanceRegistry().isMaintenanceMode());
    assertEquals(EXIT_CODE_OK, execute("--persistence", "clean", "caches", cacheName2, "--host", "localhost", "--port", port));
    stopGrid(1);
    ig1 = startGrid(1);
    assertFalse(ig1.context().maintenanceRegistry().isMaintenanceMode());
}
Also used : RandomAccessFile(java.io.RandomAccessFile) BlockedWarmUpConfiguration(org.apache.ignite.internal.processors.cache.warmup.BlockedWarmUpConfiguration) Arrays(java.util.Arrays) GridCacheMvccCandidate(org.apache.ignite.internal.processors.cache.GridCacheMvccCandidate) EVT_NODE_LEFT(org.apache.ignite.events.EventType.EVT_NODE_LEFT) UnaryOperator(java.util.function.UnaryOperator) GridConcurrentHashSet(org.apache.ignite.internal.client.util.GridConcurrentHashSet) EntryProcessor(javax.cache.processor.EntryProcessor) BooleanSupplier(java.util.function.BooleanSupplier) GridFunc(org.apache.ignite.internal.util.lang.GridFunc) GridTestUtils.runAsync(org.apache.ignite.testframework.GridTestUtils.runAsync) FileIO(org.apache.ignite.internal.processors.cache.persistence.file.FileIO) REENCRYPTION_RESUME(org.apache.ignite.internal.commandline.encryption.EncryptionSubcommands.REENCRYPTION_RESUME) Matcher(java.util.regex.Matcher) EXIT_CODE_INVALID_ARGUMENTS(org.apache.ignite.internal.commandline.CommandHandler.EXIT_CODE_INVALID_ARGUMENTS) Map(java.util.Map) GridAbsPredicate(org.apache.ignite.internal.util.lang.GridAbsPredicate) Path(java.nio.file.Path) GridDhtTxFinishRequest(org.apache.ignite.internal.processors.cache.distributed.dht.GridDhtTxFinishRequest) VisorTxInfo(org.apache.ignite.internal.visor.tx.VisorTxInfo) IgniteCacheGroupsWithRestartsTest(org.apache.ignite.internal.processors.cache.persistence.db.IgniteCacheGroupsWithRestartsTest) IgniteInClosure(org.apache.ignite.lang.IgniteInClosure) INACTIVE(org.apache.ignite.cluster.ClusterState.INACTIVE) GridClientFactory(org.apache.ignite.internal.client.GridClientFactory) CommandHandler(org.apache.ignite.internal.commandline.CommandHandler) IgniteCheckedException(org.apache.ignite.IgniteCheckedException) VisorFindAndDeleteGarbageInPersistenceTaskResult(org.apache.ignite.internal.visor.cache.VisorFindAndDeleteGarbageInPersistenceTaskResult) Set(java.util.Set) ChangeGlobalStateFinishMessage(org.apache.ignite.internal.processors.cluster.ChangeGlobalStateFinishMessage) READ_COMMITTED(org.apache.ignite.transactions.TransactionIsolation.READ_COMMITTED) MASTER_KEY_NAME_2(org.apache.ignite.internal.encryption.AbstractEncryptionTest.MASTER_KEY_NAME_2) IgniteCache(org.apache.ignite.IgniteCache) EXIT_CODE_CONNECTION_FAILED(org.apache.ignite.internal.commandline.CommandHandler.EXIT_CODE_CONNECTION_FAILED) Serializable(java.io.Serializable) CountDownLatch(java.util.concurrent.CountDownLatch) IgniteConfiguration(org.apache.ignite.configuration.IgniteConfiguration) READ_ONLY_SAFE(org.apache.ignite.cache.PartitionLossPolicy.READ_ONLY_SAFE) REENCRYPTION_SUSPEND(org.apache.ignite.internal.commandline.encryption.EncryptionSubcommands.REENCRYPTION_SUSPEND) AbstractSnapshotSelfTest.doSnapshotCancellationTest(org.apache.ignite.internal.processors.cache.persistence.snapshot.AbstractSnapshotSelfTest.doSnapshotCancellationTest) PESSIMISTIC(org.apache.ignite.transactions.TransactionConcurrency.PESSIMISTIC) GridClientImpl(org.apache.ignite.internal.client.impl.GridClientImpl) GridClusterStateProcessor(org.apache.ignite.internal.processors.cluster.GridClusterStateProcessor) Message(org.apache.ignite.plugin.extensions.communication.Message) GridCacheContext(org.apache.ignite.internal.processors.cache.GridCacheContext) TcpCommunicationSpi(org.apache.ignite.spi.communication.tcp.TcpCommunicationSpi) IgniteBiPredicate(org.apache.ignite.lang.IgniteBiPredicate) ClusterState(org.apache.ignite.cluster.ClusterState) U(org.apache.ignite.internal.util.typedef.internal.U) CACHE_GROUP_KEY_IDS(org.apache.ignite.internal.commandline.encryption.EncryptionSubcommands.CACHE_GROUP_KEY_IDS) EntryProcessorException(javax.cache.processor.EntryProcessorException) EXIT_CODE_OK(org.apache.ignite.internal.commandline.CommandHandler.EXIT_CODE_OK) TreeSet(java.util.TreeSet) ArrayList(java.util.ArrayList) REENCRYPTION_RATE(org.apache.ignite.internal.commandline.encryption.EncryptionSubcommands.REENCRYPTION_RATE) GridCacheDatabaseSharedManager(org.apache.ignite.internal.processors.cache.persistence.GridCacheDatabaseSharedManager) ClusterNode(org.apache.ignite.cluster.ClusterNode) BlockedWarmUpStrategy(org.apache.ignite.internal.processors.cache.warmup.BlockedWarmUpStrategy) ACTIVE_READ_ONLY(org.apache.ignite.cluster.ClusterState.ACTIVE_READ_ONLY) IgniteInternalTx(org.apache.ignite.internal.processors.cache.transactions.IgniteInternalTx) ThreadLocalRandom(java.util.concurrent.ThreadLocalRandom) IgniteInterruptedCheckedException(org.apache.ignite.internal.IgniteInterruptedCheckedException) REENCRYPTION_STATUS(org.apache.ignite.internal.commandline.encryption.EncryptionSubcommands.REENCRYPTION_STATUS) ACTIVE(org.apache.ignite.cluster.ClusterState.ACTIVE) DEFAULT_TARGET_FOLDER(org.apache.ignite.internal.processors.diagnostic.DiagnosticProcessor.DEFAULT_TARGET_FOLDER) Files(java.nio.file.Files) IOException(java.io.IOException) IgniteSnapshotManager(org.apache.ignite.internal.processors.cache.persistence.snapshot.IgniteSnapshotManager) VisorTxTaskResult(org.apache.ignite.internal.visor.tx.VisorTxTaskResult) Test(org.junit.Test) Ignite(org.apache.ignite.Ignite) Field(java.lang.reflect.Field) BaselineNode(org.apache.ignite.cluster.BaselineNode) File(java.io.File) TRANSACTIONAL(org.apache.ignite.cache.CacheAtomicityMode.TRANSACTIONAL) IgniteTxEntry(org.apache.ignite.internal.processors.cache.transactions.IgniteTxEntry) GridNearLockResponse(org.apache.ignite.internal.processors.cache.distributed.near.GridNearLockResponse) WithSystemProperty(org.apache.ignite.testframework.junits.WithSystemProperty) AtomicLong(java.util.concurrent.atomic.AtomicLong) TransactionRollbackException(org.apache.ignite.transactions.TransactionRollbackException) TreeMap(java.util.TreeMap) Paths(java.nio.file.Paths) CacheConfiguration(org.apache.ignite.configuration.CacheConfiguration) IgniteFinishedFutureImpl(org.apache.ignite.internal.util.future.IgniteFinishedFutureImpl) IgniteDataStreamer(org.apache.ignite.IgniteDataStreamer) LongMetric(org.apache.ignite.spi.metric.LongMetric) IgniteUuid(org.apache.ignite.lang.IgniteUuid) IgniteInternalFuture(org.apache.ignite.internal.IgniteInternalFuture) IgniteAtomicSequence(org.apache.ignite.IgniteAtomicSequence) CheckpointState(org.apache.ignite.internal.processors.cache.persistence.CheckpointState) GridNearTxFinishRequest(org.apache.ignite.internal.processors.cache.distributed.near.GridNearTxFinishRequest) SNAPSHOT_METRICS(org.apache.ignite.internal.processors.cache.persistence.snapshot.IgniteSnapshotManager.SNAPSHOT_METRICS) IgniteNodeAttributes(org.apache.ignite.internal.IgniteNodeAttributes) Transaction(org.apache.ignite.transactions.Transaction) CONFIRM_MSG(org.apache.ignite.internal.commandline.CommandHandler.CONFIRM_MSG) GridTestUtils.assertThrows(org.apache.ignite.testframework.GridTestUtils.assertThrows) IgniteEx(org.apache.ignite.internal.IgniteEx) RendezvousAffinityFunction(org.apache.ignite.cache.affinity.rendezvous.RendezvousAffinityFunction) MutableEntry(javax.cache.processor.MutableEntry) CHANGE_CACHE_GROUP_KEY(org.apache.ignite.internal.commandline.encryption.EncryptionSubcommands.CHANGE_CACHE_GROUP_KEY) AtomicInteger(java.util.concurrent.atomic.AtomicInteger) X(org.apache.ignite.internal.util.typedef.X) PARTITIONED(org.apache.ignite.cache.CacheMode.PARTITIONED) TestStorageUtils.corruptDataEntry(org.apache.ignite.util.TestStorageUtils.corruptDataEntry) DEACTIVATE(org.apache.ignite.internal.commandline.CommandList.DEACTIVATE) IgniteFuture(org.apache.ignite.lang.IgniteFuture) File.separatorChar(java.io.File.separatorChar) Collection(java.util.Collection) IgniteException(org.apache.ignite.IgniteException) OPTIMISTIC(org.apache.ignite.transactions.TransactionConcurrency.OPTIMISTIC) UUID(java.util.UUID) TransactionProxyImpl(org.apache.ignite.internal.processors.cache.transactions.TransactionProxyImpl) IGNITE_CLUSTER_NAME(org.apache.ignite.IgniteSystemProperties.IGNITE_CLUSTER_NAME) Collectors(java.util.stream.Collectors) GridIoMessage(org.apache.ignite.internal.managers.communication.GridIoMessage) GRID_NOT_IDLE_MSG(org.apache.ignite.internal.processors.cache.verify.IdleVerifyUtility.GRID_NOT_IDLE_MSG) GridTestUtils(org.apache.ignite.testframework.GridTestUtils) Nullable(org.jetbrains.annotations.Nullable) List(java.util.List) EVT_NODE_FAILED(org.apache.ignite.events.EventType.EVT_NODE_FAILED) CU(org.apache.ignite.internal.util.typedef.internal.CU) Pattern(java.util.regex.Pattern) ShutdownPolicy(org.apache.ignite.ShutdownPolicy) TestRecordingCommunicationSpi(org.apache.ignite.internal.TestRecordingCommunicationSpi) ClusterStateTestUtils(org.apache.ignite.internal.processors.cache.ClusterStateTestUtils) NotNull(org.jetbrains.annotations.NotNull) IdleVerifyResultV2(org.apache.ignite.internal.processors.cache.verify.IdleVerifyResultV2) GridJobExecuteResponse(org.apache.ignite.internal.GridJobExecuteResponse) GridCacheEntryEx(org.apache.ignite.internal.processors.cache.GridCacheEntryEx) IntStream(java.util.stream.IntStream) LongAdder(java.util.concurrent.atomic.LongAdder) GridTestUtils.waitForCondition(org.apache.ignite.testframework.GridTestUtils.waitForCondition) AtomicBoolean(java.util.concurrent.atomic.AtomicBoolean) IgniteSnapshotManager.resolveSnapshotWorkDirectory(org.apache.ignite.internal.processors.cache.persistence.snapshot.IgniteSnapshotManager.resolveSnapshotWorkDirectory) HashMap(java.util.HashMap) Function(java.util.function.Function) WarmUpTestPluginProvider(org.apache.ignite.internal.processors.cache.warmup.WarmUpTestPluginProvider) ToFileDumpProcessor(org.apache.ignite.internal.processors.cache.persistence.diagnostic.pagelocktracker.dumpprocessors.ToFileDumpProcessor) IgnitePredicate(org.apache.ignite.lang.IgnitePredicate) FileIOFactory(org.apache.ignite.internal.processors.cache.persistence.file.FileIOFactory) IGNITE_PDS_SKIP_CHECKPOINT_ON_NODE_STOP(org.apache.ignite.internal.processors.cache.persistence.GridCacheDatabaseSharedManager.IGNITE_PDS_SKIP_CHECKPOINT_ON_NODE_STOP) G(org.apache.ignite.internal.util.typedef.G) F(org.apache.ignite.internal.util.typedef.F) GridNearTxLocal(org.apache.ignite.internal.processors.cache.distributed.near.GridNearTxLocal) OpenOption(java.nio.file.OpenOption) AbstractSnapshotSelfTest.snp(org.apache.ignite.internal.processors.cache.persistence.snapshot.AbstractSnapshotSelfTest.snp) FindAndDeleteGarbageArg(org.apache.ignite.internal.commandline.cache.argument.FindAndDeleteGarbageArg) FULL_SYNC(org.apache.ignite.cache.CacheWriteSynchronizationMode.FULL_SYNC) EXIT_CODE_UNEXPECTED_ERROR(org.apache.ignite.internal.commandline.CommandHandler.EXIT_CODE_UNEXPECTED_ERROR) GridTestUtils.assertContains(org.apache.ignite.testframework.GridTestUtils.assertContains) TimeUnit(java.util.concurrent.TimeUnit) BitSet(java.util.BitSet) Collections(java.util.Collections) DataRegionConfiguration(org.apache.ignite.configuration.DataRegionConfiguration) TransactionTimeoutException(org.apache.ignite.transactions.TransactionTimeoutException) IgniteEx(org.apache.ignite.internal.IgniteEx) RandomAccessFile(java.io.RandomAccessFile) File(java.io.File) IgniteCacheGroupsWithRestartsTest(org.apache.ignite.internal.processors.cache.persistence.db.IgniteCacheGroupsWithRestartsTest) AbstractSnapshotSelfTest.doSnapshotCancellationTest(org.apache.ignite.internal.processors.cache.persistence.snapshot.AbstractSnapshotSelfTest.doSnapshotCancellationTest) Test(org.junit.Test)

Aggregations

IgniteEx (org.apache.ignite.internal.IgniteEx)15 EXIT_CODE_OK (org.apache.ignite.internal.commandline.CommandHandler.EXIT_CODE_OK)15 Test (org.junit.Test)15 List (java.util.List)14 IgniteCache (org.apache.ignite.IgniteCache)14 Arrays (java.util.Arrays)13 CountDownLatch (java.util.concurrent.CountDownLatch)13 Ignite (org.apache.ignite.Ignite)13 CommandHandler (org.apache.ignite.internal.commandline.CommandHandler)13 ArrayList (java.util.ArrayList)12 Collections (java.util.Collections)12 AtomicInteger (java.util.concurrent.atomic.AtomicInteger)12 Pattern (java.util.regex.Pattern)12 IgniteDataStreamer (org.apache.ignite.IgniteDataStreamer)12 IgniteConfiguration (org.apache.ignite.configuration.IgniteConfiguration)12 IgniteInternalFuture (org.apache.ignite.internal.IgniteInternalFuture)12 EXIT_CODE_INVALID_ARGUMENTS (org.apache.ignite.internal.commandline.CommandHandler.EXIT_CODE_INVALID_ARGUMENTS)12 Collection (java.util.Collection)11 Map (java.util.Map)11 UUID (java.util.UUID)11