Package org.apache.sysds.runtime.instructions.spark.utils

## Class RDDSortUtils

- java.lang.Object
- - org.apache.sysds.runtime.instructions.spark.utils.RDDSortUtils

    public class RDDSortUtils
    extends Object

### Nested Class Summary

Nested Classes
`static class` `RDDSortUtils.IndexComparator`
`static class` `RDDSortUtils.IndexComparator2`

### Constructor Summary

Constructors
`RDDSortUtils()`

### Method Summary

All Methods Static Methods Concrete Methods
`static org.apache.spark.api.java.JavaPairRDD<MatrixIndexes,​MatrixBlock>` `sortByVal​(org.apache.spark.api.java.JavaPairRDD<MatrixIndexes,​MatrixBlock> in, long rlen, int blen)`
`static org.apache.spark.api.java.JavaPairRDD<MatrixIndexes,​MatrixBlock>` `sortByVal​(org.apache.spark.api.java.JavaPairRDD<MatrixIndexes,​MatrixBlock> in, org.apache.spark.api.java.JavaPairRDD<MatrixIndexes,​MatrixBlock> in2, long rlen, int blen)`
`static org.apache.spark.api.java.JavaPairRDD<MatrixIndexes,​MatrixBlock>` `sortByVals​(org.apache.spark.api.java.JavaPairRDD<MatrixIndexes,​MatrixBlock> in, long rlen, long clen, int blen)`
`static org.apache.spark.api.java.JavaPairRDD<MatrixIndexes,​MatrixBlock>` `sortDataByIx​(org.apache.spark.api.java.JavaPairRDD<MatrixIndexes,​MatrixBlock> data, org.apache.spark.api.java.JavaPairRDD<MatrixIndexes,​MatrixBlock> ixmap, long rlen, long clen, int blen)`
`static org.apache.spark.api.java.JavaPairRDD<MatrixIndexes,​MatrixBlock>` `sortDataByVal​(org.apache.spark.api.java.JavaPairRDD<MatrixIndexes,​MatrixBlock> val, org.apache.spark.api.java.JavaPairRDD<MatrixIndexes,​MatrixBlock> data, boolean asc, long rlen, long clen, int blen)`

`static org.apache.spark.api.java.JavaPairRDD<MatrixIndexes,​MatrixBlock>`

`sortDataByValMemSort​(org.apache.spark.api.java.JavaPairRDD<MatrixIndexes,​MatrixBlock> val, org.apache.spark.api.java.JavaPairRDD<MatrixIndexes,​MatrixBlock> data, boolean asc, long rlen, long clen, int blen, SparkExecutionContext sec, ReorgOperator r_op)`

This function collects and sorts value column in memory and then broadcasts it.

`static org.apache.spark.api.java.JavaPairRDD<MatrixIndexes,​MatrixBlock>` `sortDataByVals​(org.apache.spark.api.java.JavaPairRDD<MatrixIndexes,​MatrixBlock> val, org.apache.spark.api.java.JavaPairRDD<MatrixIndexes,​MatrixBlock> data, boolean asc, long rlen, long clen, long clen2, int blen)`
`static org.apache.spark.api.java.JavaPairRDD<MatrixIndexes,​MatrixBlock>` `sortIndexesByVal​(org.apache.spark.api.java.JavaPairRDD<MatrixIndexes,​MatrixBlock> val, boolean asc, long rlen, int blen)`
`static org.apache.spark.api.java.JavaPairRDD<MatrixIndexes,​MatrixBlock>` `sortIndexesByVals​(org.apache.spark.api.java.JavaPairRDD<MatrixIndexes,​MatrixBlock> in, boolean asc, long rlen, long clen, int blen)`

### Methods inherited from class java.lang.Object

`equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Constructor Detail

#### RDDSortUtils

    public RDDSortUtils()

### Method Detail

#### sortByVal

    public static org.apache.spark.api.java.JavaPairRDD<MatrixIndexes,​MatrixBlock> sortByVal​(org.apache.spark.api.java.JavaPairRDD<MatrixIndexes,​MatrixBlock> in,
                                                                                                   long rlen,
                                                                                                   int blen)

#### sortByVal

    public static org.apache.spark.api.java.JavaPairRDD<MatrixIndexes,​MatrixBlock> sortByVal​(org.apache.spark.api.java.JavaPairRDD<MatrixIndexes,​MatrixBlock> in,
                                                                                                   org.apache.spark.api.java.JavaPairRDD<MatrixIndexes,​MatrixBlock> in2,
                                                                                                   long rlen,
                                                                                                   int blen)

#### sortByVals

    public static org.apache.spark.api.java.JavaPairRDD<MatrixIndexes,​MatrixBlock> sortByVals​(org.apache.spark.api.java.JavaPairRDD<MatrixIndexes,​MatrixBlock> in,
                                                                                                    long rlen,
                                                                                                    long clen,
                                                                                                    int blen)

#### sortIndexesByVal

    public static org.apache.spark.api.java.JavaPairRDD<MatrixIndexes,​MatrixBlock> sortIndexesByVal​(org.apache.spark.api.java.JavaPairRDD<MatrixIndexes,​MatrixBlock> val,
                                                                                                          boolean asc,
                                                                                                          long rlen,
                                                                                                          int blen)

#### sortIndexesByVals

    public static org.apache.spark.api.java.JavaPairRDD<MatrixIndexes,​MatrixBlock> sortIndexesByVals​(org.apache.spark.api.java.JavaPairRDD<MatrixIndexes,​MatrixBlock> in,
                                                                                                           boolean asc,
                                                                                                           long rlen,
                                                                                                           long clen,
                                                                                                           int blen)

#### sortDataByVal

    public static org.apache.spark.api.java.JavaPairRDD<MatrixIndexes,​MatrixBlock> sortDataByVal​(org.apache.spark.api.java.JavaPairRDD<MatrixIndexes,​MatrixBlock> val,
                                                                                                       org.apache.spark.api.java.JavaPairRDD<MatrixIndexes,​MatrixBlock> data,
                                                                                                       boolean asc,
                                                                                                       long rlen,
                                                                                                       long clen,
                                                                                                       int blen)

#### sortDataByVals

    public static org.apache.spark.api.java.JavaPairRDD<MatrixIndexes,​MatrixBlock> sortDataByVals​(org.apache.spark.api.java.JavaPairRDD<MatrixIndexes,​MatrixBlock> val,
                                                                                                        org.apache.spark.api.java.JavaPairRDD<MatrixIndexes,​MatrixBlock> data,
                                                                                                        boolean asc,
                                                                                                        long rlen,
                                                                                                        long clen,
                                                                                                        long clen2,
                                                                                                        int blen)

#### sortDataByIx

    public static org.apache.spark.api.java.JavaPairRDD<MatrixIndexes,​MatrixBlock> sortDataByIx​(org.apache.spark.api.java.JavaPairRDD<MatrixIndexes,​MatrixBlock> data,
                                                                                                      org.apache.spark.api.java.JavaPairRDD<MatrixIndexes,​MatrixBlock> ixmap,
                                                                                                      long rlen,
                                                                                                      long clen,
                                                                                                      int blen)

#### sortDataByValMemSort

    public static org.apache.spark.api.java.JavaPairRDD<MatrixIndexes,​MatrixBlock> sortDataByValMemSort​(org.apache.spark.api.java.JavaPairRDD<MatrixIndexes,​MatrixBlock> val,
                                                                                                              org.apache.spark.api.java.JavaPairRDD<MatrixIndexes,​MatrixBlock> data,
                                                                                                              boolean asc,
                                                                                                              long rlen,
                                                                                                              long clen,
                                                                                                              int blen,
                                                                                                              SparkExecutionContext sec,
                                                                                                              ReorgOperator r_op)

This function collects and sorts value column in memory and then broadcasts it.

Parameters:
  `val` - value as `JavaPairRDD<MatrixIndexes, MatrixBlock>`
  `data` - data as `JavaPairRDD<MatrixIndexes, MatrixBlock>`
  `asc` - if true, sort ascending
  `rlen` - number of rows
  `clen` - number of columns
  `blen` - block length
  `sec` - spark execution context
  `r_op` - reorg operator
Returns:
  data as `JavaPairRDD<MatrixIndexes, MatrixBlock>`