Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ARTEMIS-1822: Change the method name 'lookupRecord' to 'containsRecord'. #2037

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Expand Up @@ -222,7 +222,7 @@ public void flush() throws Exception {
writingChannel = null;
}

public boolean lookupRecord(final long id) {
public boolean containsRecord(final long id) {
return recordsSnapshot.contains(id);
}

Expand Down
Expand Up @@ -221,7 +221,7 @@ public void onReadAddRecord(final RecordInfo info) throws Exception {
if (logger.isTraceEnabled()) {
logger.trace("Read Record " + info);
}
if (lookupRecord(info.id)) {
if (containsRecord(info.id)) {
JournalInternalRecord addRecord = new JournalAddRecord(true, info.id, info.getUserRecordType(), EncoderPersister.getInstance(), new ByteArrayEncoding(info.data));
addRecord.setCompactCount((short) (info.compactCount + 1));

Expand All @@ -238,7 +238,7 @@ public void onReadAddRecordTX(final long transactionID, final RecordInfo info) t
if (logger.isTraceEnabled()) {
logger.trace("Read Add Recprd TX " + transactionID + " info " + info);
}
if (pendingTransactions.get(transactionID) != null || lookupRecord(info.id)) {
if (pendingTransactions.get(transactionID) != null || containsRecord(info.id)) {
JournalTransaction newTransaction = getNewJournalTransaction(transactionID);

JournalInternalRecord record = new JournalAddRecordTX(true, transactionID, info.id, info.getUserRecordType(), EncoderPersister.getInstance(),new ByteArrayEncoding(info.data));
Expand Down Expand Up @@ -370,7 +370,7 @@ public void onReadUpdateRecord(final RecordInfo info) throws Exception {
logger.trace("onReadUpdateRecord " + info);
}

if (lookupRecord(info.id)) {
if (containsRecord(info.id)) {
JournalInternalRecord updateRecord = new JournalAddRecord(false, info.id, info.userRecordType, EncoderPersister.getInstance(), new ByteArrayEncoding(info.data));

updateRecord.setCompactCount((short) (info.compactCount + 1));
Expand All @@ -395,7 +395,7 @@ public void onReadUpdateRecordTX(final long transactionID, final RecordInfo info
logger.trace("onReadUpdateRecordTX " + info);
}

if (pendingTransactions.get(transactionID) != null || lookupRecord(info.id)) {
if (pendingTransactions.get(transactionID) != null || containsRecord(info.id)) {
JournalTransaction newTransaction = getNewJournalTransaction(transactionID);

JournalInternalRecord updateRecordTX = new JournalAddRecordTX(false, transactionID, info.id, info.userRecordType, EncoderPersister.getInstance(), new ByteArrayEncoding(info.data));
Expand Down
Expand Up @@ -993,7 +993,7 @@ public void run() {
}

private void checkKnownRecordID(final long id) throws Exception {
if (records.containsKey(id) || pendingRecords.contains(id) || (compactor != null && compactor.lookupRecord(id))) {
if (records.containsKey(id) || pendingRecords.contains(id) || (compactor != null && compactor.containsRecord(id))) {
return;
}

Expand All @@ -1008,7 +1008,7 @@ public void run() {

known.set(records.containsKey(id)
|| pendingRecords.contains(id)
|| (compactor != null && compactor.lookupRecord(id)));
|| (compactor != null && compactor.containsRecord(id)));
} finally {
journalLock.readLock().unlock();
}
Expand Down
Expand Up @@ -250,7 +250,7 @@ public void commit(final JournalFile file) {
for (JournalUpdate trUpdate : pos) {
JournalRecord posFiles = journal.getRecords().get(trUpdate.id);

if (compactor != null && compactor.lookupRecord(trUpdate.id)) {
if (compactor != null && compactor.containsRecord(trUpdate.id)) {
// This is a case where the transaction was opened after compacting was started,
// but the commit arrived while compacting was working
// We need to cache the counter update, so compacting will take the correct files when it is done
Expand Down