use of org.apache.drill.exec.physical.resultSet.util.JsonWriter in project drill by apache.
the class StreamingHttpConnection method outputAvailable.
/**
* Set the output stream. Sent from the REST request thread in the
* {@code StreamingOutput} callback once the output stream is
* available. Unblocks the Screen thread.
*/
public void outputAvailable(OutputStream out) throws IOException {
this.out = out;
writer = new JsonWriter(out, false, false);
startSignal.countDown();
}
use of org.apache.drill.exec.physical.resultSet.util.JsonWriter in project drill by apache.
the class JsonFileBuilder method build.
/**
* Writes the configured data to the given file in json format.
* @param tableFile The file to write the json data to.
* @throws IOException
*/
public void build(File tableFile) throws IOException {
tableFile.getParentFile().mkdirs();
try (BufferedOutputStream os = new BufferedOutputStream(new FileOutputStream(tableFile))) {
JsonWriter jsonWriter = new JsonWriter(os, pretty, useExtendedOutput);
final RowSetReader reader = rowSet.reader();
while (reader.next()) {
jsonWriter.writeRow(reader);
}
}
}
Aggregations