Package com.google.common.collect

Examples of com.google.common.collect.MapMaker


   * Hook into the post load event in JPA to take the database fields and load
   * the transient fields prior to making the object available to java.
   */
  @PostLoad
  public void loadTransientFields() {
    templateParams = new MapMaker().makeMap();
    for (Entry<String, ActivityTemplateParamsDb> e : templateParamsDb
        .entrySet()) {
      templateParams.put(e.getKey(), e.getValue().value);
    }
  }
View Full Code Here


  /**
   * set the state of the object after load
   */
  @PostLoad
  public void postLoad() {
    values = new MapMaker().makeMap();
    for (Entry<String, ApplicationDataMapValueDb> e : valuesDb.entrySet()) {
      values.put(e.getKey(), e.getValue().value);
    }
  }
View Full Code Here

   * @param statistics statistics handle.
   */
  public StatementCache(int size, boolean maintainStats, Statistics statistics){
    this.maintainStats = maintainStats;
    this.statistics = statistics;
    this.cache = new MapMaker()
    .concurrencyLevel(32)
    .makeMap();

    this.cacheSize = size;
  }
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

  /**
   * set the state of the object after load
   */
  @PostLoad
  public void postLoad() {
    values = new MapMaker().makeMap();
    for (Entry<String, ApplicationDataMapValueDb> e : valuesDb.entrySet()) {
      values.put(e.getKey(), e.getValue().value);
    }
  }
View Full Code Here

   * @see com.thoughtworks.xstream.converters.Converter#unmarshal(com.thoughtworks.xstream.io.HierarchicalStreamReader,
   *      com.thoughtworks.xstream.converters.UnmarshallingContext)
   */
  @Override
  public Object unmarshal(HierarchicalStreamReader reader, UnmarshallingContext context) {
    Map<String, Object> m = new MapMaker().makeMap();
    reader.moveDown();
    while (reader.hasMoreChildren()) {
      String key = reader.getNodeName();
      if ("entry".equals(key)) {
        Object value = null;
View Full Code Here

      ImmutableClassesGiraphConfiguration<I, V, E, M> configuration,
      Progressable progressable) {
    this.service = service;
    this.configuration = configuration;
    this.progressable = progressable;
    transientEdges = new MapMaker().concurrencyLevel(
        configuration.getNettyServerExecutionConcurrency()).makeMap();
    reuseEdgeObjects = configuration.reuseEdgeObjects();
    useInputOutEdges = configuration.useInputOutEdges();
  }
View Full Code Here

      int partitionId, ByteArrayVertexIdEdges<I, E> edges) {
    ConcurrentMap<I, OutEdges<I, E>> partitionEdges =
        transientEdges.get(partitionId);
    if (partitionEdges == null) {
      ConcurrentMap<I, OutEdges<I, E>> newPartitionEdges =
          new MapMaker().concurrencyLevel(
              configuration.getNettyServerExecutionConcurrency()).makeMap();
      partitionEdges = transientEdges.putIfAbsent(partitionId,
          newPartitionEdges);
      if (partitionEdges == null) {
        partitionEdges = newPartitionEdges;
View Full Code Here

   * Constructor
   *
   * @param conf Configuration
   */
  public WorkerRequestReservedMap(Configuration conf) {
    workerRequestReservedMap = new MapMaker().concurrencyLevel(
        conf.getInt(GiraphConstants.MSG_NUM_FLUSH_THREADS,
            NettyServer.MAXIMUM_THREAD_POOL_SIZE_DEFAULT)).makeMap();
  }
View Full Code Here

TOP

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

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.