public class StatusMaker extends Object
| Constructor and Description |
|---|
StatusMaker(Connector conn) |
| Modifier and Type | Method and Description |
|---|---|
protected boolean |
addOrderRecord(org.apache.hadoop.io.Text file,
org.apache.hadoop.io.Text tableId,
Replication.Status stat,
Value value)
Create a record to track when the file was closed to ensure that replication preference is given to files that have been closed the longest and allow the
work assigner to try to replicate in order that data was ingested (avoid replay in different order)
|
protected boolean |
addStatusRecord(org.apache.hadoop.io.Text file,
org.apache.hadoop.io.Text tableId,
Value v)
Create a status record in the replication table
|
protected void |
deleteStatusRecord(Key k)
Because there is only one active Master, and thus one active StatusMaker, the only safe time that we can issue the delete for a Status which is closed is
immediately after writing it to the replication table.
|
void |
run() |
protected void |
setBatchWriter(BatchWriter bw) |
void |
setSourceTableName(String table)
Not for public use -- visible only for testing
|
public StatusMaker(Connector conn)
public void setSourceTableName(String table)
Used to read records from a table other than 'metadata'
table - The table to read frompublic void run()
protected void setBatchWriter(BatchWriter bw)
protected boolean addStatusRecord(org.apache.hadoop.io.Text file,
org.apache.hadoop.io.Text tableId,
Value v)
protected boolean addOrderRecord(org.apache.hadoop.io.Text file,
org.apache.hadoop.io.Text tableId,
Replication.Status stat,
Value value)
file - File being replicatedtableId - Table ID the file was used bystat - Status msgvalue - Serialized version of the Status msgprotected void deleteStatusRecord(Key k)
If we try to defer and delete these entries in another thread/process, we will have no assurance that the Status message was propagated to the replication table. It is easiest, in terms of concurrency, to do this all in one step.
k - The Key to deleteCopyright © 2011–2018 The Apache Software Foundation. All rights reserved.