Skip to content

Latest commit

 

History

History
69 lines (56 loc) · 2.5 KB

README.adoc

File metadata and controls

69 lines (56 loc) · 2.5 KB

Chronicle Collections Spring Utils

Chronicle Map

Chronicle Maps can be configured by setting properties in Spring. These properties correspond with the properties the ChronicleMapBuilder class uses to create and configure a ChronicleMap.

This is all you need to create a fully configured Chronicle Map
---
<bean id="map" class="com.thecitysecret.util.spring.chronicle.ChronicleMapFactoryBean">
    <constructor-arg name="keyClass" value="java.lang.Integer"/>
    <constructor-arg name="valueClass" value="java.lang.String"/>
</bean>
---
In memory map
---
<bean id="map" class="com.thecitysecret.util.spring.chronicle.ChronicleMapFactoryBean">
    <constructor-arg name="keyClass" value="java.lang.Integer"/>
    <constructor-arg name="valueClass" value="java.lang.String"/>
    <property name="entries" value="3000000"/>
</bean>
---
Map persisted to file
---
<bean id="map" class="com.thecitysecret.util.spring.chronicle.ChronicleMapFactoryBean">
    <constructor-arg name="keyClass" value="java.lang.Integer"/>
    <constructor-arg name="valueClass" value="java.lang.String"/>
    <property name="entries" value="3000000"/>
    <property name="dataFilePath" value="/my/data/file/path"/>
</bean>
---

The ChronicleMapBuilder documentation can be found here:

Chronicle Queue

Chronicle Queues can also be configured by setting properties in Spring. These properties correspond with the properties the ChronicleQueueBuilder (Indexed & Vanilla) class uses to create and configure a ChronicleQueue. Both builders require a String file path to be created.

This is the most basic setup needed to create a Chronicle Queue (the INDEXED value can be changed to VANILLA)
---
<bean id="queue" class="com.thecitysecret.util.spring.chronicle.ChronicleQueueFactoryBean">
    <property name="path" value="/a/file/path"/>
    <property name="queueType" value="INDEXED"/>
</bean>
---
The queue can be configured by passing properties to the queue bean e.g. cacheLineSize
---
<bean id="queue" class="com.thecitysecret.util.spring.chronicle.ChronicleQueueFactoryBean">
    <property name="path" value="/a/file/path"/>
    <property name="queueType" value="VANILLA"/>
    <property name="cacheLineSize" value="128"/>
</bean>
---

The ChronicleQueueBuilder documentation can be found here: