Class StatusMaker
- java.lang.Object
-
- org.apache.accumulo.master.replication.StatusMaker
-
public class StatusMaker extends Object
Reads replication records from the metadata table and creates status records in the replication table. Deletes the record from the metadata table when it's closed.
-
-
Constructor Summary
Constructors Constructor Description StatusMaker(AccumuloClient client, VolumeManager fs)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected booleanaddOrderRecord(org.apache.hadoop.io.Text file, TableId 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 booleanaddStatusRecord(org.apache.hadoop.io.Text file, TableId tableId, Value v)Create a status record in the replication tableprotected voiddeleteStatusRecord(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.voidrun()voidsetSourceTableName(String table)Not for public use -- visible only for testing
-
-
-
Constructor Detail
-
StatusMaker
public StatusMaker(AccumuloClient client, VolumeManager fs)
-
-
Method Detail
-
setSourceTableName
public void setSourceTableName(String table)
Not for public use -- visible only for testingUsed to read records from a table other than 'metadata'
- Parameters:
table- The table to read from
-
run
public void run()
-
addStatusRecord
protected boolean addStatusRecord(org.apache.hadoop.io.Text file, TableId tableId, Value v)Create a status record in the replication table
-
addOrderRecord
protected boolean addOrderRecord(org.apache.hadoop.io.Text file, TableId 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)- Parameters:
file- File being replicatedtableId- Table ID the file was used bystat- Status msgvalue- Serialized version of the Status msg
-
deleteStatusRecord
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.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.
- Parameters:
k- The Key to delete
-
-