--
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.
but for real time updation in database like Oracle . i didn't seen any code.
And how can i achieve chronicle engine functionality by this code.
Is Map, Queue, engine and wire are realted with each other internally in chronicle engine or we have to relate them explicitly?
Do u have any sample code realted to this stuff
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/hZ1czygVO28/unsubscribe.
To unsubscribe from this group and all its topics, send an email to java-chronicl...@googlegroups.com.
Is Map, Queue, engine and wire are realted with each other internally in chronicle engine or we have to relate them explicitly
Can you give me any sample piece of code for that.
public static void main(String... ignored) throws IOException { Chronicle chronicle = ChronicleQueueBuilder.vanilla(new File("my-queue8")).build(); ExcerptAppender appender = chronicle.createAppender(); appender.startExcerpt(); appender.writeLong(System.currentTimeMillis()); appender.writeUTF?("Hello World"); appender.finish(); ExcerptTailer tailer = chronicle.createTailer().toStart(); StringBuilder msg = new StringBuilder(); while (tailer.nextIndex()) { long time = tailer.readLong(); tailer.readUTF?(msg); tailer.finish(); System.out.println(new Date(time) + " - " + msg); System.out.println(new Date(time) + " - " + msg); } chronicle.close(); }
I am trying to execute above code but got following exception.
Exception in thread "main" java.lang.UnsupportedOperationException at net.openhft.affinity.impl.NullAffinity.getThreadId(NullAffinity.java:56) at net.openhft.affinity.Affinity.getThreadId(Affinity.java:171) at net.openhft.affinity.AffinitySupport.getThreadId(AffinitySupport.java:26) at net.openhft.chronicle.VanillaChronicle$VanillaAppenderImpl.startExcerpt(VanillaChronicle.java:604) at net.openhft.chronicle.VanillaChronicle$VanillaAppenderImpl.startExcerpt(VanillaChronicle.java:596)
.....at appender.startExcerpt(); line
You can write to the same queue from multiple threads, jvms and using Engine from multiple machines.
Exception in thread "main" java.lang.UnsupportedOperationException at net.openhft.affinity.impl.NullAffinity.getThreadId(NullAffinity.java:56) at net.openhft.affinity.Affinity.getThreadId(Affinity.java:171) at net.openhft.affinity.AffinitySupport.getThreadId(AffinitySupport.java:26) at net.openhft.chronicle.VanillaChronicle$VanillaAppenderImpl.startExcerpt(VanillaChronicle.java:604) at net.openhft.chronicle.VanillaChronicle$VanillaAppenderImpl.startExcerpt(VanillaChronicle.java:596)
.....static {
String osName = System.getProperty("os.name");
if(osName.contains("Win") && isWindowsJNAAffinityUsable()) {
LOGGER.trace("Using Windows JNA-based affinity control implementation");
AFFINITY_IMPL = WindowsJNAAffinity.INSTANCE;
} else if(osName.contains("x")) {
if(osName.startsWith("Linux") && isLinuxJNAAffinityUsable()) {
LOGGER.trace("Using Linux JNA-based affinity control implementation");
AFFINITY_IMPL = LinuxJNAAffinity.INSTANCE;
} else if(isPosixJNAAffinityUsable()) {
LOGGER.trace("Using Posix JNA-based affinity control implementation");
AFFINITY_IMPL = PosixJNAAffinity.INSTANCE;
} else {
LOGGER.info("Using dummy affinity control implementation");
AFFINITY_IMPL = NullAffinity.INSTANCE;
}
} else if(osName.contains("Mac") && isMacJNAAffinityUsable()) {
LOGGER.trace("Using MAC OSX JNA-based thread id implementation");
AFFINITY_IMPL = OSXJNAAffinity.INSTANCE;
} else if(osName.contains("SunOS") && isSolarisJNAAffinityUsable()) {
LOGGER.trace("Using Solaris JNA-based thread id implementation");
AFFINITY_IMPL = SolarisJNAAffinity.INSTANCE;
} else {
LOGGER.info("Using dummy affinity control implementation");
AFFINITY_IMPL = NullAffinity.INSTANCE;
}
}
As the Map is unordered, you could attempt apply a sort but it wouldn't change the order you get from say an Iterator in a useful way.