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
Fields -
Constructor Summary
ConstructorsConstructorDescriptionCreates 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.voidreadFields(DataInput in) Parses aWARCRecordout of aDataInputstream, and makes it the writable's current record.voidsetRecord(WARCRecord record) Updates the record held within this writable wrapper.voidwrite(DataOutput out) Appends the current record to aDataOutputstream.
-
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 aDataOutputstream.- Specified by:
writein interfaceorg.apache.hadoop.io.Writable- Throws:
IOException
-
readFields
Parses aWARCRecordout of aDataInputstream, and makes it the writable's current record.- Specified by:
readFieldsin interfaceorg.apache.hadoop.io.Writable- Throws:
IOException
-