Search in sources :

Example 91 with Files

use of java.nio.file.Files in project alluxio by Alluxio.

the class ProcessLauncherTest method testCreateProcwithMock.

void testCreateProcwithMock(Process mockedProcess) throws Exception {
    InstancedConfiguration conf = getTestConfig();
    conf.set(PropertyKey.HOME, "/path/to/non/existent/directory");
    try (MockedStatic<Files> files = Mockito.mockStatic(Files.class)) {
        files.when(() -> Files.exists(ArgumentMatchers.any())).thenReturn(true);
        ProcessLauncher l = new ProcessLauncher(getTestConfig());
        try (MockedStatic<Runtime> runtimeMock = Mockito.mockStatic(Runtime.class)) {
            Runtime mockedRuntime = mock(Runtime.class);
            runtimeMock.when(Runtime::getRuntime).thenReturn(mockedRuntime);
            for (AlluxioNodeType t : AlluxioNodeType.values()) {
                doReturn(mockedProcess).when(mockedRuntime).exec(ArgumentMatchers.any(String.class));
                l.start(t);
                verify(mockedRuntime).exec(ArgumentMatchers.contains("alluxio-start.sh " + t.toString().toLowerCase()));
            }
        }
    }
}
Also used : InstancedConfiguration(alluxio.conf.InstancedConfiguration) Files(java.nio.file.Files) AlluxioNodeType(alluxio.hub.proto.AlluxioNodeType)

Example 92 with Files

use of java.nio.file.Files in project alluxio by Alluxio.

the class AgentManagerService method listCatalogs.

@Override
public void listCatalogs(alluxio.hub.proto.AgentListCatalogRequest request, io.grpc.stub.StreamObserver<alluxio.hub.proto.AgentListCatalogResponse> responseObserver) {
    RpcUtils.call(LOG, () -> {
        AgentListCatalogResponse.Builder res = AgentListCatalogResponse.newBuilder();
        Path searchPath = Paths.get(request.getConfDir(), "catalog");
        if (!Files.isDirectory(searchPath)) {
            return res.build();
        }
        Files.list(searchPath).filter(Files::isReadable).filter(Files::isRegularFile).filter(p -> Optional.ofNullable(p.getFileName()).map(Objects::toString).orElse("").endsWith(".properties")).map(p -> {
            String filename = Optional.ofNullable(p.getFileName()).map(Objects::toString).orElse("");
            String name = Optional.ofNullable(p.getFileName()).map(Objects::toString).orElse("").substring(0, filename.indexOf(".properties"));
            try {
                Properties catalogProps = new Properties();
                try (Reader reader = Files.newBufferedReader(p)) {
                    catalogProps.load(reader);
                }
                String metastoreUri = catalogProps.getProperty("hive.metastore.uri");
                if (metastoreUri == null) {
                    // not a hive metastore.
                    return null;
                }
                return PrestoCatalogListing.newBuilder().setCatalogName(name).setHiveMetastoreUri(metastoreUri).build();
            } catch (IOException e) {
                LOG.warn("Failed to presto catalog file read file {}", p);
                return null;
            }
        }).filter(Objects::nonNull).forEach(res::addCatalog);
        return res.build();
    }, "listCatalogs", "current catalogs in the presto configuration directory", responseObserver);
}
Also used : Path(java.nio.file.Path) AgentListFileResponse(alluxio.hub.proto.AgentListFileResponse) AgentShutdownRequest(alluxio.hub.proto.AgentShutdownRequest) AgentShutdownResponse(alluxio.hub.proto.AgentShutdownResponse) AgentGetConfigurationSetResponse(alluxio.hub.proto.AgentGetConfigurationSetResponse) LoggerFactory(org.slf4j.LoggerFactory) TimeoutException(java.util.concurrent.TimeoutException) ValidationResult(alluxio.hub.proto.ValidationResult) AgentManagerServiceGrpc(alluxio.hub.proto.AgentManagerServiceGrpc) AgentListCatalogResponse(alluxio.hub.proto.AgentListCatalogResponse) AlluxioNodeType(alluxio.hub.proto.AlluxioNodeType) AgentListFileInfo(alluxio.hub.proto.AgentListFileInfo) AgentRemoveFileResponse(alluxio.hub.proto.AgentRemoveFileResponse) StreamObserver(io.grpc.stub.StreamObserver) AgentFileUploadResponse(alluxio.hub.proto.AgentFileUploadResponse) AgentDetectPrestoRequest(alluxio.hub.proto.AgentDetectPrestoRequest) AlluxioStatusException(alluxio.exception.status.AlluxioStatusException) RpcUtils(alluxio.RpcUtils) Path(java.nio.file.Path) CompletableFuture(alluxio.concurrent.jsr.CompletableFuture) AgentWriteConfigurationSetRequest(alluxio.hub.proto.AgentWriteConfigurationSetRequest) Logger(org.slf4j.Logger) Properties(java.util.Properties) AgentValidatePrestoConfRequest(alluxio.hub.proto.AgentValidatePrestoConfRequest) Files(java.nio.file.Files) AgentDetectPrestoResponse(alluxio.hub.proto.AgentDetectPrestoResponse) AgentProcessStatusChangeResponse(alluxio.hub.proto.AgentProcessStatusChangeResponse) AgentRemoveFileRequest(alluxio.hub.proto.AgentRemoveFileRequest) PrestoCatalogListing(alluxio.hub.proto.PrestoCatalogListing) Set(java.util.Set) IOException(java.io.IOException) AgentWriteConfigurationSetResponse(alluxio.hub.proto.AgentWriteConfigurationSetResponse) Reader(java.io.Reader) AgentProcessContext(alluxio.hub.agent.process.AgentProcessContext) Objects(java.util.Objects) TimeUnit(java.util.concurrent.TimeUnit) AgentGetConfigurationSetRequest(alluxio.hub.proto.AgentGetConfigurationSetRequest) AgentProcessStatusChangeRequest(alluxio.hub.proto.AgentProcessStatusChangeRequest) List(java.util.List) Paths(java.nio.file.Paths) AgentSetPrestoConfRequest(alluxio.hub.proto.AgentSetPrestoConfRequest) Optional(java.util.Optional) Preconditions(com.google.common.base.Preconditions) AgentFileUploadRequest(alluxio.hub.proto.AgentFileUploadRequest) AgentListFileRequest(alluxio.hub.proto.AgentListFileRequest) ValidationStatus(alluxio.hub.proto.ValidationStatus) Collections(java.util.Collections) AgentValidatePrestoConfResponse(alluxio.hub.proto.AgentValidatePrestoConfResponse) AgentSetPrestoConfResponse(alluxio.hub.proto.AgentSetPrestoConfResponse) AgentListCatalogResponse(alluxio.hub.proto.AgentListCatalogResponse) Objects(java.util.Objects) Reader(java.io.Reader) IOException(java.io.IOException) Files(java.nio.file.Files) Properties(java.util.Properties)

