Package com.taobao.tddl.dbsync.binlog

Examples of com.taobao.tddl.dbsync.binlog.LogBuffer


    public void testSigned()
    {
        byte[] array = { 0, 0, 0, (byte) 0xff };

        LogBuffer buffer = new LogBuffer(array, 0, array.length);

        System.out.println(buffer.getInt32(0));
        System.out.println(buffer.getUint32(0));

        System.out.println(buffer.getInt24(1));
        System.out.println(buffer.getUint24(1));
    }
View Full Code Here


    public void testBigInteger()
    {
        byte[] array = { (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff,
                (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff };

        LogBuffer buffer = new LogBuffer(array, 0, array.length);

        long tt1 = 0;
        long l1 = 0;
        for (int i = 0; i < LOOP; i++)
        {
            final long t1 = System.nanoTime();
            l1 = buffer.getLong64(0);
            tt1 += System.nanoTime() - t1;
        }
        System.out.print(tt1 / LOOP);
        System.out.print("ns >> ");
        System.out.println(l1);

        long tt2 = 0;
        BigInteger l2 = null;
        for (int i = 0; i < LOOP; i++)
        {
            final long t2 = System.nanoTime();
            l2 = buffer.getUlong64(0);
            tt2 += System.nanoTime() - t2;
        }
        System.out.print(tt2 / LOOP);
        System.out.print("ns >> ");
        System.out.println(l2);
View Full Code Here

        do
        {
            System.out.println("new extract decimal: ");

            LogBuffer buffer1 = new LogBuffer(array2, 0, array2.length);
            LogBuffer buffer2 = new LogBuffer(array1, 0, array1.length);
            LogBuffer buffer3 = new LogBuffer(array3, 0, array3.length);
            LogBuffer buffer4 = new LogBuffer(array4, 0, array4.length);
            LogBuffer buffer5 = new LogBuffer(array5, 0, array5.length);

            long tt1 = 0;
            BigDecimal bd1 = null;
            for (int i = 0; i < LOOP; i++)
            {
                final long t1 = System.nanoTime();
                bd1 = buffer1.getDecimal(0, 19, 10);
                tt1 += System.nanoTime() - t1;
            }
            System.out.print(tt1 / LOOP);
            System.out.print("ns >> ");
            System.out.println(bd1);

            long tt2 = 0;
            BigDecimal bd2 = null;
            for (int i = 0; i < LOOP; i++)
            {
                final long t2 = System.nanoTime();
                bd2 = buffer2.getDecimal(0, 19, 10);
                tt2 += System.nanoTime() - t2;
            }
            System.out.print(tt2 / LOOP);
            System.out.print("ns >> ");
            System.out.println(bd2);

            long tt3 = 0;
            BigDecimal bd3 = null;
            for (int i = 0; i < LOOP; i++)
            {
                final long t3 = System.nanoTime();
                bd3 = buffer3.getDecimal(0, 18, 6);
                tt3 += System.nanoTime() - t3;
            }
            System.out.print(tt3 / LOOP);
            System.out.print("ns >> ");
            System.out.println(bd3);

            long tt4 = 0;
            BigDecimal bd4 = null;
            for (int i = 0; i < LOOP; i++)
            {
                final long t4 = System.nanoTime();
                bd4 = buffer4.getDecimal(0, 18, 6);
                tt4 += System.nanoTime() - t4;
            }
            System.out.print(tt4 / LOOP);
            System.out.print("ns >> ");
            System.out.println(bd4);

            long tt5 = 0;
            BigDecimal bd5 = null;
            for (int i = 0; i < LOOP; i++)
            {
                final long t5 = System.nanoTime();
                bd5 = buffer5.getDecimal(0, 18, 6);
                tt5 += System.nanoTime() - t5;
            }
            System.out.print(tt5 / LOOP);
            System.out.print("ns >> ");
            System.out.println(bd5);
View Full Code Here

TOP

Related Classes of com.taobao.tddl.dbsync.binlog.LogBuffer

Copyright © 2018 www.massapicom. 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.