Examples of LRUMap


Examples of org.apache.commons.collections.map.LRUMap

      IOUtils.cleanup(LOG, localFS);
    }
    LOG.info("Using leveldb path " + dbPath);
    db = factory.open(new File(dbPath.toString()), options);
    startTimeWriteCache =
        Collections.synchronizedMap(new LRUMap(getStartTimeWriteCacheSize(
            conf)));
    startTimeReadCache =
        Collections.synchronizedMap(new LRUMap(getStartTimeReadCacheSize(
            conf)));

    if (conf.getBoolean(YarnConfiguration.TIMELINE_SERVICE_TTL_ENABLE, true)) {
      deletionThread = new EntityDeletionThread(conf);
      deletionThread.start();
View Full Code Here

Examples of org.apache.commons.collections.map.LRUMap

      if (_log.isDebugEnabled()) {
        _log.debug("Can't restore view state : session expired");
      }
    } else {
      synchronized (session) {
        LRUMap viewStates = (LRUMap) externalContext.getSessionMap()
            .get(VIEW_STATES_MAP);
        if (null != viewStates) {
          LRUMap logicalStates = (LRUMap) viewStates.get(viewId);
          if (null != logicalStates) {
            if (null != id) {
              restoredState = (Object[]) logicalStates.get(id);
              externalContext.getRequestMap().put(VIEW_SEQUENCE,
                  id);
              if (null == restoredState) {
                if (_log.isDebugEnabled()) {
                  _log
                      .debug("No saved view state found for a Id "
                          + id
                          + ". Restore last saved state");
                }
                restoredState = (Object[]) logicalStates
                    .get(logicalStates.lastKey());
              }
            } else {
              if (_log.isDebugEnabled()) {
                _log
                    .debug("No version Id for a saved view state in request. Restore last saved state");
              }
              restoredState = (Object[]) logicalStates
                  .get(logicalStates.lastKey());
            }
          } else if (_log.isDebugEnabled()) {
            _log
                .debug("Can't restore view state : no saved states for a ViewId "
                    + viewId);
View Full Code Here

Examples of org.apache.commons.collections.map.LRUMap

    SerializedView serializedView;
    UIViewRoot viewRoot = context.getViewRoot();
    ExternalContext externalContext = context.getExternalContext();
    Object session = externalContext.getSession(true);
    synchronized (session) {
      LRUMap viewStates = (LRUMap) externalContext.getSessionMap().get(
          VIEW_STATES_MAP);
      if (null == viewStates) {
        viewStates = new LRUMap(getNumberOfViews(externalContext));
        externalContext.getSessionMap()
            .put(VIEW_STATES_MAP, viewStates);
      }
      Object id = getNextViewId(context);
      LRUMap logicalViewsMap = (LRUMap) viewStates.get(viewRoot
          .getViewId());
      if (null == logicalViewsMap) {
        logicalViewsMap = new LRUMap(getNumberOfViews(externalContext));
      }
      // Renew last seen view.
      viewStates.put(viewRoot.getViewId(), logicalViewsMap);
      logicalViewsMap.put(id, new Object[] { treeStructure, state });
      serializedView = new SerializedView(id, null);
    }
    return serializedView;
  }
View Full Code Here

Examples of org.apache.jcs.utils.struct.LRUMap

    {
        // run the basic tests
        TestSuite suite = new TestSuite( LRUMapConcurrentUnitTest.class );

        // run concurrent tests
        final LRUMap map = new LRUMap( 2000 );
        suite.addTest( new LRUMapConcurrentUnitTest( "conc1" )
        {
            public void runTest()
                throws Exception
            {
                this.runConcurrentPutGetTests( map, 2000 );
            }
        } );
        suite.addTest( new LRUMapConcurrentUnitTest( "conc2" )
        {
            public void runTest()
                throws Exception
            {
                this.runConcurrentPutGetTests( map, 2000 );
            }
        } );
        suite.addTest( new LRUMapConcurrentUnitTest( "conc3" )
        {
            public void runTest()
                throws Exception
            {
                this.runConcurrentPutGetTests( map, 2000 );
            }
        } );

        // run more concurrent tests
        final int max2 = 20000;
        final LRUMap map2 = new LRUMap( max2 );
        suite.addTest( new LRUMapConcurrentUnitTest( "concB1" )
        {
            public void runTest()
                throws Exception
            {
View Full Code Here

Examples of org.apache.ldap.common.util.LRUMap

     */
    public JdbmIndex( AttributeType attribute, RecordManager recMan )
        throws NamingException
    {
        this.attribute = attribute;
        keyCache = new LRUMap( 1000 );
        this.recMan = recMan;
        initTables();
    }
View Full Code Here

Examples of org.apache.openjpa.lib.util.LRUMap

                }
            };
            pinnedMap = new ConcurrentHashMap();
            _readLock = null;
        } else {
            cacheMap = new LRUMap(size, load) {
                public void overflowRemoved(Object key, Object value) {
                    cacheMapOverflowRemoved(key, value);
                }
            };
            softMap = new ReferenceHashMap(ReferenceMap.HARD,
View Full Code Here

Examples of org.hibernate.util.LRUMap

    strongRefCache.clear();
    softRefCache.clear();
  }

  private void init() {
    this.strongRefCache = new LRUMap( strongRefCount );
    this.softRefCache = new LRUMap( softRefCount );
    this.referenceQueue = new ReferenceQueue();
  }
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.