Package org.exist.storage.cache

Examples of org.exist.storage.cache.Cache



    @Override
    public void deregisterCache( Cache cache )
    {
        Cache next;

        for( int i = 0; i < caches.size(); i++ ) {
            next = (Cache)caches.get( i );

            if( cache == next ) {
View Full Code Here


     */
    @Override
    public void checkCaches()
    {
        final int   minSize = (int)( totalPageCount * MIN_SHRINK_FACTOR );
        Cache cache;
        int   load;

        if( shrinkThreshold >= 0 ) {

            for( int i = 0; i < caches.size(); i++ ) {
                cache = (Cache)caches.get( i );

                if( cache.getGrowthFactor() > 1.0 ) {
                    load = cache.getLoad();

                    if( ( cache.getBuffers() > minSize ) && ( load < shrinkThreshold ) ) {

                        if( LOG.isDebugEnabled() ) {
                            final NumberFormat nf = NumberFormat.getNumberInstance();
                            LOG.debug( "Shrinking cache: " + cache.getFileName() + " (a " + cache.getClass().getName() + ") to " + nf.format( cache.getBuffers() ) );
                        }
                        currentPageCount -= cache.getBuffers();
                        cache.resize( getDefaultInitialSize() );
                        currentPageCount += getDefaultInitialSize();
                    }
                }
            }
        }
View Full Code Here

    {
        if( lastRequest == null ) {
            return;
        }
        final int   minSize = (int)( totalPageCount * MIN_SHRINK_FACTOR );
        Cache cache;

        for( int i = 0; i < caches.size(); i++ ) {
            cache = (Cache)caches.get( i );

            if( cache.getBuffers() >= minSize ) {
                int newSize = (int)( cache.getBuffers() * SHRINK_FACTOR );

                if( LOG.isDebugEnabled() ) {
                    final NumberFormat nf = NumberFormat.getNumberInstance();
                    LOG.debug( "Shrinking cache: " + cache.getFileName() + " (a " + cache.getClass().getName() + ") to " + nf.format( newSize ) );
                }
                currentPageCount -= cache.getBuffers();
                cache.resize( newSize );
                currentPageCount += newSize;
                break;
            }
        }
        lastRequest = null;
View Full Code Here

TOP

Related Classes of org.exist.storage.cache.Cache

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.