CSVView

class CSVView

CSVView

=======

Streaming‑first CSV writer mirroring the Parquet view.

Responsibilities

  • FUN/VAR streaming: append live into buffered writers; keep an in‑memory buffer for a final rewrite

  • Final rewrite (optional): globally sort by (K, correlation) and rewrite both files aligned

  • BEST → (K asc, corr asc)

  • WORST → (K asc, corr desc)

  • AVERAGE rows are one‑per‑K; effective order is K asc

  • Topics in -Var and -Top: base64‑packed masks as "B64:<base64>" (no padding)

  • Top solutions: replace‑batch semantics; header announces TopicsB64

  • Set -Dnbs.csv.top.live=false to buffer all batches and write once on close

Filesystem

Toggles

  • -Dnbs.csv.top.live (default true): live write of -Top on each batch

  • -Dnbs.csv.finalRewrite (default true): global sort & rewrite of FUN/VAR on close

  • -Dnbs.csv.flushEvery (default 256): throttled flush frequency

  • -Dnbs.csv.buffer (default 262144): writer buffer size in bytes

Constructors

Link copied to clipboard
constructor()

Types

Link copied to clipboard
data class StreamHandles(val funWriter: BufferedWriter, val varWriter: BufferedWriter)

Buffered writer bundle for FUN/VAR.

Functions

Link copied to clipboard

Close writers, then (optionally) globally sort & rewrite FUN/VAR to keep them aligned.

Link copied to clipboard
fun getAggregatedDataFilePath(model: DatasetModel, isTargetAll: Boolean = false): String
Link copied to clipboard
fun getInfoFilePath(model: DatasetModel, isTargetAll: Boolean = false): String
Link copied to clipboard
Link copied to clipboard

Append one streamed FUN/VAR row, buffering for a possible final rewrite.

Link copied to clipboard

Merge/replace cached TOP blocks and optionally write the whole file live.

Link copied to clipboard

Open and cache large‑buffer appenders for FUN/VAR of the current run/target.

Link copied to clipboard
fun printSnapshot(model: DatasetModel, allSolutions: List<BinarySolution>, topSolutions: List<BinarySolution>, actualTarget: String)

Write a full snapshot of FUN/VAR (and TOP when applicable) to CSV.

Link copied to clipboard
fun writeCsv(data: List<Array<String>>, resultPath: String)

Write a full CSV table with OpenCSV (header + rows).