Package org.apache.directory.mavibot.btree.serializer

Examples of org.apache.directory.mavibot.btree.serializer.StringSerializer


        openRecordManagerAndBtree();

        try
        {
            // Create a new BTree
            btree = recordManager.addBTree( "test", new LongSerializer(), new StringSerializer(), false );
        }
        catch ( Exception e )
        {
            throw new RuntimeException( e );
        }
View Full Code Here


        String name = "duplicateTree";
        String[] testValues = new String[]
            { "00", "01", "02", "03", "04", "05", "06", "07", "08", "09", "0A", "0B", "0C", "0D", "0E", "0F", "10" };

        BTree<Long, String> dupsTree = BTreeFactory.createPersistedBTree( name, new LongSerializer(),
            new StringSerializer(), pageSize, true );

        recordManager.manage( dupsTree );

        for ( long i = 0; i < numKeys; i++ )
        {
View Full Code Here

     * @throws IOException If the creation failed
     */
    @BeforeClass
    public static void setup() throws IOException
    {
        btree = BTreeFactory.createInMemoryBTree( "test", new LongSerializer(), new StringSerializer() );
    }
View Full Code Here

        openRecordManagerAndBtrees();

        try
        {
            // Create a new BTree with transaction and another one without
            btreeWithTransactions = recordManagerTxn.addBTree( "testWithTxn", new LongSerializer(), new StringSerializer(), false );
            btreeNoTransactions = recordManagerNoTxn.addBTree( "testNoTxn", new LongSerializer(), new StringSerializer(), false );
        }
        catch ( Exception e )
        {
            throw new RuntimeException( e );
        }
View Full Code Here

        long l1 = System.currentTimeMillis();
        int n = 0;
        long delta = l1;
        int nbElems = 100000;

        BTree<Long, String> btree = new BTree<Long, String>( "test", new LongSerializer(), new StringSerializer() );
        btree.setPageSize( 32 );

        for ( int i = 0; i < nbElems; i++ )
        {
            Long key = ( long ) random.nextLong();
View Full Code Here

    {
        // Create a BTree with pages containing 8 elements
        String path = tempFolder.getRoot().getCanonicalPath();

        BTree<Integer, String> btree = new BTree<Integer, String>( "test", path, new IntSerializer(),
            new StringSerializer() );
        btree.setPageSize( 8 );

        File journal = btree.getJournal();
        File data = btree.getFile();

        try
        {
            // Inject the values
            for ( int value : sortedValues )
            {
                String strValue = "V" + value;

                btree.insert( value, strValue );
            }

            // The journal must be full
            assertTrue( journal.length() > 0 );

            // Now, flush the btree
            btree.flush();

            // The journal must be empty
            assertEquals( 0, journal.length() );

            // Load the data into a new tree
            BTree<Integer, String> btreeLoaded = new BTree<Integer, String>( "test", path, new IntSerializer(),
                new StringSerializer() );
            btree.setPageSize( 8 );

            TupleCursor<Integer, String> cursor1 = btree.browse();
            TupleCursor<Integer, String> cursor2 = btree.browse();
View Full Code Here

        File dataFile = new File( data100K );
        BTree<Long, String> btree = new BTree<Long, String>(
            "test",
            dataFile.getParent(),
            new LongSerializer(),
            new StringSerializer() );
        btree.setPageSize( 32 );
        btree.close();
    }
View Full Code Here

     * Create a btree
     */
    @Before
    public void setup() throws IOException
    {
        btree = new BTree<Long, String>( "test", new LongSerializer(), new StringSerializer() );
        btree.setPageSize( 8 );
    }
View Full Code Here

        int nbTrees = 1000;
        int nbElems = 1000;

        for ( int j = 0; j < nbTrees; j++ )
        {
            BTree<Long, String> btree = new BTree<Long, String>( "test", new LongSerializer(), new StringSerializer() );
            btree.setPageSize( 32 );

            for ( int i = 0; i < nbElems; i++ )
            {
                Long key = ( long ) random.nextInt( 1024 );
View Full Code Here

        int nbTrees = 1000;
        int nbElems = 1000;

        for ( int j = 0; j < nbTrees; j++ )
        {
            BTree<Long, String> btree = new BTree<Long, String>( "test", new LongSerializer(), new StringSerializer() );
            btree.setPageSize( 8 );

            for ( int i = 0; i < nbElems; i++ )
            {
                Long key = ( long ) random.nextInt( 1024 );
View Full Code Here

TOP

Related Classes of org.apache.directory.mavibot.btree.serializer.StringSerializer

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.