Examples of IntTupleReaderWriter


Examples of org.apache.directory.mavibot.btree.util.IntTupleReaderWriter

    @Test
    public void testSortedFileCount() throws IOException
    {
        int count = 7;
        IntTupleReaderWriter itrw = new IntTupleReaderWriter();
        Random random = new Random();

        File dataFile = tempFolder.newFile( "tuple.data" );
        DataOutputStream out = new DataOutputStream( new FileOutputStream( dataFile ) );

        Tuple<Integer, Integer>[] arr = ( Tuple<Integer, Integer>[] ) Array.newInstance( Tuple.class, count );

        for ( int i = 0; i < count; i++ )
        {
            int x = random.nextInt( 100 );

            Tuple<Integer, Integer> t = new Tuple<Integer, Integer>( x, x );

            arr[i] = t;

            itrw.writeTuple( t, out );
        }

        out.close();

        BulkDataSorter<Integer, Integer> bds = new BulkDataSorter<Integer, Integer>( itrw, tupleComp, 4 );
View Full Code Here

Examples of org.apache.directory.mavibot.btree.util.IntTupleReaderWriter

    }


    public void testSortedFileMerge( int count, int splitAfter ) throws IOException
    {
        IntTupleReaderWriter itrw = new IntTupleReaderWriter();
        Random random = new Random();

        File dataFile = tempFolder.newFile( "tuple.data" );

        DataOutputStream out = new DataOutputStream( new FileOutputStream( dataFile ) );

        Tuple<Integer, Integer>[] arr = ( Tuple<Integer, Integer>[] ) Array.newInstance( Tuple.class, count );

        int randUpper = count;
        if ( count < 100 )
        {
            randUpper = 100;
        }

        for ( int i = 0; i < count; i++ )
        {
            int x = random.nextInt( randUpper );

            Tuple<Integer, Integer> t = new Tuple<Integer, Integer>( x, x );

            arr[i] = t;

            itrw.writeTuple( t, out );
        }

        out.close();

        BulkDataSorter<Integer, Integer> bds = new BulkDataSorter<Integer, Integer>( itrw, tupleComp, splitAfter );
View Full Code Here

Examples of org.apache.directory.mavibot.btree.util.IntTupleReaderWriter

    @Test
    public void testSortedFileCount() throws IOException
    {
        int count = 7;
        IntTupleReaderWriter itrw = new IntTupleReaderWriter();
        Random random = new Random();

        File dataFile = tempFolder.newFile( "tuple.data" );
        dataFile.deleteOnExit();
        DataOutputStream out = new DataOutputStream( new FileOutputStream( dataFile ) );

        Tuple<Integer, Integer>[] arr = ( Tuple<Integer, Integer>[] ) Array.newInstance( Tuple.class, count );

        for ( int i = 0; i < count; i++ )
        {
            int x = random.nextInt( 100 );

            Tuple<Integer, Integer> t = new Tuple<Integer, Integer>( x, x );

            arr[i] = t;

            itrw.storeSortedTuple( t, out );
        }

        out.close();

        BulkDataSorter<Integer, Integer> bds = new BulkDataSorter<Integer, Integer>( itrw, tupleComp, 4 );
View Full Code Here

Examples of org.apache.directory.mavibot.btree.util.IntTupleReaderWriter

    }


    private void testSortedFileMerge( int count, int splitAfter ) throws IOException
    {
        IntTupleReaderWriter itrw = new IntTupleReaderWriter();
        Random random = new Random();

        File dataFile = tempFolder.newFile( "tuple.data" + counter );
        counter++;
        dataFile.deleteOnExit();

        DataOutputStream out = new DataOutputStream( new FileOutputStream( dataFile ) );

        Tuple<Integer, Integer>[] arr = ( Tuple<Integer, Integer>[] ) Array.newInstance( Tuple.class, count );

        int randUpper = count;
        if ( count < 100 )
        {
            randUpper = 100;
        }

        for ( int i = 0; i < count; i++ )
        {
            int x = random.nextInt( randUpper );

            Tuple<Integer, Integer> t = new Tuple<Integer, Integer>( x, x );

            arr[i] = t;

            itrw.storeSortedTuple( t, out );
        }

        out.close();

        BulkDataSorter<Integer, Integer> bds = new BulkDataSorter<Integer, Integer>( itrw, tupleComp, splitAfter );
View Full Code Here

Examples of org.apache.directory.mavibot.btree.util.IntTupleReaderWriter

    @Test
    public void testSortedFileCount() throws IOException
    {
        int count = 7;
        IntTupleReaderWriter itrw = new IntTupleReaderWriter();
        Random random = new Random();

        File dataFile = tempFolder.newFile( "tuple.data" );
        DataOutputStream out = new DataOutputStream( new FileOutputStream( dataFile ) );

        Tuple<Integer, Integer>[] arr = ( Tuple<Integer, Integer>[] ) Array.newInstance( Tuple.class, count );

        for ( int i = 0; i < count; i++ )
        {
            int x = random.nextInt( 100 );

            Tuple<Integer, Integer> t = new Tuple<Integer, Integer>( x, x );

            arr[i] = t;

            itrw.storeSortedTuple( t, out );
        }

        out.close();

        BulkDataSorter<Integer, Integer> bds = new BulkDataSorter<Integer, Integer>( itrw, tupleComp, 4 );
View Full Code Here

Examples of org.apache.directory.mavibot.btree.util.IntTupleReaderWriter

    }


    public void testSortedFileMerge( int count, int splitAfter ) throws IOException
    {
        IntTupleReaderWriter itrw = new IntTupleReaderWriter();
        Random random = new Random();

        File dataFile = tempFolder.newFile( "tuple.data" );

        DataOutputStream out = new DataOutputStream( new FileOutputStream( dataFile ) );

        Tuple<Integer, Integer>[] arr = ( Tuple<Integer, Integer>[] ) Array.newInstance( Tuple.class, count );

        int randUpper = count;
        if ( count < 100 )
        {
            randUpper = 100;
        }

        for ( int i = 0; i < count; i++ )
        {
            int x = random.nextInt( randUpper );

            Tuple<Integer, Integer> t = new Tuple<Integer, Integer>( x, x );

            arr[i] = t;

            itrw.storeSortedTuple( t, out );
        }

        out.close();

        BulkDataSorter<Integer, Integer> bds = new BulkDataSorter<Integer, Integer>( itrw, tupleComp, splitAfter );
View Full Code Here

Examples of org.apache.directory.mavibot.btree.util.IntTupleReaderWriter

    @Test
    public void testSortedFileCount() throws IOException
    {
        int count = 7;
        IntTupleReaderWriter itrw = new IntTupleReaderWriter();
        Random random = new Random();

        File dataFile = tempFolder.newFile( "tuple.data" );
        DataOutputStream out = new DataOutputStream( new FileOutputStream( dataFile ) );

        Tuple<Integer, Integer>[] arr = ( Tuple<Integer, Integer>[] ) Array.newInstance( Tuple.class, count );

        for ( int i = 0; i < count; i++ )
        {
            int x = random.nextInt( 100 );

            Tuple<Integer, Integer> t = new Tuple<Integer, Integer>( x, x );

            arr[i] = t;

            itrw.storeSortedTuple( t, out );
        }

        out.close();

        BulkDataSorter<Integer, Integer> bds = new BulkDataSorter<Integer, Integer>( itrw, tupleComp, 4 );
View Full Code Here

Examples of org.apache.directory.mavibot.btree.util.IntTupleReaderWriter

    }


    public void testSortedFileMerge( int count, int splitAfter ) throws IOException
    {
        IntTupleReaderWriter itrw = new IntTupleReaderWriter();
        Random random = new Random();

        File dataFile = tempFolder.newFile( "tuple.data" );

        DataOutputStream out = new DataOutputStream( new FileOutputStream( dataFile ) );

        Tuple<Integer, Integer>[] arr = ( Tuple<Integer, Integer>[] ) Array.newInstance( Tuple.class, count );

        int randUpper = count;
        if ( count < 100 )
        {
            randUpper = 100;
        }

        for ( int i = 0; i < count; i++ )
        {
            int x = random.nextInt( randUpper );

            Tuple<Integer, Integer> t = new Tuple<Integer, Integer>( x, x );

            arr[i] = t;

            itrw.storeSortedTuple( t, out );
        }

        out.close();

        BulkDataSorter<Integer, Integer> bds = new BulkDataSorter<Integer, Integer>( itrw, tupleComp, splitAfter );
View Full Code Here

Examples of org.apache.directory.mavibot.btree.util.IntTupleReaderWriter

   
    @Test
    public void testSortedFileCount() throws IOException
    {
        int count = 7;
        IntTupleReaderWriter itrw = new IntTupleReaderWriter();
        Random random = new Random();
       
        File dataFile = File.createTempFile( "tuple", ".data" );
        dataFile.deleteOnExit();
        DataOutputStream out = new DataOutputStream( new FileOutputStream( dataFile ) );
       
        Tuple<Integer, Integer>[] arr = (Tuple<Integer, Integer>[]) Array.newInstance( Tuple.class, count );
       
        for ( int i = 0; i < count; i++ )
        {
            int x = random.nextInt(100);
            //System.out.println(x);

            Tuple<Integer, Integer> t = new Tuple<Integer, Integer>( x, x );
           
            arr[i] = t;
           
            itrw.writeTuple( t, out );
        }

        out.close();
       
        BulkDataSorter<Integer, Integer> bds = new BulkDataSorter<Integer, Integer>( itrw, tupleComp, 4 );
View Full Code Here

Examples of org.apache.directory.mavibot.btree.util.IntTupleReaderWriter

        testSortedFileMerge( 100000, 501 );
    }
   
    public void testSortedFileMerge(int count, int splitAfter) throws IOException
    {
        IntTupleReaderWriter itrw = new IntTupleReaderWriter();
        Random random = new Random();
       
        File dataFile = File.createTempFile( "tuple", ".data" );
        dataFile.deleteOnExit();
       
        DataOutputStream out = new DataOutputStream( new FileOutputStream( dataFile ) );
       
        Tuple<Integer, Integer>[] arr = (Tuple<Integer, Integer>[]) Array.newInstance( Tuple.class, count );
       
        int randUpper = count;
        if(count < 100)
        {
            randUpper = 100;
        }
       
        for ( int i = 0; i < count; i++ )
        {
            int x = random.nextInt(randUpper);
            //System.out.println(x);

            Tuple<Integer, Integer> t = new Tuple<Integer, Integer>( x, x );
           
            arr[i] = t;
           
            itrw.writeTuple( t, out );
        }

        out.close();
       
        BulkDataSorter<Integer, Integer> bds = new BulkDataSorter<Integer, Integer>( itrw, tupleComp, splitAfter );
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.