VanillaQueue Affinity Exception on Windows

52 views
Skip to first unread message

Neil Avery

unread,
Nov 14, 2015, 10:09:12 AM11/14/15
to Chronicle
All,
I'm trying to fire up VanillaQueue on Windows-7, Java8-x64 but getting an Exception on NullAffinity. Note: I need the VanillaQueue to support concurrent Appenders.
	at net.openhft.affinity.impl.NullAffinity.getThreadId(NullAffinity.java:56)

Delving a bit deeper I inspect the WindowsJNA and get the following error:
java.lang.NoClassDefFoundError: Could not initialize class net.openhft.affinity.impl.WindowsJNAAffinity$CLibrary
	at net.openhft.affinity.impl.WindowsJNAAffinity.getAffinity(WindowsJNAAffinity.java:48)
	at net.openhft.affinity.Affinity.getThreadId(Affinity.java:170)

Am I doing something wrong? I'm not sure why it wouldnt load so any ideas or suggestion are very much appreciated.

Best regards,
Neil.

Libs:
chronicle-affinity-3.0.jar
chronicle-core-1.1.5.jar
chronicle-lang-6.7.3.jar
chronicle-map-2.3.9.jar
chronicle-q-3.5.3.jar

Construction: 
queue = ChronicleQueueBuilder.vanilla(basePath).cleanupOnClose(true).build();

Write: 
public void handle(Event event) {

       try {
           ExcerptAppender appender = queue.createAppender();
           appender.startExcerpt(event.getRawData().length() + 1 * 1024);
           appender.writeObject(event);
           appender.finish();
       } catch (IOException e) {
           e.printStackTrace();
       }
}

Exception:

java.lang.UnsupportedOperationException
	at net.openhft.affinity.impl.NullAffinity.getThreadId(NullAffinity.java:56)
	at net.openhft.affinity.Affinity.getThreadId(Affinity.java:170)
	at net.openhft.affinity.AffinitySupport.getThreadId(AffinitySupport.java:28)
	at net.openhft.chronicle.VanillaChronicle$VanillaAppenderImpl.startExcerpt(VanillaChronicle.java:613)
	at net.openhft.chronicle.VanillaChronicle$VanillaAppenderImpl.startExcerpt(VanillaChronicle.java:605)
	at com.liquidlabs.log.space.agg.ChronicleQReplayAggregator.handle(ChronicleQReplayAggregator.java:73)

Source location: VanillaChronicle:
public void startExcerpt(long capacity, int cycle) {
    VanillaChronicle.this.checkNotClosed();

    try {
        this.appenderCycle = cycle;
>>>>>        int e = AffinitySupport.getThreadId();

        assert ((long)e & VanillaChronicle.THREAD_ID_MASK) == (long)e : "appenderThreadId: " + e;

Luca Burgazzoli

unread,
Nov 14, 2015, 10:21:32 AM11/14/15
to java-ch...@googlegroups.com
If I'm not mistaking you need affinity 2.2 for queue v3
--
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.


--
lb

Neil Avery

unread,
Nov 14, 2015, 1:48:15 PM11/14/15
to Chronicle
Hi Luca,
Thanks for the suggestion; I tried affinity 2.2 and have the same exception:

java.lang.UnsupportedOperationException
at net.openhft.affinity.impl.NullAffinity.getThreadId(NullAffinity.java:57)
at net.openhft.affinity.AffinitySupport.getThreadId(AffinitySupport.java:155)
at net.openhft.chronicle.VanillaChronicle$VanillaAppenderImpl.startExcerpt(VanillaChronicle.java:613)
at net.openhft.chronicle.VanillaChronicle$VanillaAppenderImpl.startExcerpt(VanillaChronicle.java:605)
at com.liquidlabs.log.space.agg.ChronicleQReplayAggregator.handle(ChronicleQReplayAggregator.java:73)

Regards,
Neil.

To unsubscribe from this group and stop receiving emails from it, send an email to java-chronicle+unsubscribe@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.


--
lb

Neil Avery

unread,
Nov 14, 2015, 1:57:06 PM11/14/15
to Chronicle
Ok - feeling a bit dumb about now and should have realised; I've added:
: jna-4.2.1.jar
: jna-platform-4.2.1.jar

and it works... and super fast; about to get faster once I apply more around serialization...

420k events per second, single thread.

Cheers 
Neil.
Reply all
Reply to author
Forward
0 new messages