Many resources are needed to download a project. Please understand that we have to compensate our server costs. Thank you in advance. Project price only 1 $
You can buy this project and download/modify it how often you want.
/*
* Copyright Camunda Services GmbH and/or licensed to Camunda Services GmbH under
* one or more contributor license agreements. See the NOTICE file distributed
* with this work for additional information regarding copyright ownership.
* Licensed under the Camunda License 1.0. You may not use this file
* except in compliance with the Camunda License 1.0.
*/
package io.camunda.zeebe.broker.system.management;
import io.atomix.raft.RaftServer.Role;
import io.camunda.zeebe.broker.Loggers;
import io.camunda.zeebe.broker.exporter.stream.ExporterDirector;
import io.camunda.zeebe.broker.partitioning.PartitionAdminAccess;
import io.camunda.zeebe.broker.partitioning.PartitionManagerImpl;
import io.camunda.zeebe.broker.system.management.PartitionStatus.ClockStatus;
import io.camunda.zeebe.broker.system.partitions.ZeebePartition;
import io.camunda.zeebe.scheduler.Actor;
import io.camunda.zeebe.scheduler.future.ActorFuture;
import io.camunda.zeebe.scheduler.future.ActorFutureCollector;
import io.camunda.zeebe.snapshots.PersistedSnapshot;
import io.camunda.zeebe.snapshots.impl.FileBasedSnapshotId;
import io.camunda.zeebe.stream.api.StreamClock;
import io.camunda.zeebe.stream.impl.StreamProcessor;
import java.util.List;
import java.util.Map;
import java.util.Optional;
import java.util.concurrent.CompletableFuture;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.TimeUnit;
import java.util.stream.Collectors;
import java.util.stream.Stream;
import org.slf4j.Logger;
/**
* A service that exposes interface to control some of the core functionalities of the broker such
* as * Pause stream processing * Force take a snapshot
*
*
This is intended to be used only by advanced users
*/
public final class BrokerAdminServiceImpl extends Actor implements BrokerAdminService {
private static final Logger LOG = Loggers.SYSTEM_LOGGER;
private final PartitionManagerImpl partitionManager;
public BrokerAdminServiceImpl(final PartitionManagerImpl partitionManager) {
this.partitionManager = partitionManager;
}
@Override
public void pauseStreamProcessing() {
actor.call(this::pauseStreamProcessingOnAllPartitions);
}
@Override
public void resumeStreamProcessing() {
actor.call(this::resumeStreamProcessingOnAllPartitions);
}
@Override
public void pauseExporting() {
actor.call(this::pauseExportingOnAllPartitions);
}
@Override
public void softPauseExporting() {
actor.call(this::softPauseExportingOnAllPartitions);
}
@Override
public void resumeExporting() {
actor.call(this::resumeExportingOnAllPartitions);
}
@Override
public void takeSnapshot() {
actor.call(this::takeSnapshotOnAllPartitions);
}
@Override
public void prepareForUpgrade() {
actor.call(this::prepareAllPartitionsForSafeUpgrade);
}
@Override
public Map getPartitionStatus() {
final CompletableFuture