Example 93 with Files

use of java.nio.file.Files in project RecurrentComplex by Ivorforce.

the class CommandSanity method execute.

@Override
public void execute(MinecraftServer server, ICommandSender commandSender, String[] args) throws CommandException {
    Parameters parameters = Parameters.of(args, expect()::declare);
    boolean sane = true;
    if (RecurrentComplex.isLite()) {
        commandSender.sendMessage(new TextComponentString("Recurrent Complex is in lightweight mode!"));
    }
    if (StructureRegistry.INSTANCE.ids().isEmpty()) {
        commandSender.sendMessage(new TextComponentString("No registered structures!"));
        sane = false;
    }
    if (!Files.isReadable(ResourceDirectory.getCustomDirectory().toPath())) {
        commandSender.sendMessage(new TextComponentString("Can't read files from custom directory"));
        sane = false;
    }
    for (ModContainer mod : Loader.instance().getModList()) {
        String domain = mod.getModId();
        Path path = null;
        try {
            path = RCFiles.pathFromResourceLocation(new ResourceLocation(domain.toLowerCase(), ""));
            if (path != null && !Files.isReadable(path)) {
                commandSender.sendMessage(new TextComponentString("Can't read files from mod: " + mod.getModId()));
                sane = false;
            }
        } catch (RCFiles.ResourceLocationLoadException e) {
            RecurrentComplex.logger.error(e);
            commandSender.sendMessage(new TextComponentString("Error reading files from mod " + mod.getModId() + ": "));
            commandSender.sendMessage(new TextComponentString(RCCommands.reason(e)));
            sane = false;
        } finally {
            if (path != null)
                RCFiles.closeQuietly(path.getFileSystem());
        }
    }
    if (!Files.isReadable(ResourceDirectory.getServerDirectory().toPath())) {
        commandSender.sendMessage(new TextComponentString("Can't read files from server directory"));
        sane = false;
    }
    if (!parameters.has("short")) {
        sane &= addStructureLog(commandSender, (s, structure) -> !structure.generationTypes(GenerationType.class).isEmpty(), "Missing generation type");
        sane &= addGenericStructureLog(commandSender, (s, structure) -> !structure.metadata.authors.isEmpty(), "No author");
        sane &= addGenericStructureLog(commandSender, (s, structure) -> structure.transformer.getTransformers().stream().allMatch(t -> t.id().length() > 0), "Transformer has empty ID");
        sane &= addGenerationLog(commandSender, GenerationType.class, (structure, gen) -> gen.id().length() > 0, "Generation type has empty ID");
        sane &= addGenerationLog(commandSender, NaturalGeneration.class, (structure, gen) -> values(Biome.REGISTRY).anyMatch(b -> StructureSelector.generationWeightInBiome(gen.biomeWeights, b) > 0), "Natural generation type won't accept any known biomes");
        sane &= addGenerationLog(commandSender, NaturalGeneration.class, (structure, gen) -> dimensions(server).anyMatch(d -> StructureSelector.generationWeightInDimension(gen.dimensionWeights, d.provider) > 0), "Natural generation type won't accept any known dimensions");
        sane &= addGenerationLog(commandSender, NaturalGeneration.class, (structure, gen) -> gen.getActiveGenerationWeight() > 0, "Natural generation type has no weight");
        sane &= addGenerationLog(commandSender, VanillaGeneration.class, (structure, gen) -> values(Biome.REGISTRY).anyMatch(b -> gen.biomeExpression.test(b)), "Vanilla structure generation type won't accept any known biomes");
        sane &= addGenerationLog(commandSender, VanillaGeneration.class, (structure, gen) -> gen.getActiveWeight() > 0, "Vanilla structure generation type has no weight");
        sane &= addGenerationLog(commandSender, VanillaGeneration.class, (structure, gen) -> gen.minBaseLimit > 0 || gen.maxBaseLimit > 0 || gen.maxScaledLimit > 0 || gen.minScaledLimit > 0, "Vanilla structure is always limited to zero instances");
        sane &= addGenerationLog(commandSender, VanillaDecorationGeneration.class, (structure, gen) -> values(Biome.REGISTRY).anyMatch(b -> StructureSelector.generationWeightInBiome(gen.biomeWeights, b) > 0), "Vanilla structure generation type won't accept any known biomes");
        sane &= addGenerationLog(commandSender, VanillaDecorationGeneration.class, (structure, gen) -> dimensions(server).anyMatch(d -> StructureSelector.generationWeightInDimension(gen.dimensionWeights, d.provider) > 0), "Natural generation type won't accept any dimensions");
        sane &= addGenerationLog(commandSender, MazeGeneration.class, (structure, gen) -> gen.getWeight() > 0, "Maze generation type has no weight");
        sane &= addGenerationLog(commandSender, MazeGeneration.class, (structure, gen) -> !gen.getMazeID().trim().isEmpty(), "Maze generation type has maze id");
        sane &= addGenerationLog(commandSender, MazeGeneration.class, (structure, gen) -> !gen.mazeComponent.rooms.isEmpty(), "Maze generation type has no rooms");
        sane &= addGenerationLog(commandSender, MazeGeneration.class, (structure, gen) -> !gen.mazeComponent.exitPaths.isEmpty() || !gen.mazeComponent.defaultConnector.id.equals(ConnectorStrategy.DEFAULT_WALL), "Maze generation type has no walkable exits");
        sane &= addGenerationLog(commandSender, ListGeneration.class, (structure, gen) -> !gen.listID.trim().isEmpty(), "List generation has no list id");
        sane &= addGenerationLog(commandSender, ListGeneration.class, (structure, gen) -> gen.getWeight() > 0, "List generation has no weight");
        sane &= addGenerationLog(commandSender, SaplingGeneration.class, (structure, gen) -> gen.getActiveWeight() > 0, "Sapling generation has no weight");
        sane &= addGenerationLog(commandSender, StaticGeneration.class, (structure, gen) -> dimensions(server).anyMatch(d -> gen.dimensionExpression.test(d.provider)), "Static generation won't accept any known dimensions");
    }
    if (sane && !parameters.has("silent"))
        commandSender.sendMessage(new TextComponentString("No problems identified!"));
}
Also used : Path(java.nio.file.Path) GenericStructure(ivorius.reccomplex.world.gen.feature.structure.generic.GenericStructure) CommandSearchStructure(ivorius.reccomplex.commands.structure.CommandSearchStructure) ivorius.reccomplex.world.gen.feature.structure.generic.generation(ivorius.reccomplex.world.gen.feature.structure.generic.generation) Loader(net.minecraftforge.fml.common.Loader) PriorityQueue(java.util.PriorityQueue) Structure(ivorius.reccomplex.world.gen.feature.structure.Structure) StructureRegistry(ivorius.reccomplex.world.gen.feature.structure.StructureRegistry) RCConfig(ivorius.reccomplex.RCConfig) BiPredicate(java.util.function.BiPredicate) CommandException(net.minecraft.command.CommandException) MinecraftServer(net.minecraft.server.MinecraftServer) RCFiles(ivorius.reccomplex.files.RCFiles) ResourceDirectory(ivorius.reccomplex.files.loading.ResourceDirectory) RecurrentComplex(ivorius.reccomplex.RecurrentComplex) StructureSelector(ivorius.reccomplex.world.gen.feature.selector.StructureSelector) Path(java.nio.file.Path) DimensionManager(net.minecraftforge.common.DimensionManager) Files(java.nio.file.Files) World(net.minecraft.world.World) IRegistry(net.minecraft.util.registry.IRegistry) CommandExpecting(ivorius.mcopts.commands.CommandExpecting) ConnectorStrategy(ivorius.reccomplex.world.gen.feature.structure.generic.maze.ConnectorStrategy) TextComponentString(net.minecraft.util.text.TextComponentString) Expect(ivorius.mcopts.commands.parameters.expect.Expect) Stream(java.util.stream.Stream) ICommandSender(net.minecraft.command.ICommandSender) ResourceLocation(net.minecraft.util.ResourceLocation) ModContainer(net.minecraftforge.fml.common.ModContainer) Parameters(ivorius.mcopts.commands.parameters.Parameters) Biome(net.minecraft.world.biome.Biome) Parameters(ivorius.mcopts.commands.parameters.Parameters) ModContainer(net.minecraftforge.fml.common.ModContainer) TextComponentString(net.minecraft.util.text.TextComponentString) TextComponentString(net.minecraft.util.text.TextComponentString) ResourceLocation(net.minecraft.util.ResourceLocation) RCFiles(ivorius.reccomplex.files.RCFiles)

