Package com.google.common.collect

Examples of com.google.common.collect.MapMaker$ExpiringComputingMap


   */


  private void pumpOffHeap(int ops, byte[] payload) {

    ConcurrentMap<String, ByteBuffer> test = new MapMaker()
      .concurrencyLevel(4)
      .makeMap();

    logger.info(Ram.inMb(ops*payload.length) + " in " + ops + " slices to store");
   
View Full Code Here


    }
  }

  private void pumpTheHeap(int ops, byte[] payload) {

    ConcurrentMap<String, byte[]> test = new MapMaker()
      .concurrencyLevel(4)
      .makeMap();

    logger.info(Ram.inMb(ops*payload.length) + " in " + ops + " slices to store");
   
View Full Code Here

  }

 
  private void pumpWithOneAllocation(int ops, byte[] payload) {

    ConcurrentMap<String, ByteBuffer> test = new MapMaker()
      .concurrencyLevel(4)
      .maximumSize(ops)
      .expireAfterWrite(10, TimeUnit.MINUTES)
      .makeMap();
View Full Code Here

 
    pump(ops);
  }

  private void pump(int ops) {
    ConcurrentMap<String, ByteBuffer> test = new MapMaker()
      .concurrencyLevel(4)
      .maximumSize(ops)
      .expireAfterWrite(10, TimeUnit.MINUTES)
      .makeMap();
 
View Full Code Here

 
  @Test
  public void withMap() {

    ConcurrentMap<Long, Pointer> map = new MapMaker()
      .concurrencyLevel(4)
      .initialCapacity(500000)
      .makeMap();

    String str = "This is the string to store into the off-heap memory";
View Full Code Here

        }, l);
        logger.info("disposal scheduled every " + l + " milliseconds");
   

  public static void init(int numberOfBuffers, int size, int initialCapacity, int concurrencyLevel) {
    map = new MapMaker()
      .concurrencyLevel(concurrencyLevel)
      .initialCapacity(initialCapacity)
      .makeMap();

    logger.info("*** initializing *******************************\r\n" + Format.logo());
View Full Code Here

  private ApplicationDataMapDb buildApplicationDataTemplate(ApplicationDb application, String personId, String count) {
    ApplicationDataMapDb applicationDataMap = new ApplicationDataMapDb();
    applicationDataMap.setApplication(application);
    applicationDataMap.setPersonId(personId);
    Map<String, String> values = new MapMaker().makeMap();
    if (null != count) {
      values.put("count", count);
    }
    applicationDataMap.setValues(values);
    return applicationDataMap;
View Full Code Here

      mediaItem2.setUrl("http://www.archive.org/download/testmp3testfile/mpthreetest.mp3");
      mediaItems.add(mediaItem1);
      mediaItems.add(mediaItem2);
      activity.setMediaItems(mediaItems);
      activity.setPostedTime(1111111111L);
      Map<String, String> templateParams = new MapMaker().makeMap();
      templateParams.put("small", "true");
      templateParams.put("otherContent", "and got wet");
      activity.setTemplateParams(templateParams);
      activity.setTitle("My trip");
      activity.setTitleId("1");
      activity.setUpdated(new Date());
      activity.setUrl("http://www.example.org/canonical/activities/1");

    } else if ("2".equals(id)) {
      activity.setBody("Went skiing");
      activity.setBodyId("2");
      activity.setExternalId("http://www.example.org/123457");
      List<MediaItem> mediaItems = new ArrayList<MediaItem>();
      activity.setMediaItems(mediaItems);
      activity.setPostedTime(1111111112L);
      Map<String, String> templateParams = new MapMaker().makeMap();
      templateParams.put("small", "true");
      templateParams.put("otherContent", "and went fast");
      activity.setTemplateParams(templateParams);
      activity.setTitle("My next trip");
      activity.setTitleId("2");
View Full Code Here

   * @param duration in seconds service definitions should remain in the cache
   */
  @Inject
  public DefaultRpcServiceLookup(DefaultServiceFetcher fetcher,
      @Named("org.apache.shindig.serviceExpirationDurationMinutes")Long duration) {
    containerServices = new MapMaker().expiration(duration * 60, TimeUnit.SECONDS).makeMap();
    this.fetcher = fetcher;
  }
View Full Code Here


    private void pumpOffHeap( int ops, byte[] payload )
    {

        ConcurrentMap<String, ByteBuffer> test = new MapMaker().concurrencyLevel( 4 ).makeMap();

        logger.info( Ram.inMb( ops * payload.length ) + " in " + ops + " slices to store" );

        ByteBuffer bulk = ByteBuffer.allocateDirect( ops * payload.length );

View Full Code Here

TOP

Related Classes of com.google.common.collect.MapMaker$ExpiringComputingMap

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.