Skip to content

Commit

Permalink
switch dependencies and imports to Pekko
Browse files Browse the repository at this point in the history
Signed-off-by: Stanchev Aleksandar <aleksandar.stanchev@bosch.com>
  • Loading branch information
alstanchev authored and Aleksandar Stanchev committed Aug 28, 2023
1 parent 5eec13f commit dc948ef
Show file tree
Hide file tree
Showing 1,014 changed files with 5,160 additions and 5,075 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/maven.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,4 +42,4 @@ jobs:
cache: 'maven'

- name: Build with Maven
run: mvn package javadoc:jar source:jar --batch-mode --errors --quiet -DcreateJavadoc=true -Dakka.test.single-expect-default=10s --file pom.xml -Dbuild.environment=Github
run: mvn package javadoc:jar source:jar --batch-mode --errors --quiet -DcreateJavadoc=true -Dpekko.test.single-expect-default=10s --file pom.xml -Dbuild.environment=Github
4 changes: 2 additions & 2 deletions base/model/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,8 @@
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.typesafe.akka</groupId>
<artifactId>akka-testkit_${scala.version}</artifactId>
<groupId>org.apache.pekko</groupId>
<artifactId>pekko-testkit_${scala.version}</artifactId>
<scope>test</scope>
</dependency>
</dependencies>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,9 @@
*/
package org.eclipse.ditto.base.model.signals;

import akka.actor.ActorSystem;
import akka.testkit.javadsl.TestKit;
import org.apache.pekko.actor.ActorSystem;
import org.apache.pekko.testkit.javadsl.TestKit;


/**
* Manage creation and termination of actor systems for tests.
Expand Down
30 changes: 15 additions & 15 deletions base/service/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -68,35 +68,35 @@
<artifactId>logback-classic</artifactId>
</dependency>
<dependency>
<groupId>com.typesafe.akka</groupId>
<artifactId>akka-actor_${scala.version}</artifactId>
<groupId>org.apache.pekko</groupId>
<artifactId>pekko-actor_${scala.version}</artifactId>
</dependency>

<dependency>
<groupId>com.lightbend.akka.management</groupId>
<artifactId>akka-management_${scala.version}</artifactId>
<groupId>org.apache.pekko</groupId>
<artifactId>pekko-management_${scala.version}</artifactId>
</dependency>
<dependency>
<groupId>com.lightbend.akka.management</groupId>
<artifactId>akka-management-cluster-bootstrap_${scala.version}</artifactId>
<groupId>org.apache.pekko</groupId>
<artifactId>pekko-management-cluster-bootstrap_${scala.version}</artifactId>
</dependency>
<dependency>
<groupId>com.lightbend.akka.management</groupId>
<artifactId>akka-management-cluster-http_${scala.version}</artifactId>
<groupId>org.apache.pekko</groupId>
<artifactId>pekko-management-cluster-http_${scala.version}</artifactId>
</dependency>

<dependency>
<groupId>com.lightbend.akka.discovery</groupId>
<artifactId>akka-discovery-kubernetes-api_${scala.version}</artifactId>
<groupId>org.apache.pekko</groupId>
<artifactId>pekko-discovery-kubernetes-api_${scala.version}</artifactId>
</dependency>
<dependency>
<groupId>com.lightbend.akka.management</groupId>
<artifactId>akka-lease-kubernetes_${scala.version}</artifactId>
<groupId>org.apache.pekko</groupId>
<artifactId>pekko-lease-kubernetes_${scala.version}</artifactId>
</dependency>

<dependency>
<groupId>com.github.scullxbones</groupId>
<artifactId>akka-persistence-mongo-common_${scala.version}</artifactId>
<artifactId>pekko-persistence-mongodb_${scala.version}</artifactId>
</dependency>

<dependency>
Expand Down Expand Up @@ -126,8 +126,8 @@

<!-- test scope -->
<dependency>
<groupId>com.typesafe.akka</groupId>
<artifactId>akka-testkit_${scala.version}</artifactId>
<groupId>org.apache.pekko</groupId>
<artifactId>pekko-testkit_${scala.version}</artifactId>
<scope>test</scope>
</dependency>
<dependency>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,17 +47,17 @@
import com.typesafe.config.ConfigValue;
import com.typesafe.config.ConfigValueFactory;

import akka.Done;
import akka.actor.ActorRef;
import akka.actor.ActorSystem;
import akka.actor.CoordinatedShutdown;
import akka.actor.Props;
import akka.cluster.Cluster;
import akka.cluster.pubsub.DistributedPubSub;
import akka.http.javadsl.Http;
import akka.http.javadsl.model.Uri;
import akka.management.cluster.bootstrap.ClusterBootstrap;
import akka.management.javadsl.AkkaManagement;
import org.apache.pekko.Done;
import org.apache.pekko.actor.ActorRef;
import org.apache.pekko.actor.ActorSystem;
import org.apache.pekko.actor.CoordinatedShutdown;
import org.apache.pekko.actor.Props;
import org.apache.pekko.cluster.Cluster;
import org.apache.pekko.cluster.pubsub.DistributedPubSub;
import org.apache.pekko.http.javadsl.Http;
import org.apache.pekko.http.javadsl.model.Uri;
import org.apache.pekko.management.cluster.bootstrap.ClusterBootstrap;
import org.apache.pekko.management.javadsl.PekkoManagement;
import ch.qos.logback.classic.LoggerContext;
import kamon.Kamon;
import kamon.prometheus.PrometheusReporter;
Expand All @@ -71,11 +71,11 @@
* <ol>
* <li>{@link #determineRawConfig()},</li>
* <li>{@link #createActorSystem(com.typesafe.config.Config)},</li>
* <li>{@link #startStatusSupplierActor(akka.actor.ActorSystem)},</li>
* <li>{@link #startServiceRootActors(akka.actor.ActorSystem, org.eclipse.ditto.base.service.config.ServiceSpecificConfig)}.
* <li>{@link #startStatusSupplierActor(org.apache.pekko.actor.ActorSystem)},</li>
* <li>{@link #startServiceRootActors(org.apache.pekko.actor.ActorSystem, org.eclipse.ditto.base.service.config.ServiceSpecificConfig)}.
* <ol>
* <li>{@link #getMainRootActorProps(org.eclipse.ditto.base.service.config.ServiceSpecificConfig, akka.actor.ActorRef)},</li>
* <li>{@link #startMainRootActor(akka.actor.ActorSystem, akka.actor.Props)},</li>
* <li>{@link #getMainRootActorProps(org.eclipse.ditto.base.service.config.ServiceSpecificConfig, org.apache.pekko.actor.ActorRef)},</li>
* <li>{@link #startMainRootActor(org.apache.pekko.actor.ActorSystem, org.apache.pekko.actor.Props)},</li>
* </ol>
* </li>
* </ol>
Expand All @@ -95,7 +95,7 @@ public abstract class DittoService<C extends ServiceSpecificConfig> {
*/
public static final String DITTO_CONFIG_PATH = ScopedConfig.DITTO_SCOPE;