Example 94 with Files

use of java.nio.file.Files in project ignite by apache.

the class CdcMain method consumeWalSegmentsUntilStopped.

/**
 * Waits and consumes new WAL segments until stopped.
 */
public void consumeWalSegmentsUntilStopped() {
    try {
        Set<Path> seen = new HashSet<>();
        AtomicLong lastSgmnt = new AtomicLong(-1);
        while (!stopped) {
            try (Stream<Path> cdcFiles = Files.walk(cdcDir, 1)) {
                Set<Path> exists = new HashSet<>();
                cdcFiles.peek(// Store files that exists in cdc dir.
                exists::add).filter(p -> WAL_SEGMENT_FILE_FILTER.accept(p.toFile()) && !seen.contains(p)).peek(// Adds to seen.
                seen::add).sorted(// Sort by segment index.
                Comparator.comparingLong(this::segmentIndex)).peek(p -> {
                    long nextSgmnt = segmentIndex(p);
                    assert lastSgmnt.get() == -1 || nextSgmnt - lastSgmnt.get() == 1;
                    lastSgmnt.set(nextSgmnt);
                }).forEach(// Consuming segments.
                this::consumeSegment);
                // Clean up seen set.
                seen.removeIf(p -> !exists.contains(p));
            }
            if (!stopped)
                U.sleep(cdcCfg.getCheckFrequency());
        }
    } catch (IOException | IgniteInterruptedCheckedException e) {
        throw new IgniteException(e);
    }
}
Also used : Path(java.nio.file.Path) WALIterator(org.apache.ignite.internal.pagemem.wal.WALIterator) COPYRIGHT(org.apache.ignite.internal.IgniteVersionUtils.COPYRIGHT) IgniteWalIteratorFactory(org.apache.ignite.internal.processors.cache.persistence.wal.reader.IgniteWalIteratorFactory) GridSpringResourceContext(org.apache.ignite.internal.processors.resource.GridSpringResourceContext) PdsFolderSettings(org.apache.ignite.internal.processors.cache.persistence.filename.PdsFolderSettings) U(org.apache.ignite.internal.util.typedef.internal.U) IgniteLogger(org.apache.ignite.IgniteLogger) NL(org.apache.ignite.internal.IgniteKernal.NL) DATA_RECORD_V2(org.apache.ignite.internal.pagemem.wal.record.WALRecord.RecordType.DATA_RECORD_V2) WALPointer(org.apache.ignite.internal.processors.cache.persistence.wal.WALPointer) HashSet(java.util.HashSet) CdcConfiguration(org.apache.ignite.cdc.CdcConfiguration) CdcEvent(org.apache.ignite.cdc.CdcEvent) AtomicLongMetric(org.apache.ignite.internal.processors.metric.impl.AtomicLongMetric) WAL_SEGMENT_FILE_FILTER(org.apache.ignite.internal.processors.cache.persistence.wal.FileWriteAheadLogManager.WAL_SEGMENT_FILE_FILTER) DataStorageConfiguration(org.apache.ignite.configuration.DataStorageConfiguration) IgniteInterruptedCheckedException(org.apache.ignite.internal.IgniteInterruptedCheckedException) Path(java.nio.file.Path) PdsFolderResolver(org.apache.ignite.internal.processors.cache.persistence.filename.PdsFolderResolver) MetricUtils.metricName(org.apache.ignite.internal.processors.metric.impl.MetricUtils.metricName) GridLoggerProxy(org.apache.ignite.internal.GridLoggerProxy) MarshallerContextImpl(org.apache.ignite.internal.MarshallerContextImpl) F(org.apache.ignite.internal.util.typedef.F) Iterator(java.util.Iterator) Files(java.nio.file.Files) ACK_VER_STR(org.apache.ignite.internal.IgniteVersionUtils.ACK_VER_STR) IgniteCheckedException(org.apache.ignite.IgniteCheckedException) IgniteException(org.apache.ignite.IgniteException) CdcConsumer(org.apache.ignite.cdc.CdcConsumer) GridComponent(org.apache.ignite.internal.GridComponent) Set(java.util.Set) IOException(java.io.IOException) CdcCommandLineStartup(org.apache.ignite.startup.cmdline.CdcCommandLineStartup) DataRecord(org.apache.ignite.internal.pagemem.wal.record.DataRecord) MetricRegistry(org.apache.ignite.internal.processors.metric.MetricRegistry) File(java.io.File) Serializable(java.io.Serializable) CacheObjectBinaryProcessorImpl(org.apache.ignite.internal.processors.cache.binary.CacheObjectBinaryProcessorImpl) AtomicLong(java.util.concurrent.atomic.AtomicLong) IgniteConfiguration(org.apache.ignite.configuration.IgniteConfiguration) Stream(java.util.stream.Stream) StandaloneGridKernalContext(org.apache.ignite.internal.processors.cache.persistence.wal.reader.StandaloneGridKernalContext) Paths(java.nio.file.Paths) CU(org.apache.ignite.internal.util.typedef.internal.CU) IgnitionEx.initializeDefaultMBeanServer(org.apache.ignite.internal.IgnitionEx.initializeDefaultMBeanServer) Comparator(java.util.Comparator) SITE(org.apache.ignite.internal.IgniteKernal.SITE) IgniteInterruptedCheckedException(org.apache.ignite.internal.IgniteInterruptedCheckedException) AtomicLong(java.util.concurrent.atomic.AtomicLong) IgniteException(org.apache.ignite.IgniteException) IOException(java.io.IOException) HashSet(java.util.HashSet)

