CORDA-929 Attachment caching (#2372)

* ENT-1403 Cache node attachments (and attachment content)

* ENT-1403 Make cache sizes configurable

* Update documentation with new config parameters

* Test that non-existence of attachments is not cached

* Remove unneeded defaults in interface

* It turned out we need the defaults on the interface in quite a few tests

* Codereview: typos, size in MB rather than bytes, charset in tests, move concurrencyLevel to a constant

* Codereview: Make the internal config value bytes again, but config file in MB

* Fix example config unit test
This commit is contained in:
Christian Sailer
2018-01-22 13:41:06 +00:00
committed by GitHub
parent 4a3379ac8a
commit 8d5611853a
7 changed files with 151 additions and 19 deletions

View File

@ -1,12 +1,15 @@
package net.corda.docs
import net.corda.node.services.config.ConfigHelper
import net.corda.node.services.config.NodeConfiguration
import net.corda.node.services.config.parseAsNodeConfiguration
import net.corda.verifier.Verifier
import org.junit.Test
import java.nio.file.Path
import java.nio.file.Paths
import kotlin.reflect.KVisibility
import kotlin.reflect.full.declaredMemberProperties
import kotlin.reflect.jvm.isAccessible
class ExampleConfigTest {
@ -17,14 +20,16 @@ class ExampleConfigTest {
val config = loadConfig(Paths.get(configFileResource.toURI()))
// Force the config fields as they are resolved lazily
config.javaClass.kotlin.declaredMemberProperties.forEach { member ->
member.get(config)
if (member.visibility == KVisibility.PUBLIC) {
member.get(config)
}
}
}
}
@Test
fun `example node_confs parses fine`() {
readAndCheckConfigurations(
readAndCheckConfigurations<NodeConfiguration>(
"example-node.conf",
"example-out-of-process-verifier-node.conf",
"example-network-map-node.conf"