protected static final String MONGO_URI_CONFIG_PATH = "akka.contrib.persistence.mongodb.mongo.mongouri";
protected static final String MONGO_URI_CONFIG_PATH = "pekko.contrib.persistence.mongodb.mongo.mongouri";

protected final Config rawConfig;
protected final C serviceSpecificConfig;
Expand Down Expand Up @@ -270,7 +270,7 @@ private void startPrometheusReporter() {
* @param actorSystem the Akka ActorSystem to be initialized.
*/
private void initializeActorSystem(final ActorSystem actorSystem) {
startAkkaManagement(actorSystem);
startPekkoManagement(actorSystem);
startClusterBootstrap(actorSystem);

startStatusSupplierActor(actorSystem);
Expand Down Expand Up @@ -319,15 +319,15 @@ private ActorSystem createActorSystem(final Config config) {
return ActorSystem.create(CLUSTER_NAME, config);
}

private void startAkkaManagement(final ActorSystem actorSystem) {
logger.info("Starting AkkaManagement ...");
final var akkaManagement = AkkaManagement.get(actorSystem);
final CompletionStage<Uri> startPromise = akkaManagement.start();
private void startPekkoManagement(final ActorSystem actorSystem) {
logger.info("Starting PekkoManagement ...");
final var pekkoManagement = PekkoManagement.get(actorSystem);
final CompletionStage<Uri> startPromise = pekkoManagement.start();
startPromise.whenComplete((uri, throwable) -> {
if (null != throwable) {
logger.error("Error during start of AkkaManagement: <{}>!", throwable.getMessage(), throwable);
logger.error("Error during start of PekkoManagement: <{}>!", throwable.getMessage(), throwable);
} else {
logger.info("Started AkkaManagement on URI <{}>.", uri);
logger.info("Started PekkoManagement on URI <{}>.", uri);
}
});
}
Expand Down Expand Up @@ -375,8 +375,8 @@ private void startDevOpsCommandsActor(final ActorSystem actorSystem) {
* is overridden, the following methods will not be called automatically:</em>
* </p>
* <ul>
* <li>{@link #getMainRootActorProps(org.eclipse.ditto.base.service.config.ServiceSpecificConfig, akka.actor.ActorRef)},</li>
* <li>{@link #startMainRootActor(akka.actor.ActorSystem, akka.actor.Props)},</li>
* <li>{@link #getMainRootActorProps(org.eclipse.ditto.base.service.config.ServiceSpecificConfig, org.apache.pekko.actor.ActorRef)},</li>
* <li>{@link #startMainRootActor(org.apache.pekko.actor.ActorSystem, org.apache.pekko.actor.Props)},</li>
* </ul>
*
* @param actorSystem Akka actor system for starting actors.
Expand Down Expand Up @@ -452,9 +452,9 @@ private void setUpCoordinatedShutdown(final ActorSystem actorSystem) {
logger.info("Initiated coordinated shutdown; gracefully shutting down ...");
coordinatedShutdown.getShutdownReason().ifPresent(reason ->
logger.info("Shutdown reason was - <{}>", reason));
final CompletionStage<Done> stop = AkkaManagement.get(actorSystem).stop();
final CompletionStage<Done> stop = PekkoManagement.get(actorSystem).stop();
return stop.thenApply(done -> {
logger.info("AkkaManagement stopped!");
logger.info("PekkoManagement stopped!");
return done;
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,11 @@
import java.util.concurrent.TimeoutException;
import java.util.stream.Collectors;

import akka.actor.ExtendedActorSystem;
import akka.discovery.Lookup;
import akka.discovery.ServiceDiscovery;
import akka.dispatch.Futures;
import akka.pattern.Patterns;
import org.apache.pekko.actor.ExtendedActorSystem;
import org.apache.pekko.discovery.Lookup;
import org.apache.pekko.discovery.ServiceDiscovery;
import org.apache.pekko.dispatch.Futures;
import org.apache.pekko.pattern.Patterns;
import scala.Option;
import scala.collection.JavaConverters;
import scala.concurrent.Future;
Expand All @@ -35,7 +35,7 @@
* <p>
* One speciality of a Docker swarm based cluster is that the Docker swarm DNS sets a TTL of DNS entries to 600 seconds
* (10 minutes) - so if a cluster forms and not all DNS entries are "there" from the beginning, it takes 10 minutes
* until DNS caches used by the default Akka {@link akka.discovery.dns.DnsServiceDiscovery DnsServiceDiscovery} are
* until DNS caches used by the default Akka {@link org.apache.pekko.discovery.dns.DnsServiceDiscovery DnsServiceDiscovery} are
* evicted and another DNS lookup is done.
* </p>
* This implementation does not cache DNS entries and can therefore be used for bootstrapping in Docker swarm.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@

import org.slf4j.Logger;

import akka.actor.ActorSystem;
import org.apache.pekko.actor.ActorSystem;

/**
* This class wraps the execution of a Runnable for catching {@code Throwable}s. The Runnable is assumed to be the
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

import com.typesafe.config.Config;

import akka.actor.ActorSystem;
import org.apache.pekko.actor.ActorSystem;

/**
* Root actor starter that does purposefully nothing.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@

import com.typesafe.config.Config;

import akka.actor.ActorContext;
import akka.actor.ActorSystem;
import org.apache.pekko.actor.ActorContext;
import org.apache.pekko.actor.ActorSystem;

/**
* Root actor child starter that does purposefully nothing.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

import com.typesafe.config.Config;

import akka.actor.ActorSystem;
import org.apache.pekko.actor.ActorSystem;

/**
* Extension to start custom root actors in service.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@

import com.typesafe.config.Config;

import akka.actor.ActorContext;
import akka.actor.ActorSystem;
import org.apache.pekko.actor.ActorContext;
import org.apache.pekko.actor.ActorSystem;

/**
* Extension to start custom child actors in root actor.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ public final class UriEncoding {
private static final IntPredicate ALLOWED_IN_PATH_SEGMENT = UriEncoding::isPchar;
/*
* Workaround: '+' needs to be escaped to '%2B', otherwise it will be recognized as blank when decoding with MIME
* format {@code application/x-www-form-urlencoded} - what most servers do (such as akka-http).
* format {@code application/x-www-form-urlencoded} - what most servers do (such as pekko-http).
*/
private static final IntPredicate ALLOWED_IN_QUERY = c -> c != '+' && (isPchar(c) || '/' == c || '?' == c);
private static final IntPredicate ALLOWED_IN_QUERY_PARAM =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
*/
package org.eclipse.ditto.base.service.actors;

import static akka.http.javadsl.server.Directives.logRequest;
import static akka.http.javadsl.server.Directives.logResult;
import static org.apache.pekko.http.javadsl.server.Directives.logRequest;
import static org.apache.pekko.http.javadsl.server.Directives.logResult;

import java.io.PrintWriter;
import java.io.StringWriter;
Expand All @@ -22,28 +22,28 @@

import org.eclipse.ditto.base.model.exceptions.DittoRuntimeException;
import org.eclipse.ditto.base.service.config.http.HttpConfig;
import org.eclipse.ditto.internal.utils.akka.logging.DittoDiagnosticLoggingAdapter;
import org.eclipse.ditto.internal.utils.akka.logging.DittoLoggerFactory;
import org.eclipse.ditto.internal.utils.pekko.logging.DittoDiagnosticLoggingAdapter;
import org.eclipse.ditto.internal.utils.pekko.logging.DittoLoggerFactory;
import org.eclipse.ditto.internal.utils.cluster.ClusterStatusSupplier;
import org.eclipse.ditto.internal.utils.config.LocalHostAddressSupplier;
import org.eclipse.ditto.internal.utils.health.routes.StatusRoute;

import akka.actor.AbstractActor;
import akka.actor.ActorInitializationException;
import akka.actor.ActorKilledException;
import akka.actor.ActorRef;
import akka.actor.ActorSystem;
import akka.actor.InvalidActorNameException;
import akka.actor.OneForOneStrategy;
import akka.actor.Props;
import akka.actor.Status;
import akka.actor.SupervisorStrategy;
import akka.cluster.Cluster;
import akka.http.javadsl.Http;
import akka.http.javadsl.server.Route;
import akka.japi.pf.DeciderBuilder;
import akka.japi.pf.ReceiveBuilder;
import akka.pattern.AskTimeoutException;
import org.apache.pekko.actor.AbstractActor;
import org.apache.pekko.actor.ActorInitializationException;
import org.apache.pekko.actor.ActorKilledException;
import org.apache.pekko.actor.ActorRef;
import org.apache.pekko.actor.ActorSystem;
import org.apache.pekko.actor.InvalidActorNameException;
import org.apache.pekko.actor.OneForOneStrategy;
import org.apache.pekko.actor.Props;
import org.apache.pekko.actor.Status;
import org.apache.pekko.actor.SupervisorStrategy;
import org.apache.pekko.cluster.Cluster;
import org.apache.pekko.http.javadsl.Http;
import org.apache.pekko.http.javadsl.server.Route;
import org.apache.pekko.japi.pf.DeciderBuilder;
import org.apache.pekko.japi.pf.ReceiveBuilder;
import org.apache.pekko.pattern.AskTimeoutException;
import scala.PartialFunction;

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,10 @@
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import akka.actor.ActorRef;
import akka.actor.PoisonPill;
import akka.cluster.pubsub.DistributedPubSubMediator;
import akka.japi.pf.ReceiveBuilder;
import org.apache.pekko.actor.ActorRef;
import org.apache.pekko.actor.PoisonPill;
import org.apache.pekko.cluster.pubsub.DistributedPubSubMediator;
import org.apache.pekko.japi.pf.ReceiveBuilder;

/**
* Responsible for shutting down the given actor in case a shutdown command contains a reason that is applicable for the
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

import javax.annotation.concurrent.Immutable;

import akka.actor.Props;
import org.apache.pekko.actor.Props;

/**
* Message that holds props of an actor and the name to start this actor with.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,14 @@
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import akka.actor.AbstractActor;
import akka.actor.ActorRef;
import akka.actor.Cancellable;
import akka.actor.Props;
import akka.japi.pf.ReceiveBuilder;
import org.apache.pekko.actor.AbstractActor;
import org.apache.pekko.actor.ActorRef;
import org.apache.pekko.actor.Cancellable;
import org.apache.pekko.actor.Props;
import org.apache.pekko.japi.pf.ReceiveBuilder;

/**
* This is just a wrapper for the {@link akka.cluster.sbr.SplitBrainResolver akka sbr} with an addition, that this
* This is just a wrapper for the {@link org.apache.pekko.cluster.sbr.SplitBrainResolver pekko sbr} with an addition, that this
* sbr can be turned off/on via {@link ModifySplitBrainResolver} sent as piggyback command to /system/cluster/core/daemon/downingProvider
*/
final class DittoSplitBrainResolver extends AbstractActor {
Expand Down

0 comments on commit dc948ef

Please sign in to comment.