code: private int getReplicaTypeForPartition(int partitionId) {
          List<Integer> routingPartitionList = routingStrategy.getReplicatingPartitionList(partitionId);
  
          // Determine if we should host this partition, and if so, whether we are a primary,
          // secondary or n-ary replica for it
          int correctReplicaType = -1;
          for (int replica = 0; replica < routingPartitionList.size(); replica++) {
              if(nodePartitionIds.contains(routingPartitionList.get(replica))) {
                  // This means the partitionId currently being iterated on should be hosted
                  // by this node. Let's remember its replica type in order to make sure the
                  // files we have are properly named.
                  correctReplicaType = replica;
                  break;
              }
          }
  
          return correctReplicaType;
      }
docs: Given a partition ID, determine which replica of this partition is hosted by the
  current node, if any.
  
  Note: This is an implementation detail of the READONLY_V2 naming scheme, and should
  not be used outside of that scope.
  
  @param partitionId for which we want to know the replica type
  @return the requested partition's replica type (which ranges from 0 to replication
  factor -1) if the partition is hosted on the current node, or -1 if the
  requested partition is not hosted on this node.