Packages

  • package root
    Definition Classes
    root
  • package org
    Definition Classes
    root
  • package apache
    Definition Classes
    org
  • package spark

    Core Spark functionality.

    Core Spark functionality. org.apache.spark.SparkContext serves as the main entry point to Spark, while org.apache.spark.rdd.RDD is the data type representing a distributed collection, and provides most parallel operations.

    In addition, org.apache.spark.rdd.PairRDDFunctions contains operations available only on RDDs of key-value pairs, such as groupByKey and join; org.apache.spark.rdd.DoubleRDDFunctions contains operations available only on RDDs of Doubles; and org.apache.spark.rdd.SequenceFileRDDFunctions contains operations available on RDDs that can be saved as SequenceFiles. These operations are automatically available on any RDD of the right type (e.g. RDD[(Int, Int)] through implicit conversions.

    Java programmers should reference the org.apache.spark.api.java package for Spark programming APIs in Java.

    Classes and methods marked with Experimental are user-facing features which have not been officially adopted by the Spark project. These are subject to change or removal in minor releases.

    Classes and methods marked with Developer API are intended for advanced users want to extend Spark through lower level interfaces. These are subject to changes or removal in minor releases.

    Definition Classes
    apache
  • package mllib

    RDD-based machine learning APIs (in maintenance mode).

    RDD-based machine learning APIs (in maintenance mode).

    The spark.mllib package is in maintenance mode as of the Spark 2.0.0 release to encourage migration to the DataFrame-based APIs under the org.apache.spark.ml package. While in maintenance mode,

    • no new features in the RDD-based spark.mllib package will be accepted, unless they block implementing new features in the DataFrame-based spark.ml package;
    • bug fixes in the RDD-based APIs will still be accepted.

    The developers will continue adding more features to the DataFrame-based APIs in the 2.x series to reach feature parity with the RDD-based APIs. And once we reach feature parity, this package will be deprecated.

    Definition Classes
    spark
    See also

    SPARK-4591 to track the progress of feature parity

  • package linalg
    Definition Classes
    mllib
  • package distributed
    Definition Classes
    linalg
  • BlockMatrix
  • CoordinateMatrix
  • DistributedMatrix
  • IndexedRow
  • IndexedRowMatrix
  • MatrixEntry
  • RowMatrix

class BlockMatrix extends DistributedMatrix with Logging

Represents a distributed matrix in blocks of local matrices.

Annotations
@Since( "1.3.0" )
Source
BlockMatrix.scala
Linear Supertypes
Logging, DistributedMatrix, Serializable, Serializable, AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. BlockMatrix
  2. Logging
  3. DistributedMatrix
  4. Serializable
  5. Serializable
  6. AnyRef
  7. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Instance Constructors

  1. new BlockMatrix(blocks: RDD[((Int, Int), Matrix)], rowsPerBlock: Int, colsPerBlock: Int)

    Alternate constructor for BlockMatrix without the input of the number of rows and columns.

    Alternate constructor for BlockMatrix without the input of the number of rows and columns.

    blocks

    The RDD of sub-matrix blocks ((blockRowIndex, blockColIndex), sub-matrix) that form this distributed matrix. If multiple blocks with the same index exist, the results for operations like add and multiply will be unpredictable.

    rowsPerBlock

    Number of rows that make up each block. The blocks forming the final rows are not required to have the given number of rows

    colsPerBlock

    Number of columns that make up each block. The blocks forming the final columns are not required to have the given number of columns

    Annotations
    @Since( "1.3.0" )
  2. new BlockMatrix(blocks: RDD[((Int, Int), Matrix)], rowsPerBlock: Int, colsPerBlock: Int, nRows: Long, nCols: Long)

    blocks

    The RDD of sub-matrix blocks ((blockRowIndex, blockColIndex), sub-matrix) that form this distributed matrix. If multiple blocks with the same index exist, the results for operations like add and multiply will be unpredictable.

    rowsPerBlock

    Number of rows that make up each block. The blocks forming the final rows are not required to have the given number of rows

    colsPerBlock

    Number of columns that make up each block. The blocks forming the final columns are not required to have the given number of columns

    nRows

    Number of rows of this matrix. If the supplied value is less than or equal to zero, the number of rows will be calculated when numRows is invoked.

    nCols

    Number of columns of this matrix. If the supplied value is less than or equal to zero, the number of columns will be calculated when numCols is invoked.

    Annotations
    @Since( "1.3.0" )

Value Members

  1. final def !=(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  4. def add(other: BlockMatrix): BlockMatrix

    Adds the given block matrix other to this block matrix: this + other.

    Adds the given block matrix other to this block matrix: this + other. The matrices must have the same size and matching rowsPerBlock and colsPerBlock values. If one of the blocks that are being added are instances of SparseMatrix, the resulting sub matrix will also be a SparseMatrix, even if it is being added to a DenseMatrix. If two dense matrices are added, the output will also be a DenseMatrix.

    Annotations
    @Since( "1.3.0" )
  5. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  6. val blocks: RDD[((Int, Int), Matrix)]
    Annotations
    @Since( "1.3.0" )
  7. def cache(): BlockMatrix.this.type

    Caches the underlying RDD.

    Caches the underlying RDD.

    Annotations
    @Since( "1.3.0" )
  8. def clone(): AnyRef
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... ) @native() @IntrinsicCandidate()
  9. val colsPerBlock: Int
    Annotations
    @Since( "1.3.0" )
  10. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  11. def equals(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  12. final def getClass(): Class[_]
    Definition Classes
    AnyRef → Any
    Annotations
    @native() @IntrinsicCandidate()
  13. def hashCode(): Int
    Definition Classes
    AnyRef → Any
    Annotations
    @native() @IntrinsicCandidate()
  14. def initializeLogIfNecessary(isInterpreter: Boolean, silent: Boolean): Boolean
    Attributes
    protected
    Definition Classes
    Logging
  15. def initializeLogIfNecessary(isInterpreter: Boolean): Unit
    Attributes
    protected
    Definition Classes
    Logging
  16. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  17. def isTraceEnabled(): Boolean
    Attributes
    protected
    Definition Classes
    Logging
  18. def log: Logger
    Attributes
    protected
    Definition Classes
    Logging
  19. def logDebug(msg: ⇒ String, throwable: Throwable): Unit
    Attributes
    protected
    Definition Classes
    Logging
  20. def logDebug(msg: ⇒ String): Unit
    Attributes
    protected
    Definition Classes
    Logging
  21. def logError(msg: ⇒ String, throwable: Throwable): Unit
    Attributes
    protected
    Definition Classes
    Logging
  22. def logError(msg: ⇒ String): Unit
    Attributes
    protected
    Definition Classes
    Logging
  23. def logInfo(msg: ⇒ String, throwable: Throwable): Unit
    Attributes
    protected
    Definition Classes
    Logging
  24. def logInfo(msg: ⇒ String): Unit
    Attributes
    protected
    Definition Classes
    Logging
  25. def logName: String
    Attributes
    protected
    Definition Classes
    Logging
  26. def logTrace(msg: ⇒ String, throwable: Throwable): Unit
    Attributes
    protected
    Definition Classes
    Logging
  27. def logTrace(msg: ⇒ String): Unit
    Attributes
    protected
    Definition Classes
    Logging
  28. def logWarning(msg: ⇒ String, throwable: Throwable): Unit
    Attributes
    protected
    Definition Classes
    Logging
  29. def logWarning(msg: ⇒ String): Unit
    Attributes
    protected
    Definition Classes
    Logging
  30. def multiply(other: BlockMatrix, numMidDimSplits: Int): BlockMatrix

    Left multiplies this BlockMatrix to other, another BlockMatrix.

    Left multiplies this BlockMatrix to other, another BlockMatrix. The colsPerBlock of this matrix must equal the rowsPerBlock of other. If other contains SparseMatrix, they will have to be converted to a DenseMatrix. The output BlockMatrix will only consist of blocks of DenseMatrix. This may cause some performance issues until support for multiplying two sparse matrices is added. Blocks with duplicate indices will be added with each other.

    other

    Matrix B in A * B = C

    numMidDimSplits

    Number of splits to cut on the middle dimension when doing multiplication. For example, when multiplying a Matrix A of size m x n with Matrix B of size n x k, this parameter configures the parallelism to use when grouping the matrices. The parallelism will increase from m x k to m x k x numMidDimSplits, which in some cases also reduces total shuffled data.

    Annotations
    @Since( "2.2.0" )
  31. def multiply(other: BlockMatrix): BlockMatrix

    Left multiplies this BlockMatrix to other, another BlockMatrix.

    Left multiplies this BlockMatrix to other, another BlockMatrix. The colsPerBlock of this matrix must equal the rowsPerBlock of other. If other contains SparseMatrix, they will have to be converted to a DenseMatrix. The output BlockMatrix will only consist of blocks of DenseMatrix. This may cause some performance issues until support for multiplying two sparse matrices is added.

    Annotations
    @Since( "1.3.0" )
    Note

    The behavior of multiply has changed in 1.6.0. multiply used to throw an error when there were blocks with duplicate indices. Now, the blocks with duplicate indices will be added with each other.

  32. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  33. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native() @IntrinsicCandidate()
  34. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native() @IntrinsicCandidate()
  35. val numColBlocks: Int
    Annotations
    @Since( "1.3.0" )
  36. def numCols(): Long

    Gets or computes the number of columns.

    Gets or computes the number of columns.

    Definition Classes
    BlockMatrixDistributedMatrix
    Annotations
    @Since( "1.3.0" )
  37. val numRowBlocks: Int
    Annotations
    @Since( "1.3.0" )
  38. def numRows(): Long

    Gets or computes the number of rows.

    Gets or computes the number of rows.

    Definition Classes
    BlockMatrixDistributedMatrix
    Annotations
    @Since( "1.3.0" )
  39. def persist(storageLevel: StorageLevel): BlockMatrix.this.type

    Persists the underlying RDD with the specified storage level.

    Persists the underlying RDD with the specified storage level.

    Annotations
    @Since( "1.3.0" )
  40. val rowsPerBlock: Int
    Annotations
    @Since( "1.3.0" )
  41. def subtract(other: BlockMatrix): BlockMatrix

    Subtracts the given block matrix other from this block matrix: this - other.

    Subtracts the given block matrix other from this block matrix: this - other. The matrices must have the same size and matching rowsPerBlock and colsPerBlock values. If one of the blocks that are being subtracted are instances of SparseMatrix, the resulting sub matrix will also be a SparseMatrix, even if it is being subtracted from a DenseMatrix. If two dense matrices are subtracted, the output will also be a DenseMatrix.

    Annotations
    @Since( "2.0.0" )
  42. final def synchronized[T0](arg0: ⇒ T0): T0
    Definition Classes
    AnyRef
  43. def toCoordinateMatrix(): CoordinateMatrix

    Converts to CoordinateMatrix.

    Converts to CoordinateMatrix.

    Annotations
    @Since( "1.3.0" )
  44. def toIndexedRowMatrix(): IndexedRowMatrix

    Converts to IndexedRowMatrix.

    Converts to IndexedRowMatrix. The number of columns must be within the integer range.

    Annotations
    @Since( "1.3.0" )
  45. def toLocalMatrix(): Matrix

    Collect the distributed matrix on the driver as a DenseMatrix.

    Collect the distributed matrix on the driver as a DenseMatrix.

    Annotations
    @Since( "1.3.0" )
  46. def toString(): String
    Definition Classes
    AnyRef → Any
  47. def transpose: BlockMatrix

    Transpose this BlockMatrix.

    Transpose this BlockMatrix. Returns a new BlockMatrix instance sharing the same underlying data. Is a lazy operation.

    Annotations
    @Since( "1.3.0" )
  48. def validate(): Unit

    Validates the block matrix info against the matrix data (blocks) and throws an exception if any error is found.

    Validates the block matrix info against the matrix data (blocks) and throws an exception if any error is found.

    Annotations
    @Since( "1.3.0" )
  49. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  50. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... ) @native()
  51. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )

Deprecated Value Members

  1. def finalize(): Unit
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] ) @Deprecated
    Deprecated

Inherited from Logging

Inherited from DistributedMatrix

Inherited from Serializable

Inherited from Serializable

Inherited from AnyRef

Inherited from Any

Ungrouped