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

fixes #105: Reported cache max size #107

Merged
merged 1 commit into from
Nov 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions changelog.html
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ <h1>

<p><b>3.0.1</b> -- (To be determined)</p>
<ul>
<li>[<a href='https://github.com/igniterealtime/openfire-hazelcast-plugin/issues/105'>Issue #105</a>] - Maximum cache size (in bytes) incorrectly reported</li>
<li>[<a href='https://github.com/igniterealtime/openfire-hazelcast-plugin/issues/103'>Issue #103</a>] - Fix Cluster initialization race condition</li>
<li>[<a href='https://github.com/igniterealtime/openfire-hazelcast-plugin/issues/102'>Issue #102</a>] - Remove unused code in ClusterListener</li>
</ul>
Expand Down
2 changes: 1 addition & 1 deletion plugin.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<description>${project.description}</description>
<author>Ignite Realtime</author>
<version>${project.version}</version>
<date>2024-11-02</date>
<date>2024-11-05</date>
<minServerVersion>4.8.1</minServerVersion>
<minJavaVersion>1.8</minJavaVersion>
</plugin>
Original file line number Diff line number Diff line change
Expand Up @@ -302,6 +302,15 @@ public String getCacheSizeRemark() {

@Override
public long getMaxCacheSize() {
final int size = config.getEvictionConfig().getSize();
if (size == Integer.MAX_VALUE) {
return -1; // Hazelcast doesn't use negative values.
}

if (getCapacityUnit() != null && getCapacityUnit() == CapacityUnit.BYTES) {
return config.getEvictionConfig().getSize() * 1024 * 1024L; // Hazelcast stores this as megabyte, not byte.
}

return config.getEvictionConfig().getSize();
}

Expand Down