Package org.zper.base

Examples of org.zper.base.ZLog.offset()


    {
        Context ctx = ZMQ.context(1);
        Socket sock = ctx.socket(ZMQ.DEALER);

        ZLog zlog = ZLogManager.instance().get(topic);
        long offset = zlog.offset();
        String data = "hello";

        System.out.println("previous offset " + zlog.path().getAbsolutePath() + ":" + offset);

        sock.setIdentity(ZPUtils.genTopicIdentity(topic, 0));
View Full Code Here


        // wait until flush
        Thread.sleep(1000);
        zlog.flush();

        assertEquals(zlog.offset(), offset + data.length() + 2);

        sock.close();
        ctx.term();
    }
View Full Code Here

    {
        Context ctx = ZMQ.context(1);
        Socket sock = ctx.socket(ZMQ.PUSH);

        ZLog zlog = ZLogManager.instance().get(topic);
        long offset = zlog.offset();
        String data = "hello";

        System.out.println("previous offset " + zlog.path().getAbsolutePath() + ":" + offset);

        sock.setIdentity(ZPUtils.genTopicIdentity(topic, 0));
View Full Code Here

        // wait until flush
        Thread.sleep(1000);
        zlog.flush();

        assertEquals(zlog.offset(), offset + data.length() + 2);

        sock.close();
        ctx.term();
    }
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.