Package org.apache.directmemory.misc

Examples of org.apache.directmemory.misc.DummyPojo


    @BenchmarkOptions( benchmarkRounds = 50000, warmupRounds = 0, concurrency = 1 )
    @Test
    public void basicBench()
    {

        DummyPojo d = new DummyPojo( "test-" + rnd.nextInt( 100000 ), 1024 + rnd.nextInt( 1024 ) );
        Cache.put( d.name, d );
        DummyPojo d2 = (DummyPojo) Cache.retrieve( d.name );

        assertEquals( d.name, d2.name );

    }
View Full Code Here


        throws IOException, ClassNotFoundException, InstantiationException, IllegalAccessException
    {
        logger.info( "begin " + serializer.getClass().toString() );
        MonitorService stopWatch = Monitor.get( "serializer." + name + "." + size + "bytes" );
        MonitorService stopWatch2 = Monitor.get( "deserializer." + name + "." + size + "bytes" );
        DummyPojo pojo = new DummyPojo( "test", size );
        for ( int i = 0; i < howMany; i++ )
        {
            long split = stopWatch.start();
            final byte[] array = serializer.serialize( pojo );
            stopWatch.stop( split );
            long split2 = stopWatch2.start();
            DummyPojo check = (DummyPojo) serializer.deserialize( array, pojo.getClass() );
            stopWatch2.stop( split2 );
            assertNotNull( "object has not been serialized", check );
            assertEquals( pojo.name, check.name );
        }
        logger.info( "end serialize " + serializer.getClass().toString() + "\r\n" + stopWatch.toString() );
View Full Code Here

    @BenchmarkOptions( benchmarkRounds = 50000, warmupRounds = 0, concurrency = 1 )
    @Test
    public void basicBench()
    {

        DummyPojo d = new DummyPojo( "test-" + rnd.nextInt( 100000 ), 1024 + rnd.nextInt( 1024 ) );
        Cache.put( d.name, d );
        DummyPojo d2 = (DummyPojo) Cache.retrieve( d.name );

        assertEquals( d.name, d2.name );

    }
View Full Code Here

TOP

Related Classes of org.apache.directmemory.misc.DummyPojo

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.