Examples of MapMaker


Examples of com.google.common.collect.MapMaker

      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

Examples of com.google.common.collect.MapMaker

   * 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

Examples of com.google.common.collect.MapMaker

    maxPoolSize = GiraphConstants.NETTY_CLIENT_THREADS.get(conf);

    maxResolveAddressAttempts = MAX_RESOLVE_ADDRESS_ATTEMPTS.get(conf);

    clientRequestIdRequestInfoMap =
        new MapMaker().concurrencyLevel(maxPoolSize).makeMap();

    handlerBeforeExecutionHandler =
        NETTY_CLIENT_EXECUTION_AFTER_HANDLER.get(conf);
    boolean useExecutionHandler = NETTY_CLIENT_USE_EXECUTION_HANDLER.get(conf);
    if (useExecutionHandler) {
View Full Code Here

Examples of com.google.common.collect.MapMaker

  public SimpleMessageStore(
      CentralizedServiceWorker<I, ?, ?, M> service,
      ImmutableClassesGiraphConfiguration<I, ?, ?, M> config) {
    this.service = service;
    this.config = config;
    map = new MapMaker().concurrencyLevel(
        config.getNettyServerExecutionConcurrency()).makeMap();
  }
View Full Code Here

Examples of com.google.common.collect.MapMaker

   * @return Message map for this partition
   */
  protected ConcurrentMap<I, T> getOrCreatePartitionMap(int partitionId) {
    ConcurrentMap<I, T> partitionMap = map.get(partitionId);
    if (partitionMap == null) {
      ConcurrentMap<I, T> tmpMap = new MapMaker().concurrencyLevel(
          config.getNettyServerExecutionConcurrency()).makeMap();
      partitionMap = map.putIfAbsent(partitionId, tmpMap);
      if (partitionMap == null) {
        partitionMap = tmpMap;
      }
View Full Code Here

Examples of com.google.common.collect.MapMaker

  public ByteArrayPartition() { }

  @Override
  public void initialize(int partitionId, Progressable progressable) {
    super.initialize(partitionId, progressable);
    vertexMap = new MapMaker().concurrencyLevel(
        getConf().getNettyServerExecutionConcurrency()).makeMap();
    representativeVertex = getConf().createVertex();
    representativeVertex.initialize(
        getConf().createVertexId(),
        getConf().createVertexValue(),
View Full Code Here

Examples of com.google.common.collect.MapMaker

  @Override
  public void readFields(DataInput input) throws IOException {
    super.readFields(input);
    int size = input.readInt();
    vertexMap = new MapMaker().concurrencyLevel(
        getConf().getNettyServerExecutionConcurrency()).initialCapacity(
        size).makeMap();
    representativeVertex = getConf().createVertex();
    representativeVertex.initialize(
        getConf().createVertexId(),
View Full Code Here

Examples of com.google.common.collect.MapMaker

        stats.evict();
        doEviction(key, value);
      }
    };

    backingMap = new MapMaker().maximumSize(numBlocks - 1)
        .evictionListener(listener).makeMap();

  }
View Full Code Here

Examples of com.google.common.collect.MapMaker

   */
  public ExactCounterMetric(final String nam, final MetricsRegistry registry,
      final String description, int topN) {
    super(nam, description);

    this.counts = new MapMaker().makeComputingMap(
        new Function<String, Counter>() {
          @Override
          public Counter apply(String input) {
            return new Counter();
          }   
View Full Code Here

Examples of com.google.common.collect.MapMaker

  /**
   * This test illustrates how we can use {@link Map#containsKey(Object)} within
   * the {@link ClassGraph#containsNode(Class)} method.
   */
  public void testMapMakerKeySet() {
    Map<String, String> stringMap = new MapMaker().makeComputingMap(
        new Function<String, String>() {
          @Override public String apply(String input) {
            return String.valueOf(input) + "-suffix";
          }
        });
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.