Examples of MapMaker


Examples of com.facebook.presto.hive.shaded.com.google.common.collect.MapMaker

      int numThreads = HiveConf.getIntVar(conf, ConfVars.HIVE_STATS_GATHER_NUM_THREADS);
      tableFullName = table.getDbName() + "." + table.getTableName();
      threadPool = Executors.newFixedThreadPool(numThreads,
          new ThreadFactoryBuilder().setDaemon(true).setNameFormat("StatsNoJobTask-Thread-%d")
              .build());
      partUpdates = new MapMaker().concurrencyLevel(numThreads).makeMap();
      LOG.info("Initialized threadpool for stats computation with " + numThreads + " threads");
    } catch (HiveException e) {
      LOG.error("Cannot get table " + tableName, e);
      console.printError("Cannot get table " + tableName, e.toString());
    }
View Full Code Here

Examples of com.facebook.presto.jdbc.internal.guava.collect.MapMaker

    LazyStriped(int stripes, Supplier<L> supplier) {
      super(stripes);
      this.size = (mask == ALL_SET) ? Integer.MAX_VALUE : mask + 1;
      this.supplier = supplier;
      this.locks = new MapMaker().weakValues().makeMap();
    }
View Full Code Here

Examples of com.google.common.collect.MapMaker

   */


  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

Examples of com.google.common.collect.MapMaker

    }
  }

  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

Examples of com.google.common.collect.MapMaker

  }

 
  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

Examples of com.google.common.collect.MapMaker

 
    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

Examples of com.google.common.collect.MapMaker

 
  @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

Examples of com.google.common.collect.MapMaker

        }, 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

Examples of com.google.common.collect.MapMaker

  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

Examples of com.google.common.collect.MapMaker

      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
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.