docs: public int getPartition(byte[] key,
                              byte[] value,
                              int numReduceTasks) {
          try {
              /**
               * {@link partitionId} is the Voldemort primary partition that this
               * record belongs to.
               */
              int partitionId = ByteUtils.readInt(value, ByteUtils.SIZE_OF_INT);
  
              /**
               * This is the base number we will ultimately mod by {@link numReduceTasks}
               * to determine which reduce task to shuffle to.
               */
              int magicNumber = partitionId;
  
              if (getSaveKeys() && !buildPrimaryReplicasOnly) {
                  /**
                   * When saveKeys is enabled (which also implies we are generating
                   * READ_ONLY_V2 format files), then we are generating files with
                   * a replica type, with one file per replica.
                   *
                   * Each replica is sent to a different reducer, and thus the
                   * {@link magicNumber} is scaled accordingly.
                   *
                   * The downside to this is that it is pretty wasteful. The files
                   * generated for each replicas are identical to one another, so
                   * there's no point in generating them independently in many
                   * reducers.
                   *
                   * This is one of the reasons why buildPrimaryReplicasOnly was
                   * written. In this mode, we only generate the files for the
                   * primary replica, which means the number of reducers is
                   * minimized and {@link magicNumber} does not need to be scaled.
                   */
                  int replicaType = (int) ByteUtils.readBytes(value,
                                                              2 * ByteUtils.SIZE_OF_INT,
                                                              ByteUtils.SIZE_OF_BYTE);
                  magicNumber = magicNumber * getStoreDef().getReplicationFactor() + replicaType;
              }
  
              if (!getReducerPerBucket()) {
                  /**
                   * Partition files can be split in many chunks in order to limit the
                   * maximum file size downloaded and handled by Voldemort servers.
                   *
                   * {@link chunkId} represents which chunk of partition then current
                   * record belongs to.
                   */
                  int chunkId = ReadOnlyUtils.chunk(key, getNumChunks());
  
                  /**
                   * When reducerPerBucket is disabled, all chunks are sent to a
                   * different reducer. This increases parallelism at the expense
                   * of adding more load on Hadoop.
                   *
                   * {@link magicNumber} is thus scaled accordingly, in order to
                   * leverage the extra reducers available to us.
                   */
                  magicNumber = magicNumber * getNumChunks() + chunkId;
              }
  
              /**
               * Finally, we mod {@link magicNumber} by {@link numReduceTasks},
               * since the MapReduce framework expects the return of this function
               * to be bounded by the number of reduce tasks running in the job.
               */
              return magicNumber % numReduceTasks;
          } catch (Exception e) {
              throw new VoldemortException("Caught exception in getPartition()!" +
                                           " key: " + ByteUtils.toHexString(key) +
                                           ", value: " + ByteUtils.toHexString(value) +
                                           ", numReduceTasks: " + numReduceTasks, e);
          }
      }