Package org.apache.directory.server.core.partition.impl.btree.mavibot

Examples of org.apache.directory.server.core.partition.impl.btree.mavibot.MavibotPartition


    public MavibotPartition createPartition( SchemaManager schemaManager, DnFactory dnFactory, String id,
        String suffix, int cacheSize,
        File workingDirectory )
        throws Exception
    {
        MavibotPartition partition = new MavibotPartition( schemaManager, dnFactory );
        partition.setId( id );
        partition.setSuffixDn( new Dn( suffix ) );
        partition.setCacheSize( cacheSize );
        partition.setPartitionPath( workingDirectory.toURI() );

        return partition;
    }
View Full Code Here


        if ( !( partition instanceof MavibotPartition ) )
        {
            throw new IllegalArgumentException( "Partition must be a MavibotPartition" );
        }

        MavibotPartition mavibotPartition = ( MavibotPartition ) partition;
        Set<Index<?, String>> indexedAttributes = mavibotPartition.getIndexedAttributes();

        MavibotIndex<Object> index = new MavibotIndex<Object>( attributeId, false );
        index.setCacheSize( cacheSize );

        indexedAttributes.add( index );
        mavibotPartition.setIndexedAttributes( indexedAttributes );
    }
View Full Code Here

        if ( ( mvbtPartitionBean == null ) || mvbtPartitionBean.isDisabled() )
        {
            return null;
        }

        MavibotPartition mvbtPartition = new MavibotPartition( directoryService.getSchemaManager(),
            directoryService.getDnFactory() );

        mvbtPartition.setId( mvbtPartitionBean.getPartitionId() );
        //mvbtPartition.setOptimizerEnabled( mvbtPartitionBean.isJdbmPartitionOptimizerEnabled() );
        File partitionPath = new File( directoryService.getInstanceLayout().getPartitionsDirectory(),
            mvbtPartitionBean.getPartitionId() );
        mvbtPartition.setPartitionPath( partitionPath.toURI() );

        try
        {
            mvbtPartition.setSuffixDn( mvbtPartitionBean.getPartitionSuffix() );
        }
        catch ( LdapInvalidDnException lide )
        {
            String message = "Cannot set the Dn " + mvbtPartitionBean.getPartitionSuffix() + ", " + lide.getMessage();
            LOG.error( message );
            throw new ConfigurationException( message );
        }

        mvbtPartition.setSyncOnWrite( mvbtPartitionBean.isPartitionSyncOnWrite() );
        mvbtPartition.setIndexedAttributes( createMavibotIndexes( mvbtPartition, mvbtPartitionBean.getIndexes(),
            directoryService ) );

        setContextEntry( mvbtPartitionBean, mvbtPartition );

        return mvbtPartition;
View Full Code Here

            String message = "No entries found in the given LDIF file, aborting bulk load";
            System.out.println( message );
            LOG.info( message );
        }
       
        MavibotPartition partition = null;
        try
        {
            long partT0 = System.currentTimeMillis();
            System.out.print( "Creating partition..." );
           
            DnFactory dnFactory = new DefaultDnFactory( schemaManager, null );

            partition = new MavibotPartition( schemaManager, dnFactory );
            partition.setId( "builder" );
            partition.setSuffixDn( suffixDn );

            File dir = new File( outputDir );
            partition.setPartitionPath( dir.toURI() );

            for( String atName : indexAttributes )
            {
                schemaManager.lookupAttributeTypeRegistry( atName );
                partition.addIndex( new MavibotIndex( atName, false ) );
            }
           
            partition.initialize();

            masterTableName = partition.getMasterTable().getName();
           
            rm = partition.getRecordMan();

            long partT1 = System.currentTimeMillis();
            System.out.println( ", time taken : " + ( partT1 - partT0 ) + "ms" );
        }
        catch ( Exception e )
        {
            LOG.warn( "Failed to initialize the partition", e );
            return;
        }

        try
        {
            long masterT0 = System.currentTimeMillis();
            System.out.print( "Building master table..." );
            buildMasterTable( sortedDnSet );
            long masterT1 = System.currentTimeMillis();
            System.out.println( ", time taken : " + ( masterT1 - masterT0 ) + "ms" );
        }
        catch( Exception e )
        {
            LOG.warn( "Failed to build master table", e );
            e.printStackTrace();
            return;
        }
       
        Iterator<String> userIndexItr = partition.getUserIndices();
       
        try
        {
            // the RecordManager must be re-initialized cause we are
            // setting the "values" of leaves to null while building
            // the tree to avoid OOM errors
            partition.destroy();
           
            rm = new RecordManager( new File( partition.getPartitionPath() ).getAbsolutePath() );
           
            long rdnT0 = System.currentTimeMillis();
            System.out.print( "Building RDN index." );
            buildRdnIndex( sortedDnSet );
            long rdnT1 = System.currentTimeMillis();
            System.out.println( ", time taken : " + ( rdnT1 - rdnT0 ) + "ms" );
        }
        catch( Exception e )
        {
            LOG.warn( "Failed to build the RDN index", e );
            return;
        }
       
        // not needed anymore
        System.out.println( "Clearing the sorted DN set." );
        sortedDnSet.clear();
       
        for( Index<?, String> id : partition.getAllIndices() )
        {
            // RDN and presence indices are built separately
            String oid = id.getAttribute().getOid();
           
            if( ApacheSchemaConstants.APACHE_RDN_AT_OID.equals( oid )
View Full Code Here

     */
    public MavibotPartition createPartition( SchemaManager schemaManager, String id, String suffix, int cacheSize,
        File workingDirectory )
        throws Exception
    {
        MavibotPartition partition = new MavibotPartition( schemaManager );
        partition.setId( id );
        partition.setSuffixDn( new Dn( suffix ) );
        partition.setCacheSize( 500 );
        partition.setPartitionPath( workingDirectory.toURI() );

        return partition;
    }
View Full Code Here

        if ( !( partition instanceof MavibotPartition ) )
        {
            throw new IllegalArgumentException( "Partition must be a MavibotPartition" );
        }

        MavibotPartition mavibotPartition = ( MavibotPartition ) partition;
        Set<Index<?, ?, String>> indexedAttributes = mavibotPartition.getIndexedAttributes();

        RecordManager recordMan = ( ( MavibotPartition ) partition ).getRecordMan();
       
        MavibotIndex<Object, Entry> index = new MavibotIndex<Object, Entry>( recordMan, attributeId, false );
        index.setCacheSize( cacheSize );

        indexedAttributes.add( index );
        mavibotPartition.setIndexedAttributes( indexedAttributes );
    }
View Full Code Here

TOP

Related Classes of org.apache.directory.server.core.partition.impl.btree.mavibot.MavibotPartition

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.