Class WARCWritable
java.lang.Object
org.apache.hadoop.hbase.test.util.warc.WARCWritable
- All Implemented Interfaces:
org.apache.hadoop.io.Writable
A mutable wrapper around a
WARCRecord
implementing the Hadoop Writable interface. This
allows WARC records to be used throughout Hadoop (e.g. written to sequence files when shuffling
data between mappers and reducers). The record is encoded as a single record in standard WARC/1.0
format.-
Field Summary
-
Constructor Summary
ConstructorDescriptionCreates an empty writable (with a null record).WARCWritable
(WARCRecord record) Creates a writable wrapper around a given WARCRecord. -
Method Summary
Modifier and TypeMethodDescriptionReturns the record currently wrapped by this writable.void
readFields
(DataInput in) Parses aWARCRecord
out of aDataInput
stream, and makes it the writable's current record.void
setRecord
(WARCRecord record) Updates the record held within this writable wrapper.void
write
(DataOutput out) Appends the current record to aDataOutput
stream.
-
Field Details
-
record
-
-
Constructor Details
-
WARCWritable
public WARCWritable()Creates an empty writable (with a null record). -
WARCWritable
Creates a writable wrapper around a given WARCRecord.
-
-
Method Details
-
getRecord
Returns the record currently wrapped by this writable. -
setRecord
Updates the record held within this writable wrapper. -
write
Appends the current record to aDataOutput
stream.- Specified by:
write
in interfaceorg.apache.hadoop.io.Writable
- Throws:
IOException
-
readFields
Parses aWARCRecord
out of aDataInput
stream, and makes it the writable's current record.- Specified by:
readFields
in interfaceorg.apache.hadoop.io.Writable
- Throws:
IOException
-