public class BinRDF extends Object
ThriftConvert
, for specific functions on binary RDF.ThriftConvert
Constructor and Description |
---|
BinRDF() |
Modifier and Type | Method and Description |
---|---|
static void |
apply(org.apache.thrift.protocol.TProtocol protocol,
Action<RDF_StreamRow> action)
Send the contents of a RDF-encoded Thrift file to an "action"
|
static void |
applyVisitor(org.apache.thrift.protocol.TProtocol protocol,
VisitorStreamRowTRDF visitor) |
static void |
dump(OutputStream out,
InputStream in)
Debug help - print details of a Thrift stream.
|
static void |
fileToStream(String filename,
StreamRDF dest)
Decode the contents of the file and send to the
StreamRDF . |
static void |
inputStreamToStream(InputStream in,
StreamRDF dest)
Decode the contents of the input stream and send to the
StreamRDF . |
static void |
protocolToStream(org.apache.thrift.protocol.TProtocol protocol,
StreamRDF dest)
Decode the contents of the TProtocol and send to the
StreamRDF . |
static ResultSet |
readResultSet(InputStream in) |
static ResultSet |
readResultSet(org.apache.thrift.protocol.TProtocol protocol) |
static StreamRDF |
streamToFile(String filename)
Create an
StreamRDF for output. |
static StreamRDF |
streamToFile(String filename,
boolean withValues)
Create an
StreamRDF for output. |
static StreamRDF |
streamToOutputStream(OutputStream out)
Create an
StreamRDF for output. |
static StreamRDF |
streamToOutputStream(OutputStream out,
boolean withValues)
Create an
StreamRDF for output. |
static StreamRDF |
streamToTProtocol(org.apache.thrift.protocol.TProtocol protocol)
Create an
StreamRDF for output. |
static StreamRDF |
streamToTProtocol(org.apache.thrift.protocol.TProtocol protocol,
boolean withValues)
Create an
StreamRDF for output. |
static void |
writeResultSet(OutputStream out,
ResultSet resultSet) |
static void |
writeResultSet(OutputStream out,
ResultSet resultSet,
boolean withValues) |
static void |
writeResultSet(org.apache.thrift.protocol.TProtocol protocol,
ResultSet resultSet) |
static void |
writeResultSet(org.apache.thrift.protocol.TProtocol protocol,
ResultSet resultSet,
boolean encodeValues) |
public static StreamRDF streamToFile(String filename)
StreamRDF
for output. A filename ending .gz
will have
a gzip compressor added to the output path. A filename of "-" is System.out
.
The file is closed when StreamRDF.finish()
is called unless it is System.out
.
Call StreamRDF.start()
...StreamRDF.finish()
.filename
- The filepublic static StreamRDF streamToFile(String filename, boolean withValues)
StreamRDF
for output. A filename ending .gz
will have
a gzip compressor added to the output path. A filename of "-" is System.out
.
The file is closed when StreamRDF.finish()
is called unless it is System.out
.
Call StreamRDF.start()
...StreamRDF.finish()
.filename
- The filewithValues
- - whether to encode numeric values as values.public static StreamRDF streamToOutputStream(OutputStream out)
StreamRDF
for output.
The OutputStream
is closed when StreamRDF.finish()
is called unless it is System.out
.
Call StreamRDF.start()
...StreamRDF.finish()
.out
- OutputStreampublic static StreamRDF streamToOutputStream(OutputStream out, boolean withValues)
StreamRDF
for output.
The OutputStream
is closed when StreamRDF.finish()
is called unless it is System.out
.
Call StreamRDF.start()
...StreamRDF.finish()
.out
- OutputStreamwithValues
- - whether to encode numeric values as values.public static StreamRDF streamToTProtocol(org.apache.thrift.protocol.TProtocol protocol)
StreamRDF
for output.
The OutputStream
is closed when StreamRDF.finish()
is called unless it is System.out
.
Call StreamRDF.start()
...StreamRDF.finish()
.protocol
- Output and encoding.public static StreamRDF streamToTProtocol(org.apache.thrift.protocol.TProtocol protocol, boolean withValues)
StreamRDF
for output.
The OutputStream
is closed when StreamRDF.finish()
is called unless it is System.out
.
Call StreamRDF.start()
...StreamRDF.finish()
.protocol
- Output and encoding.withValues
- - whether to encode numeric values as values.public static void fileToStream(String filename, StreamRDF dest)
StreamRDF
.
A filename ending .gz
will have a gzip decompressor added.
A filename of "-" is System.in
.filename
- The file.dest
- Sinkpublic static void inputStreamToStream(InputStream in, StreamRDF dest)
StreamRDF
.in
- InputStreamdest
- StreamRDFpublic static void protocolToStream(org.apache.thrift.protocol.TProtocol protocol, StreamRDF dest)
StreamRDF
.protocol
- TProtocoldest
- Sinkpublic static void applyVisitor(org.apache.thrift.protocol.TProtocol protocol, VisitorStreamRowTRDF visitor)
public static void apply(org.apache.thrift.protocol.TProtocol protocol, Action<RDF_StreamRow> action)
protocol
- TProtocolaction
- Code to act on the row.public static void dump(OutputStream out, InputStream in)
out
- OutputStreamin
- InputStreampublic static ResultSet readResultSet(InputStream in)
public static ResultSet readResultSet(org.apache.thrift.protocol.TProtocol protocol)
public static void writeResultSet(OutputStream out, ResultSet resultSet)
public static void writeResultSet(OutputStream out, ResultSet resultSet, boolean withValues)
public static void writeResultSet(org.apache.thrift.protocol.TProtocol protocol, ResultSet resultSet)
public static void writeResultSet(org.apache.thrift.protocol.TProtocol protocol, ResultSet resultSet, boolean encodeValues)
Licenced under the Apache License, Version 2.0