private void makeFPRPrimaryForThisNode() {
    PartitionedRegion partitionedRegion = model.getPartitionedRegion();
    List<FixedPartitionAttributesImpl> FPAs = partitionedRegion.getFixedPartitionAttributesImpl();
    InternalDistributedMember targetId = partitionedRegion.getDistributionManager().getId();
    Member target = model.getMember(targetId);
    for (Bucket bucket : model.getBuckets()) {
      if (bucket != null) {
        for (FixedPartitionAttributesImpl fpa : FPAs) {
          if (fpa.hasBucket(bucket.getId()) && fpa.isPrimary()) {
            Member source = bucket.getPrimary();
            if (source != target) {
              // HACK: In case we don't know who is Primary at this time
              // we just set source as target too for stat purposes

              source = (source == null || source == PartitionedRegionLoadModel.INVALID_MEMBER)
                  ? target : source;
              if (logger.isDebugEnabled()) {
                logger.debug(
                    "PRLM#movePrimariesForFPR: For Bucket#{}, moving primary from source {} to target {}",
                    bucket.getId(), bucket.getPrimary(), target);
              }

              boolean successfulMove = model.movePrimary(new Move(source, target, bucket));
              // We have to move the primary otherwise there is some problem!
              Assert.assertTrue(successfulMove,
                  " Fixed partitioned region not able to move the primary!");
              if (successfulMove) {
                if (logger.isDebugEnabled()) {
                  logger.debug(
                      "PRLM#movePrimariesForFPR: For Bucket#{}, moved primary from source {} to target {}",
                      bucket.getId(), bucket.getPrimary(), target);
                }

                bucket.setPrimary(target, bucket.getPrimaryLoad());
              }
            }
          }
        }
      }
    }
  }
Move all primary from other to this
geode-core/src/main/java/org/apache/geode/internal/cache/partitioned/rebalance/MovePrimariesFPR.java