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

ISPN-5345 Allow eviction for based on approximation of size compared to element count #3492

Closed
wants to merge 1 commit into from

Conversation

tristantarrant
Copy link
Member

https://issues.jboss.org/browse/ISPN-5345

  • Added in size calculation for byte[] key/value pairs with LRU

This supersedes' @wburns #3467 and introduces the following changes:

  • add type=COUNT|MEMORY to choose how to evict entries
  • add size which replaces maxEntries and works for both types
  • add a warning when not running under HotSpot
  • add a MemoryUnit utility class inspired by TimeUnit

@danberindei
Copy link
Member

@tristantarrant I liked your previous suggestion much better... I'd rather have two different attributes/elements with clear names than a generic thresholdSize that doesn't say anything.

To add yet another suggestion: How about deprecating the <eviction max-entries="x"/> element and adding <eviction-count max-entries="x"/> and <eviction-memory max-size="x"/> to replace it? Would that complicate things too much?

@tristantarrant
Copy link
Member Author

Supporting that for embedded is reasonable, it is server which always causes head-scratching and pain, since we need to think about how to represent those "nodes" in the management model in a non ambiguous way

@tristantarrant
Copy link
Member Author

@danberindei using type and size now

@tristantarrant
Copy link
Member Author

CI failures are unrelated

@@ -66,6 +66,7 @@
MAX_IDLE("max-idle"),
MAX_RETRIES("max-retries"),
MAX_THREADS("max-threads"),
MEMORY_BASED_APPROXIMATION("memory-based"),
Copy link
Member

Choose a reason for hiding this comment

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

You can remove these

@tristantarrant
Copy link
Member Author

They are gone

}

public EvictionType thresholdPolicy() {
return type.get();
Copy link
Member

Choose a reason for hiding this comment

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

Should be size() and type()

@tristantarrant
Copy link
Member Author

Silly, me, fixed now

element count

* Added in size calculation for byte[] key/value pairs with LRU
@danberindei
Copy link
Member

Integrated, thanks Tristan!

@tristantarrant tristantarrant deleted the ISPN-5345 branch December 14, 2015 14:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants