1

Is there any way to update the expiry legnth for a cache that is already created in ignite? like I create this cache and set expiry policy as 5-day length, after some time I want to make the cache expiry policy to 10-day length.

I prefer to not destroy the cache and recreate it, since the data will be lost if doing so.

Vincent Y
  • 109
  • 6

1 Answers1

0

Unfortunately you can't update the default expiry time, but you can set the TTL for each row individually:

        var table = ignite.cache("MY_CACHE");
        table.withExpiryPolicy(new CreatedExpiryPolicy(Duration.FIVE_MINUTES))
                .put(1L, 2.0d);
        table.withExpiryPolicy(new TouchedExpiryPolicy(Duration.ONE_HOUR))
                .put(2L, 4.0d);
Stephen Darlington
  • 51,577
  • 12
  • 107
  • 152