Package bm.db.index

Examples of bm.db.index.Index


        System.out.println( "listBrowser: " + listBrowser );
        System.out.println( "IconSets: " + iconSets.size() );
        System.out.println( "Controllers: " + controllers.size() );
        System.out.println( "Views: " + views.size() );

        final Index index = new Index( "sys_compiled_views", order, Index.KT_STRING, true, false );
        final Store store = Store.get( "sys_compiled_views", 1 );
        index.setRecordStore( store );
        if( listBrowser != null && listBrowser.equalsIgnoreCase( "native" ) )
        {
            try
            {
                index.insertObject( "listBrowserMode", "native" );
            }
            catch( Exception e )
            {
                throw new ViewCompilerException( e );
            }
View Full Code Here


        final IndexInfo[] indexInfo = tableInfo.getIndexInfo();
        final int count = indexInfo != null ? indexInfo.length : 0;
        for( int i = 0; i < count; i++ )
        {
            //noinspection ConstantConditions
            final Index index = (Index) indexMap.get(
                    indexInfo[i].getFieldExpression().toLowerCase()
            );
            index.open();
        }
    }
View Full Code Here

        final IndexInfo[] indexInfo = tableInfo.getIndexInfo();
        final int count = indexInfo != null ? indexInfo.length : 0;
        for( int i = 0; i < count; i++ )
        {
            //noinspection ConstantConditions
            final Index index = (Index) indexMap.get(
                    indexInfo[i].getFieldExpression().toLowerCase()
            );
            index.close();
        }
    }
View Full Code Here

                                        !newValue.equals( oldValue )
                                );
                    }
                    if( changed )
                    {
                        final Index index = (Index) indexMap.get(
                                tableInfo.getIndexInfo()[i].getFieldExpression()
                        );
                        index.delete( buildIndexValue( rowOld, fieldNames ), oldRecordId );
                        index.insert( buildIndexValue( rowNew, fieldNames ), newRecordId );
                    }
                }
            }
            else if( rowNew != null )
            {
                // Add row to all indexes
                for( int i = 0; i < indexCount; i++ )
                {
                    final Index index = (Index) indexMap.get(
                            tableInfo.getIndexInfo()[i].getFieldExpression()
                    );
                    if( index != null )
                    {
                        index.insert(
                                buildIndexValue(
                                        rowNew,
                                        tableInfo.getIndexInfo()[i].getFieldNames()
                                ),
                                newRecordId
                        );
                    }
                }
            }
            else
            {
                // Remove from all indexes
                for( int i = 0; i < indexCount; i++ )
                {
                    final Index index = (Index) indexMap.get(
                            tableInfo.getIndexInfo()[i].getFieldExpression()
                    );
                    if( index != null )
                    {
                        index.delete(
                                buildIndexValue(
                                        rowOld,
                                        tableInfo.getIndexInfo()[i].getFieldNames()
                                ),
                                oldRecordId
View Full Code Here

     */
    public int[] findRaw( final String fieldName, final Object value )
            throws RecordStoreFullException,
                   DBException
    {
        final Index index = (Index) indexMap.get( fieldName.toLowerCase() );
        if( index == null )
        {
            throw new IndexNotFoundException(
                    Constants.ERR_TBL_FIND_RAW,
                    "table.findRaw(): " + fieldName
            );
        }
        return (int[]) index.find( value );
    }
View Full Code Here

    public int[] findRawFuzzy( final String fieldName, final String value )
            throws DBException,
                   SerializationException,
                   RecordStoreFullException
    {
        final Index index = (Index) indexMap.get( fieldName.toLowerCase() );
        if( index == null )
        {
            throw new IndexNotFoundException(
                    Constants.ERR_TBL_FIND_RAW,
                    "table.findRawFuzzy(): " + fieldName
            );
        }
        return (int[]) index.findFuzzy( value );
    }
View Full Code Here

            event.setPhase( searching );
            event.setSource( this );
            event.dispatch();

            open();
            final Index index = (Index) indexMap.get( Constants.REMOTE_ID );
            int[] recordIds = null;
            // If there's an index on remote id use the index buildSortedList
            // feature, it's much faster than a RecordEnumeration
            boolean failure = true;
            if( index != null )
            {
                try
                {
                    recordIds = index.buildSortedList();
                    failure = false;
                }
                catch( Exception e )
                {
                    // If this operation fails, fall back to the enumeration
View Full Code Here

        final int count = indexInfo != null ? indexInfo.length : 0;
        int totalSize = 0;
        for( int i = 0; i < count; i++ )
        {
            //noinspection ConstantConditions
            final Index index = (Index) indexMap.get(
                    indexInfo[i].getFieldExpression().toLowerCase()
            );
            final int size = index.getSize();
            if( size == -1 )
            {
                return -1;
            }
            totalSize += size;
View Full Code Here

        final IndexInfo[] indexInfo = tableInfo.getIndexInfo();
        final int count = indexInfo != null ? indexInfo.length : 0;
        for( int i = 0; i < count; i++ )
        {
            //noinspection ConstantConditions
            final Index index = (Index) indexMap.get(
                    indexInfo[i].getFieldExpression().toLowerCase()
            );
            total += index.getAverageFindTime();
        }
        return total > 0 && count > 0 ? total / count : 0;
    }
View Full Code Here

        final IndexInfo[] indexInfo = tableInfo.getIndexInfo();
        final int count = indexInfo != null ? indexInfo.length : 0;
        for( int i = 0; i < count; i++ )
        {
            //noinspection ConstantConditions
            final Index index = (Index) indexMap.get(
                    indexInfo[i].getFieldExpression().toLowerCase()
            );
            log.debug( "drop index: " + index.getName() );
            index.drop();
        }
        if( rs != null )
        {
            rs.drop();
        }
View Full Code Here

TOP

Related Classes of bm.db.index.Index

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.