Can I control storage size in Berkeley DB JE?

482 views Asked by At

I want to use Berkeley DB JE like a disk cache for my application. And max size of cache should be 30 Gb. That is why I need to control it.

  • Is it any ways to know the size of storage from the code (Java)?
  • Can I use clearing algorithm like a LRU and Berkeley will clear the db when storage size is over 30 gb?
  • Maybe some useful information about it?

And, yes, I already read oracle docs (and didn't find needed info).

1

There are 1 answers

0
hflzh On

If you're using Berkeley DB JE 7.5.11 or later releases, you may want to take a look at the setMaxDisk(long totalBytes) API, which could be used to set the upper limit for your data storage.