<commit_before>package com.cloudera.ds.svdbench

import com.quantifind.sumac.{ArgMain, FieldArgs}
import org.apache.spark.{SparkConf, SparkContext}

class Arguments extends FieldArgs {
  val path: String = "hdfs://matrix"
  val master: String = "local"
  var nRows: Int = 10
  var nCols: Int = 10
  val nNonZero: Int = 3
  val blockSize: Int = 2
}

object GenerateMatrix extends ArgMain[Arguments] {
  def configure(master: String): SparkConf = {
    val conf = new SparkConf()
    conf.setMaster(master)
    conf
  }

  def main(args: Arguments): Unit = {
    val sc = new SparkContext(configure(args.master))
    val matrix = DataIO.generateSparseMatrix(args.nRows, args.nCols, args.nNonZero, args.blockSize,
      sc)
    DataIO.writeMatrix(args.path, matrix)
  }<commit_msg>Arguments should be vals not vars.<commit_after>package com.cloudera.ds.svdbench

import com.quantifind.sumac.{ArgMain, FieldArgs}
import org.apache.spark.{SparkConf, SparkContext}

class Arguments extends FieldArgs {
  var path: String = "hdfs://matrix"
  var master: String = "local"
  var nRows: Int = 10
  var nCols: Int = 10
  var nNonZero: Int = 3
  var blockSize: Int = 2
}

object GenerateMatrix extends ArgMain[Arguments] {
  def configure(master: String): SparkConf = {
    val conf = new SparkConf()
    conf.setMaster(master)
    conf
  }

  def main(args: Arguments): Unit = {
    val sc = new SparkContext(configure(args.master))
    val matrix = DataIO.generateSparseMatrix(args.nRows, args.nCols, args.nNonZero, args.blockSize,
      sc)
    DataIO.writeMatrix(args.path, matrix)
  }
{'fraction_non_alphanumeric': 0.10843373493975904, 'fraction_numerical': 0.007609384908053266, 'mean_word_length': 3.8854489164086687, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3138117', 'n_tokens_mistral': 555, 'n_tokens_neox': 527, 'n_words': 139}