Skip to content

Commit 8506cde

Browse files
committed
Better ChronicleMap configuration
1 parent 5529c39 commit 8506cde

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

src/main/java/com/example/MyMap.java

+3-4
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
import javax.annotation.PreDestroy;
88

99
import net.openhft.chronicle.map.ChronicleMap;
10-
import net.openhft.chronicle.map.ChronicleMapBuilder;
1110

1211
public class MyMap
1312
{
@@ -33,9 +32,9 @@ protected MyMap(String path, String filename)
3332
@PostConstruct
3433
protected void initialize() throws IOException
3534
{
36-
chronicle = ChronicleMapBuilder.of(String.class, String.class)
37-
.averageKeySize(AVERAGE_KEY_AND_VALUE.getBytes().length)
38-
.averageValueSize(AVERAGE_KEY_AND_VALUE.getBytes().length)
35+
chronicle = ChronicleMap.of(String.class, String.class)
36+
.averageKey(AVERAGE_KEY_AND_VALUE)
37+
.averageValue(AVERAGE_KEY_AND_VALUE)
3938
.entries(MAX_SIZE)
4039
.createPersistedTo(file);
4140
}

0 commit comments

Comments
 (0)