简体   繁体   English

如何重新加载谷歌番石榴缓存

[英]How to reload google guava cache

我正在研究dropwizard-java项目,直到谷歌番石榴缓存功能我都有代码。一旦将值写入文件,我需要更新缓存。当我打开某个路径时,它应该更新服务器中的缓存而无需重新启动。如果有人知道,请帮助我编写用于重新加载缓存的代码。

There are various ways to do this but if you are synchronously writing a file and then want to update your Guava Cache to load that file then you can use direct insertion . 有多种方法可以执行此操作,但是如果您正在同步写入文件,然后想要更新Guava缓存以加载该文件,则可以使用直接插入

For alternative population methods and more details see CachesExplained · google/guava Wiki . 有关替代填充方法和更多详细信息,请参见CachesExplained·google / guava Wiki

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM