Any hello world type examples for Chronicle Map?

1,115 views
Skip to first unread message

Dino Fancellu

unread,
Oct 3, 2014, 12:31:10 PM10/3/14
to java-ch...@googlegroups.com
Saw some code in the various video talks, but couldn't see anything really obvious on here


e.g. producer/consumer, one thing storing, another reading. 

Just a little app to show me that my chronicle is working, persisting etc.

Thanks.

Dino.

Peter Lawrey

unread,
Oct 3, 2014, 2:41:30 PM10/3/14
to java-ch...@googlegroups.com

I would start simple with the Map interface.

To write/persist.

map.put (key, value);

When put returns it has been committed.

To read

Type value = map.get (key);

There is more advanced examples which avoid creating garbage and serialization. We also support entry level locking shared across processes.

You can also look at the keySet () or enteySet ()

--
You received this message because you are subscribed to the Google Groups "Chronicle" group.
To unsubscribe from this group and stop receiving emails from it, send an email to java-chronicl...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Dino Fancellu

unread,
Oct 3, 2014, 3:20:00 PM10/3/14
to java-ch...@googlegroups.com
You said there are more advanced examples. Where would they be?

Just a handful of tiny apps that show Chronicle Map in action would
help clarify usage. Then its monkey see, monkey do.

The trouble with having created Chronicle is that of course it is all
obvious to you.

Thanks.

Dino.
> You received this message because you are subscribed to a topic in the
> Google Groups "Chronicle" group.
> To unsubscribe from this topic, visit
> https://groups.google.com/d/topic/java-chronicle/6FFdlmxmDg0/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to

Rob Austin

unread,
Oct 3, 2014, 3:24:08 PM10/3/14
to java-ch...@googlegroups.com
have you looked at the readme.md on https://github.com/OpenHFT/Chronicle-Map#ReadMe.md

William Narmontas

unread,
Oct 3, 2014, 3:32:46 PM10/3/14
to java-ch...@googlegroups.com
I think Dino has something closer to this in mind:

Full self contained example. Can see any edge cases. No unnecessary assumptions made.

I was very impressed with Peter's talk on Parleys. He knows his stuff!

Dino Fancellu

unread,
Oct 3, 2014, 4:46:30 PM10/3/14
to java-ch...@googlegroups.com
Of course. The whole thing. It does not give a standalone example. It
has excerpts from the API.

I've managed to get some stuff persisting, reading back etc. But the
API is quite large and simply doesn't have much in the way of examples
that I can see. i.e. zero.

I'm not comfortable jabbing the API randomly and hoping I'm doing
things properly, especially when trying to achieve high performance

e.g. Some docs from one of my little projects

https://github.com/fancellu/xqs

The more you know about Chronicle the less obvious is the need for
examples. I know very very little about Chronicle, so can see the
need.

Dino.

Peter Lawrey

unread,
Oct 3, 2014, 4:54:23 PM10/3/14
to java-ch...@googlegroups.com

This is why I would start with the Map interface as this should be familiar to you already.

Rob Austin

unread,
Oct 3, 2014, 4:57:52 PM10/3/14
to java-ch...@googlegroups.com
If you simply wish to share a map between to or more processes on the same machine, I can send you an example of how to do that.

Otherwise, If you could let me know what you wish to do, I can send you the appropriate example.

Rob

William Narmontas

unread,
Oct 3, 2014, 4:59:25 PM10/3/14
to java-ch...@googlegroups.com

Peter Lawrey

unread,
Oct 3, 2014, 5:14:58 PM10/3/14
to java-ch...@googlegroups.com

ConcurrentMap is a standard interface and you can use it the same on hazelcast, chronicle or plain core java. The only difference is the in Chronicle you create/configure the Map from Java.
We are looking to migrate chronicle to supporting file based configuration as the preferred option but it will behave as it does now once created.

It is only when you look at non - standard options do they diverge but I would leave those to when you have the basic examples working.

Reply all
Reply to author
Forward
0 new messages