Skip to content
This repository has been archived by the owner on Aug 23, 2020. It is now read-only.

Ability to toggle cache on/off #1706

Open
wants to merge 2 commits into
base: cache
Choose a base branch
from

Conversation

acha-bill
Copy link
Contributor

Description

Because we want to run JMH tests in cache on/off states, we need to check if cache is null for when it's off.

Type of change

  • Enhancement (a non-breaking change which adds functionality)

How Has This Been Tested?

  • Existing unit tests pass

Checklist:

  • My code follows the style guidelines for this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas

@acha-bill acha-bill changed the title Cache benchmark Ability to toggle cache on/off Jan 12, 2020

Cache<Indexable, TransactionViewModel> cache = tangle.getCache(TransactionViewModel.class);
if (cache != null) {
if (cache.get(hash) == null) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

import com.iota.iri.model.persistables.ObsoleteTag;
import com.iota.iri.model.persistables.Tag;
import com.iota.iri.model.persistables.Transaction;
import com.iota.iri.model.persistables.*;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

import java.util.HashMap;
import java.util.HashSet;

import org.junit.*;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Comment on lines +100 to +102
if (cache == null) {
return true;
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So store doesn't do anything?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants