New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

xyz.ronella.gosu:gcache

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

xyz.ronella.gosu:gcache

A simple gosu implementation of concurrent LRU Map.

  • 1.1.0
  • Source
  • Maven
  • Socket score

Version published
Maintainers
1
Source

GCache

A simple gosu implementation of concurrent LRU Map.

Public Constructors

Constructors
ConcurrentLRUCache<TYPE_KEY, TYPE_VALUE>(code : String, maxSize : int, evictLogic : BiConsumer<String, Map.Entry<TYPE_KEY, TYPE_VALUE>>)
ConcurrentLRUCache<TYPE_KEY, TYPE_VALUE>(code : String, maxSize : int, losslessLogic : ILosslessLogic<TYPE_KEY, TYPE_VALUE>)
ConcurrentLRUCache<TYPE_KEY, TYPE_VALUE>(code : String, maxSize : int)
ConcurrentLRUCache<TYPE_KEY, TYPE_VALUE>(maxSize : int, evictLogic : BiConsumer<String,Map.Entry<TYPE_KEY, TYPE_VALUE>>)
ConcurrentLRUCache<TYPE_KEY, TYPE_VALUE>(maxSize : int)
Constructor Parameters
ParameterTypeDefaultDescription
codeStringdefaultThe code that groups the Map.Entry.
maxSizeintThe maximum key count of a particular code group in memory. Anything beyond this limit will trigger either the evictLogic or the losslessLogic.
evictLogicBiConsumer<String, Map.Entry<TYPE_KEY, TYPE_VALUE>>A custom eviction logic.
losslessLogicILosslessLogic<TYPE_KEY, TYPE_VALUE>DefaultLosslessLogic<TYPE_KEY, TYPE_VALUE>An implementation of ILosslessLogic.

Proprietary Methods

MethodDescription
public function memCacheSize() : intReturns the size of cache in memory.
public function memCachedKeys() : Set<TYPE_KEY>Returns the keys in memory.
public function memCachedValues() : Collection<TYPE_VALUE>Returns the values in memory.

DefaultLosslessLogic<TYPE_KEY, TYPE_VALUE> Class

An implementation of ILosslessLogic<TYPE_KEY, TYPE_VALUE> that only accepts String as the key and Value that must be tag as Serializable. The work of this class will only start if the maxSize key allocated for memory storage was exceeded. If the key counts is beyond the maxSize indicated, all the key entries that are not used will be serialized to the location defined by the environment variable GCACHE_DIR or if it is not present to your <TMP_DIR>\gcache directory. The extension name of a serialized objects is ser.

Usage

  1. Add the following maven dependency to your gosu project:

    PropertyValue
    Group IDxyz.ronella.gosu
    Artifact IDgcache
    Version1.1.0

    Using gradle, this can be added as a dependency entry like the following:

    compile group: 'xyz.ronella.gosu', name: 'gcache', version: '1.1.0'
    
  2. On your code, once an instance of ConcurrentLRUCache was created, use it like you are using an instance of a Map.

License

This project is licensed under the MIT License - see the LICENSE.md file for details

Build

Changelog

Author

  • Ronaldo Webb

FAQs

Package last updated on 19 Mar 2020

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc