|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.archive.io.WriterPoolMember
org.archive.io.hbase.HBaseWriter
public class HBaseWriter
HBase implementation.
| Field Summary |
|---|
| Fields inherited from class org.archive.io.WriterPoolMember |
|---|
countOut, currentBasename, currentTimestamp, DEFAULT_PREFIX, DEFAULT_TEMPLATE, f, out, rebuf, roundRobinIndex, scratchbuffer, serialNoFormatter, settings, UTF8 |
| Fields inherited from interface org.archive.io.ArchiveFileConstants |
|---|
ABSOLUTE_OFFSET_KEY, CDX, CDX_FILE, CDX_LINE_BUFFER_SIZE, CRLF, DATE_FIELD_KEY, DEFAULT_DIGEST_METHOD, DOT_COMPRESSED_FILE_EXTENSION, DUMP, GZIP_DUMP, HEADER, INVALID_SUFFIX, LENGTH_FIELD_KEY, MIMETYPE_FIELD_KEY, NOHEAD, OCCUPIED_SUFFIX, READER_IDENTIFIER_FIELD_KEY, RECORD_IDENTIFIER_FIELD_KEY, SINGLE_SPACE, TYPE_FIELD_KEY, URL_FIELD_KEY, VERSION_FIELD_KEY |
| Constructor Summary | |
|---|---|
HBaseWriter(AtomicInteger serialNo,
org.archive.io.WriterPoolSettings settings,
HBaseParameters parameters)
Instantiates a new h base writer. |
|
| Method Summary | |
|---|---|
protected byte[] |
getByteArrayFromInputStream(org.archive.io.ReplayInputStream replayInputStream,
int streamSize)
Read the ReplayInputStream and write it to the given BatchUpdate with the given column. |
org.apache.hadoop.hbase.client.HTable |
getClient()
Gets the HTable client. |
HBaseParameters |
getHbaseOptions()
Gets the hbase options. |
protected void |
initializeCrawlTable(org.apache.hadoop.conf.Configuration hbaseConfiguration,
String hbaseTableName)
Creates the crawl table in HBase. |
protected void |
processContent(org.apache.hadoop.hbase.client.Put put,
org.archive.io.ReplayInputStream replayInputStream,
int streamSize)
This is a stub method and is here to allow extension/overriding for custom content parsing, data manipulation and to populate new columns. |
byte[] |
serialize(byte[] bytes)
Implement if you want to serialize bytes in a custom manner. |
void |
write(org.archive.modules.CrawlURI curi,
String ip,
org.archive.io.RecordingOutputStream recordingOutputStream,
org.archive.io.RecordingInputStream recordingInputStream)
Write the crawled output to the configured HBase table. |
| Methods inherited from class org.archive.io.WriterPoolMember |
|---|
checkSize, checkWriteable, close, copyFrom, createFile, createFile, flush, generateNewBasename, getBaseFilename, getFile, getNextDirectory, getOutputStream, getPosition, isCompressed, isOversize, postWriteRecordTasks, preWriteRecordTasks, write, write, write |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public HBaseWriter(AtomicInteger serialNo,
org.archive.io.WriterPoolSettings settings,
HBaseParameters parameters)
throws IOException
serialNo - the serial nosettings - the settingsparameters - the parameters
IOException - Signals that an I/O exception has occurred.| Method Detail |
|---|
public HBaseParameters getHbaseOptions()
HBaseParameterspublic org.apache.hadoop.hbase.client.HTable getClient()
protected void initializeCrawlTable(org.apache.hadoop.conf.Configuration hbaseConfiguration,
String hbaseTableName)
throws IOException
hbaseConfiguration - the chbaseTableName - the table
IOException - Signals that an I/O exception has occurred.
protected byte[] getByteArrayFromInputStream(org.archive.io.ReplayInputStream replayInputStream,
int streamSize)
throws IOException
replayInputStream - the ris the cell data as a replay input streamstreamSize - the size
IOException - Signals that an I/O exception has occurred.
protected void processContent(org.apache.hadoop.hbase.client.Put put,
org.archive.io.ReplayInputStream replayInputStream,
int streamSize)
throws IOException
put - the stateful put object containing all the row data to be
written.replayInputStream - the replay input stream containing the raw content gotten by
heritrix crawler.streamSize - the stream size
IOException - Signals that an I/O exception has occurred.
public void write(org.archive.modules.CrawlURI curi,
String ip,
org.archive.io.RecordingOutputStream recordingOutputStream,
org.archive.io.RecordingInputStream recordingInputStream)
throws IOException
curi - URI of crawled documentip - IP of remote machine.recordingOutputStream - recording input stream that captured the responserecordingInputStream - recording output stream that captured the GET request
IOException - Signals that an I/O exception has occurred.public byte[] serialize(byte[] bytes)
Serializer
serialize in interface Serializerbytes - the bytes
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||