13.5.2. LevelDB Cache Store Programmatic Configuration


The following is a sample programmatic configuration of LevelDB Cache Store.

Procedure 13.6. LevelDB Cache Store programmatic configuration

  1. Create a New Configuration Builder

    Use the ConfigurationBuilder to create a new configuration object.
    Configuration cacheConfig = new ConfigurationBuilder().persistence()
    
  2. Add the LevelDBStoreConfigurationBuilder Store

    Add the store to the LevelDBCacheStoreConfigurationBuilder instance to build its configuration.
    Configuration cacheConfig = new ConfigurationBuilder().persistence()
                    .addStore(LevelDBStoreConfigurationBuilder.class)
    
  3. Set Up Location

    Set the LevelDB Cache Store location path. The specified path stores the primary cache store data. The directory is automatically created if it does not exist.
    Configuration cacheConfig = new ConfigurationBuilder().persistence()
                    .addStore(LevelDBStoreConfigurationBuilder.class)
                    .location("/tmp/leveldb/data")
    
  4. Set Up Expired Location

    Specify the location for expired data using the expiredLocation parameter for the LevelDB Store. The specified path stores expired data before it is purged. The directory is automatically created if it does not exist.
    Configuration cacheConfig = new ConfigurationBuilder().persistence()
                    .addStore(LevelDBStoreConfigurationBuilder.class)
                    .location("/tmp/leveldb/data")
                    .expiredLocation("/tmp/leveldb/expired").build();
    

Note

Programmatic configurations can only be used with Red Hat JBoss Data Grid Library mode.
Red Hat logoGithubRedditYoutubeTwitter

Learn

Try, buy, & sell

Communities

About Red Hat Documentation

We help Red Hat users innovate and achieve their goals with our products and services with content they can trust.

Making open source more inclusive

Red Hat is committed to replacing problematic language in our code, documentation, and web properties. For more details, see the Red Hat Blog.

About Red Hat

We deliver hardened solutions that make it easier for enterprises to work across platforms and environments, from the core datacenter to the network edge.

© 2024 Red Hat, Inc.