Skip to content

Commit

Permalink
PartitionReplicaStateChecker Mockito + Azul fix [HZ-4458][5.3.z] (#1125)
Browse files Browse the repository at this point in the history
Closes: https://hazelcast.atlassian.net/browse/HZ-4458
Closes: #26281
Mokito + Azul issue.
implements interfaces MigrationManager, PartitionStateManager

Backport of: https://github.com/hazelcast/hazelcast-mono/pull/1065

Checklist:
- [x] Labels (`Team:`, `Type:`, `Source:`, `Module:`) and Milestone set
- [x] Add `Add to Release Notes` label if changes should be mentioned in
release notes or `Not Release Notes content` if changes are not relevant
for release notes
- [x] Request reviewers if possible
- [x] New public APIs have `@Nonnull/@Nullable` annotations
- [x] New public APIs have `@since` tags in Javadoc
- [x] Send backports/forwardports if fix needs to be applied to
past/future releases

---------

Co-authored-by: Krzysztof Jamróz <79092062+k-jamroz@users.noreply.github.com>
GitOrigin-RevId: fa4f6fa77d895da4201c257a3f97be09d9b65933
  • Loading branch information
2 people authored and actions-user committed Mar 15, 2024
1 parent 6f87f46 commit 291a327
Show file tree
Hide file tree
Showing 8 changed files with 2,651 additions and 2,281 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@
import static com.hazelcast.internal.metrics.MetricDescriptorConstants.PARTITIONS_METRIC_PARTITION_SERVICE_MIGRATION_QUEUE_SIZE;
import static com.hazelcast.internal.metrics.MetricDescriptorConstants.PARTITIONS_PREFIX;
import static com.hazelcast.internal.partition.PartitionStampUtil.calculateStamp;
import static com.hazelcast.internal.partition.impl.MigrationManager.applyMigration;
import static com.hazelcast.internal.partition.impl.MigrationManagerImpl.applyMigration;
import static com.hazelcast.internal.util.MapUtil.createHashMap;
import static java.lang.Math.ceil;
import static java.lang.Math.max;
Expand Down Expand Up @@ -135,7 +135,7 @@ public class InternalPartitionServiceImpl implements InternalPartitionService,
private final Lock partitionServiceLock = new ReentrantLock();

private final PartitionStateManager partitionStateManager;
private final MigrationManager migrationManager;
private final MigrationManagerImpl migrationManager;
private final PartitionReplicaManager replicaManager;
private final PartitionReplicaStateChecker partitionReplicaStateChecker;
private final PartitionEventManager partitionEventManager;
Expand All @@ -160,8 +160,8 @@ public InternalPartitionServiceImpl(Node node) {
this.logger = node.getLogger(InternalPartitionService.class);
this.internalAsyncExecutor = nodeEngine.getExecutionService()
.getExecutor(ExecutionService.ASYNC_EXECUTOR);
partitionStateManager = new PartitionStateManager(node, this);
migrationManager = new MigrationManager(node, this, partitionServiceLock);
partitionStateManager = new PartitionStateManagerImpl(node, this);
migrationManager = new MigrationManagerImpl(node, this, partitionServiceLock);
replicaManager = new PartitionReplicaManager(node, this);

partitionReplicaStateChecker = new PartitionReplicaStateChecker(node.getNodeEngine(), this);
Expand Down

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
package com.hazelcast.internal.partition.impl;

import com.hazelcast.instance.impl.OutOfMemoryErrorDispatcher;
import com.hazelcast.internal.partition.impl.MigrationManager.MigrationPlanTask;
import com.hazelcast.internal.partition.impl.MigrationManagerImpl.MigrationPlanTask;
import com.hazelcast.logging.ILogger;
import com.hazelcast.spi.properties.ClusterProperty;

Expand Down Expand Up @@ -54,7 +54,7 @@ class MigrationThread extends Thread implements Runnable {

this.migrationManager = migrationManager;
this.queue = queue;
this.partitionMigrationInterval = migrationManager.partitionMigrationInterval;
this.partitionMigrationInterval = migrationManager.getPartitionMigrationInterval();
this.sleepTime = max(DEFAULT_MIGRATION_SLEEP_INTERVAL, partitionMigrationInterval);
this.logger = logger;
}
Expand Down

0 comments on commit 291a327

Please sign in to comment.