Skip to content

Commit

Permalink
Merge pull request #3056 from nnares/doc-upd
Browse files Browse the repository at this point in the history
feature-25363 : Deprecating size based cache at heap tier - updating user doc
  • Loading branch information
chrisdennis committed Aug 17, 2022
2 parents c09439b + 55f1961 commit b38e966
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 9 deletions.
4 changes: 0 additions & 4 deletions docs/src/docs/asciidoc/user/getting-started.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -258,10 +258,6 @@ A number of advanced topics that were discussed here have been moved out, see be

See <<usermanaged.adoc#,the user managed cache documentation>> for more information on this feature.

=== Byte-sized heap

See the <<tiering.adoc#byte-sized-heap,relevant section>> in the tiering documentation for more information on this feature.

=== Update ResourcePools

See the <<tiering.adoc#update-resourcepools,relevant section>> in the tiering documentation for more information on this feature.
Expand Down
2 changes: 2 additions & 0 deletions docs/src/docs/asciidoc/user/performance.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,8 @@ hit ratio of 50% or less is going to slow down the cache. Either enlarge such ti

== Byte Sizing

WARNING: Byte based heap resources are deprecated and will be removed in a future version.

A on-heap tier can be limited to a number of entries or a number of bytes.
When using bytes, we need to calculate the size of every object added to the cache.
This is of course much slower than calculating the number of entries.
Expand Down
4 changes: 1 addition & 3 deletions docs/src/docs/asciidoc/user/tiering.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -62,18 +62,16 @@ Here we use off-heap only.
The starting point of every cache and also the faster since no serialization is necessary.
You can optionally use copiers (see the section <<serializers-copiers.adoc#copiers,Serializers and Copiers>>) to pass keys and values by-value, the default being by-reference.

A heap tier can be sized by entries or by size.

[source%nowrap,java,indent=0]
----
include::{sourcedir310}/ehcache-impl/src/test/java/org/ehcache/docs/Tiering.java[tag=heap]
----

<1> Only 10 entries allowed on heap. Eviction will occur when full.
<2> A shortcut to specify 10 entries.
<3> Only 10 MB allowed. Eviction will occur when full.

==== Byte-sized heap
WARNING: Byte based heap resources are deprecated and will be removed in a future version.

For every tier except the heap tier, calculating the size of the cache is fairly easy.
You more or less sum the size of all byte buffers containing the serialized entries.
Expand Down
2 changes: 0 additions & 2 deletions ehcache-impl/src/test/java/org/ehcache/docs/Tiering.java
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,6 @@ public void tierSizing() {
ResourcePoolsBuilder.newResourcePoolsBuilder().heap(10, EntryUnit.ENTRIES); // <1>
// or
ResourcePoolsBuilder.heap(10); // <2>
// or
ResourcePoolsBuilder.newResourcePoolsBuilder().heap(10, MemoryUnit.MB); // <3>
// end::heap[]
// tag::offheap[]
ResourcePoolsBuilder.newResourcePoolsBuilder().offheap(10, MemoryUnit.MB); // <1>
Expand Down

0 comments on commit b38e966

Please sign in to comment.