A library that uses Hazelcast for caching on MultiPaper.
Simply add this plugin into one MultiPaper node and add this into multipaper.yml
:
filesToSyncOnStartup:
- plugins/MultiCache.jar
- plugins/MultiCache/hazelcast.yml
Then just restart all servers.
Make sure to replace [LATEST]
with the latest version according to the badge above.
<repositories>
<repository>
<id>jitpack</id>
<url>https://jitpack.io/</url>
</repository>
</repositories>
<dependencies>
<dependency>
<groupId>com.github.pestonotpasta</groupId>
<artifactId>MultiCache</artifactId>
<version>[LATEST]</version>
<scope>provided</scope>
</dependency>
</dependencies>
repositories {
maven { url "https://jitpack.io/"}
}
dependencies {
compileOnly "com.github.pestonotpasta:multicache:[LATEST]"
}
Note: Remember to include the dependency into your plugin.yml
depend: [MultiCache]
The MultiCache api is a singleton and can be accessed like so:
MultiCache multiCache = MultiCache.getInstance();
HazelcastInstance hz = multiCache.getHazelcast();
IMap map = hz.getMap("my-distributed-map");
map.put("name", "Pesto");
map.get("name");