public class WriteLineDocTask extends PerfTask
LineDocSource
and is intended
to save the IO overhead of opening a file per document to be indexed.
The format of the output is set according to the output file extension.
Compression is recommended when the output file is expected to be large.
See info on file extensions in
StreamUtils.Type
Supports the following parameters:
DEFAULT_FIELDS
).
DEFAULT_SUFFICIENT_FIELDS
).
Modifier and Type | Field and Description |
---|---|
static String[] |
DEFAULT_FIELDS
Fields to be written by default
|
static String |
DEFAULT_SUFFICIENT_FIELDS
Default fields which at least one of them is required to not skip the doc.
|
static String |
FIELDS_HEADER_INDICATOR |
protected String |
fname |
static char |
SEP |
Constructor and Description |
---|
WriteLineDocTask(PerfRunData runData) |
Modifier and Type | Method and Description |
---|---|
void |
close() |
int |
doLogic()
Perform the task once (ignoring repetitions specification)
Return number of work items done by this task.
|
protected String |
getLogMessage(int recsCount) |
protected PrintWriter |
lineFileOut(Document doc)
Selects output line file by written doc.
|
void |
setParams(String params)
Set the params (docSize only)
|
boolean |
supportsParams()
Sub classes that support parameters must override this method to return
true.
|
protected void |
writeHeader(PrintWriter out)
Write header to the lines file - indicating how to read the file later.
|
clone, getAlgLineNum, getBackgroundDeltaPriority, getDepth, getName, getParams, getRunData, getRunInBackground, isDisableCounting, runAndMaybeStats, setAlgLineNum, setDepth, setDisableCounting, setName, setRunInBackground, setup, shouldNeverLogAtStart, shouldNotRecordStats, stopNow, tearDown, toString
public static final String FIELDS_HEADER_INDICATOR
public static final char SEP
public static final String[] DEFAULT_FIELDS
public static final String DEFAULT_SUFFICIENT_FIELDS
protected final String fname
public WriteLineDocTask(PerfRunData runData) throws Exception
Exception
protected void writeHeader(PrintWriter out)
protected String getLogMessage(int recsCount)
getLogMessage
in class PerfTask
public int doLogic() throws Exception
PerfTask
protected PrintWriter lineFileOut(Document doc)
public void setParams(String params)
public boolean supportsParams()
PerfTask
supportsParams
in class PerfTask
Copyright © 2000-2013 Apache Software Foundation. All Rights Reserved.