Example 95 with Files

use of java.nio.file.Files in project ignite by apache.

the class GridCommandHandlerTest method testDiagnosticPageLocksTracker.

/**
 * Test execution of --diagnostic command.
 *
 * @throws Exception if failed.
 */
@Test
public void testDiagnosticPageLocksTracker() throws Exception {
    Ignite ignite = startGrid(0, (UnaryOperator<IgniteConfiguration>) cfg -> cfg.setConsistentId("node0/dump"));
    startGrid(1, (UnaryOperator<IgniteConfiguration>) cfg -> cfg.setConsistentId("node1/dump"));
    startGrid(2, (UnaryOperator<IgniteConfiguration>) cfg -> cfg.setConsistentId("node2/dump"));
    startGrid(3, (UnaryOperator<IgniteConfiguration>) cfg -> cfg.setConsistentId("node3/dump"));
    Collection<ClusterNode> nodes = ignite.cluster().nodes();
    List<ClusterNode> nodes0 = new ArrayList<>(nodes);
    ClusterNode node0 = nodes0.get(0);
    ClusterNode node1 = nodes0.get(1);
    ClusterNode node2 = nodes0.get(2);
    ClusterNode node3 = nodes0.get(3);
    ignite.cluster().active(true);
    assertEquals(EXIT_CODE_OK, execute("--diagnostic"));
    assertEquals(EXIT_CODE_OK, execute("--diagnostic", "help"));
    // Dump locks only on connected node to default path.
    assertEquals(EXIT_CODE_OK, execute("--diagnostic", "pageLocks", "dump"));
    // Check file dump in default path.
    checkNumberFiles(defaultDiagnosticDir, 1);
    assertEquals(EXIT_CODE_OK, execute("--diagnostic", "pageLocks", "dump_log"));
    // Dump locks only on connected node to specific path.
    assertEquals(EXIT_CODE_OK, execute("--diagnostic", "pageLocks", "dump", "--path", customDiagnosticDir.getAbsolutePath()));
    // Check file dump in specific path.
    checkNumberFiles(customDiagnosticDir, 1);
    // Dump locks only all nodes.
    assertEquals(EXIT_CODE_OK, execute("--diagnostic", "pageLocks", "dump", "--all"));
    // Current cluster 4 nodes -> 4 files + 1 from previous operation.
    checkNumberFiles(defaultDiagnosticDir, 5);
    assertEquals(EXIT_CODE_OK, execute("--diagnostic", "pageLocks", "dump_log", "--all"));
    assertEquals(EXIT_CODE_OK, execute("--diagnostic", "pageLocks", "dump", "--path", customDiagnosticDir.getAbsolutePath(), "--all"));
    // Current cluster 4 nodes -> 4 files + 1 from previous operation.
    checkNumberFiles(customDiagnosticDir, 5);
    // Dump locks only 2 nodes use nodeIds as arg.
    assertEquals(EXIT_CODE_OK, execute("--diagnostic", "pageLocks", "dump", "--nodes", node0.id().toString() + "," + node2.id().toString()));
    // Dump locks only for 2 nodes -> 2 files + 5 from previous operation.
    checkNumberFiles(defaultDiagnosticDir, 7);
    // Dump locks only for 2 nodes use constIds as arg.
    assertEquals(EXIT_CODE_OK, execute("--diagnostic", "pageLocks", "dump", "--nodes", node0.consistentId().toString() + "," + node2.consistentId().toString()));
    assertEquals(EXIT_CODE_OK, execute("--diagnostic", "pageLocks", "dump_log", "--nodes", node1.id().toString() + "," + node3.id().toString()));
    assertEquals(EXIT_CODE_OK, execute("--diagnostic", "pageLocks", "dump", "--path", customDiagnosticDir.getAbsolutePath(), "--nodes", node1.consistentId().toString() + "," + node3.consistentId().toString()));
    // Dump locks only for 2 nodes -> 2 files + 5 from previous operation.
    checkNumberFiles(customDiagnosticDir, 7);
}
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) ClusterNode(org.apache.ignite.cluster.ClusterNode) IgniteConfiguration(org.apache.ignite.configuration.IgniteConfiguration) ArrayList(java.util.ArrayList) Ignite(org.apache.ignite.Ignite) 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

Files (java.nio.file.Files)243 IOException (java.io.IOException)210 Path (java.nio.file.Path)196 List (java.util.List)176 Collectors (java.util.stream.Collectors)154 Paths (java.nio.file.Paths)133 File (java.io.File)127 ArrayList (java.util.ArrayList)117 Map (java.util.Map)109 Set (java.util.Set)96 Collections (java.util.Collections)89 Arrays (java.util.Arrays)81 Stream (java.util.stream.Stream)77 HashMap (java.util.HashMap)74 HashSet (java.util.HashSet)58 InputStream (java.io.InputStream)55 Collection (java.util.Collection)55 Logger (org.slf4j.Logger)54 Pattern (java.util.regex.Pattern)53 Optional (java.util.Optional)51