public class JournalCompactor extends AbstractJournalUpdateTask implements JournalRecordProvider
currentFile, FILE_COMPACT_CONTROL, fileFactory, filesRepository, journal, newDataFiles, nextOrderingID, sequentialFile
Constructor and Description |
---|
JournalCompactor(SequentialFileFactory fileFactory,
JournalImpl journal,
JournalFilesRepository filesRepository,
Set<Long> recordsSnapshot,
long firstFileID) |
Modifier and Type | Method and Description |
---|---|
void |
addCommandCommit(JournalTransaction liveTransaction,
JournalFile currentFile) |
void |
addCommandDelete(long id,
JournalFile usedFile) |
void |
addCommandRollback(JournalTransaction liveTransaction,
JournalFile currentFile) |
void |
addCommandUpdate(long id,
JournalFile usedFile,
int size) |
void |
addPendingTransaction(long transactionID,
long[] ids)
This methods informs the Compactor about the existence of a pending (non committed) transaction
|
JournalCompactor |
getCompactor() |
List<JournalFile> |
getNewDataFiles() |
Map<Long,JournalRecord> |
getNewRecords() |
Map<Long,JournalTransaction> |
getNewTransactions() |
Map<Long,JournalRecord> |
getRecords() |
void |
markAsDataFile(JournalFile file) |
void |
onReadAddRecord(RecordInfo info) |
void |
onReadAddRecordTX(long transactionID,
RecordInfo info) |
void |
onReadCommitRecord(long transactionID,
int numberOfRecords) |
void |
onReadDeleteRecord(long recordID) |
void |
onReadDeleteRecordTX(long transactionID,
RecordInfo info) |
void |
onReadPrepareRecord(long transactionID,
byte[] extraData,
int numberOfRecords) |
void |
onReadRollbackRecord(long transactionID) |
void |
onReadUpdateRecord(RecordInfo info) |
void |
onReadUpdateRecordTX(long transactionID,
RecordInfo info) |
static SequentialFile |
readControlFile(SequentialFileFactory fileFactory,
List<String> dataFiles,
List<String> newFiles,
List<Pair<String,String>> renameFile) |
void |
replayPendingCommands()
Replay pending counts that happened during compacting
|
addToRecordsSnaptshot, flush, getWritingChannel, lookupRecord, openFile, writeControlFile, writeEncoder, writeEncoder
public JournalCompactor(SequentialFileFactory fileFactory, JournalImpl journal, JournalFilesRepository filesRepository, Set<Long> recordsSnapshot, long firstFileID)
public static SequentialFile readControlFile(SequentialFileFactory fileFactory, List<String> dataFiles, List<String> newFiles, List<Pair<String,String>> renameFile) throws Exception
Exception
public List<JournalFile> getNewDataFiles()
public Map<Long,JournalRecord> getNewRecords()
public Map<Long,JournalTransaction> getNewTransactions()
public void addPendingTransaction(long transactionID, long[] ids)
public void addCommandCommit(JournalTransaction liveTransaction, JournalFile currentFile)
public void addCommandRollback(JournalTransaction liveTransaction, JournalFile currentFile)
public void addCommandDelete(long id, JournalFile usedFile)
id
- usedFile
- public void addCommandUpdate(long id, JournalFile usedFile, int size)
id
- usedFile
- public void replayPendingCommands()
public void onReadAddRecord(RecordInfo info) throws Exception
onReadAddRecord
in interface JournalReaderCallback
Exception
public void onReadAddRecordTX(long transactionID, RecordInfo info) throws Exception
onReadAddRecordTX
in interface JournalReaderCallback
Exception
public void onReadCommitRecord(long transactionID, int numberOfRecords) throws Exception
onReadCommitRecord
in interface JournalReaderCallback
Exception
public void onReadDeleteRecord(long recordID) throws Exception
onReadDeleteRecord
in interface JournalReaderCallback
Exception
public void onReadDeleteRecordTX(long transactionID, RecordInfo info) throws Exception
onReadDeleteRecordTX
in interface JournalReaderCallback
Exception
public void markAsDataFile(JournalFile file)
markAsDataFile
in interface JournalReaderCallback
public void onReadPrepareRecord(long transactionID, byte[] extraData, int numberOfRecords) throws Exception
onReadPrepareRecord
in interface JournalReaderCallback
Exception
public void onReadRollbackRecord(long transactionID) throws Exception
onReadRollbackRecord
in interface JournalReaderCallback
Exception
public void onReadUpdateRecord(RecordInfo info) throws Exception
onReadUpdateRecord
in interface JournalReaderCallback
Exception
public void onReadUpdateRecordTX(long transactionID, RecordInfo info) throws Exception
onReadUpdateRecordTX
in interface JournalReaderCallback
Exception
public JournalCompactor getCompactor()
getCompactor
in interface JournalRecordProvider
public Map<Long,JournalRecord> getRecords()
getRecords
in interface JournalRecordProvider
Copyright © 2012 JBoss by Red Hat. All Rights Reserved.