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

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


        {
            forwardKeySerializer = ( ElementSerializer<K> ) new ByteArraySerializer( ( Comparator<byte[]> ) comp );
        }
        else
        {
            forwardKeySerializer = ( ElementSerializer<K> ) new StringSerializer( ( Comparator<String> ) comp );
        }

        boolean forwardDups = true;

        String oid = attributeType.getOid();
View Full Code Here


        MavibotParentIdAndRdnSerializer.setSchemaManager( schemaManager );
        MavibotParentIdAndRdnSerializer parentIdAndSerializer = new MavibotParentIdAndRdnSerializer();

        String forwardTableName = attributeType.getOid() + FORWARD_BTREE;
        forward = new MavibotTable<ParentIdAndRdn, String>( recordMan, schemaManager, forwardTableName,
            parentIdAndSerializer, new StringSerializer(), false );

        String reverseTableName = attributeType.getOid() + REVERSE_BTREE;
        reverse = new MavibotTable<String, ParentIdAndRdn>( recordMan, schemaManager, reverseTableName,
            new StringSerializer(), parentIdAndSerializer, false );
    }
View Full Code Here

        {
            forwardKeySerializer = ( ElementSerializer<K> ) new ByteArraySerializer( ( Comparator<byte[]> ) comp );
        }
        else
        {
            forwardKeySerializer = ( ElementSerializer<K> ) new StringSerializer( ( Comparator<String> ) comp );
        }

        boolean forwardDups = true;

        String oid = attributeType.getOid();
        // disable duplicates for entryCSN and entryUUID attribute indices
        if ( oid.equals( SchemaConstants.ENTRY_CSN_AT_OID ) || oid.equals( SchemaConstants.ENTRY_UUID_AT_OID ) )
        {
            forwardDups = false;
        }

        String forwardTableName = attributeType.getOid() + FORWARD_BTREE;
        forward = new MavibotTable<K, String>( recordMan, schemaManager, forwardTableName, forwardKeySerializer,
            new StringSerializer(), forwardDups );

        /*
         * Now the reverse map stores the primary key into the master table as
         * the key and the values of attributes as the value.  If an attribute
         * is single valued according to its specification based on a schema
         * then duplicate keys should not be allowed within the reverse table.
         */
        if ( withReverse )
        {
            String reverseTableName = attributeType.getOid() + REVERSE_BTREE;
            reverse = new MavibotTable<String, K>( recordMan, schemaManager, reverseTableName, new StringSerializer(),
                forwardKeySerializer, !attributeType.isSingleValued() );
        }

        String path = new File( this.wkDirPath, attributeType.getOid() ).getAbsolutePath();
        // finally write a text file in the format <OID>-<attribute-name>.txt
View Full Code Here

        UuidComparator.INSTANCE.setSchemaManager( schemaManager );

        DnSerializer dnSerializer = new DnSerializer();

        String forwardTableName = attributeType.getOid() + FORWARD_BTREE;
        forward = new MavibotTable<Dn, String>( recordMan, schemaManager, forwardTableName, dnSerializer, new StringSerializer(), false );

        String reverseTableName = attributeType.getOid() + REVERSE_BTREE;
        reverse = new MavibotTable<String, Dn>( recordMan, schemaManager, reverseTableName, new StringSerializer(), dnSerializer, !attributeType.isSingleValued() );

        String path = new File( this.wkDirPath, attributeType.getOid() ).getAbsolutePath();
        // finally write a text file in the format <OID>-<attribute-name>.txt
        FileWriter fw = new FileWriter( new File( path + "-" + attributeType.getName() + ".txt" ) );
        // write the AttributeType description
View Full Code Here

{

    public MavibotMasterTable( RecordManager recordMan, SchemaManager schemaManager, String name )
        throws IOException
    {
        super( recordMan, schemaManager, name, new StringSerializer(), new MavibotEntrySerializer(), false );
    }
View Full Code Here


    @Test
    public void testFullPage() throws Exception
    {
        StringSerializer serializer = new StringSerializer();

        BTreeConfiguration<String, String> config = new BTreeConfiguration<String, String>();
        config.setAllowDuplicates( true );
        config.setName( "master" );
        config.setSerializers( serializer, serializer );
View Full Code Here


    @Test
    public void testMoveFirst() throws Exception
    {
        StringSerializer serializer = new StringSerializer();

        BTreeConfiguration<String, String> config = new BTreeConfiguration<String, String>();
        config.setAllowDuplicates( true );
        config.setName( "master" );
        config.setSerializers( serializer, serializer );
View Full Code Here


    @Test(expected = NoSuchElementException.class)
    public void testMoveLast() throws Exception
    {
        StringSerializer serializer = new StringSerializer();

        BTreeConfiguration<String, String> config = new BTreeConfiguration<String, String>();
        config.setAllowDuplicates( true );
        config.setName( "master" );
        config.setSerializers( serializer, serializer );
View Full Code Here


    @Test(expected = NoSuchElementException.class)
    public void testMoveToNextPrevNonDuplicateKey() throws Exception
    {
        StringSerializer serializer = new StringSerializer();

        BTreeConfiguration<String, String> config = new BTreeConfiguration<String, String>();
        config.setAllowDuplicates( true );
        config.setName( "master" );
        config.setSerializers( serializer, serializer );
View Full Code Here

     * @throws IOException If the creation failed
     */
    @BeforeClass
    public static void setup() throws IOException
    {
        btree = new BTree<Long, String>( "test", new LongSerializer(), new StringSerializer() );
    }
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.