Example usage for com.google.common.collect Multimaps synchronizedMultimap

List of usage examples for com.google.common.collect Multimaps synchronizedMultimap

Introduction

In this page you can find the example usage for com.google.common.collect Multimaps synchronizedMultimap.

Prototype

public static <K, V> Multimap<K, V> synchronizedMultimap(Multimap<K, V> multimap) 

Source Link

Document

Returns a synchronized (thread-safe) multimap backed by the specified multimap.

Usage

From source file:org.eclipse.osee.orcs.core.internal.util.FilterableCollection.java

protected FilterableCollection() {
    this(Multimaps.synchronizedMultimap(LinkedHashMultimap.<KEY, DATA>create()));
}

From source file:co.cask.cdap.data.stream.service.InMemoryStreamMetaStore.java

public InMemoryStreamMetaStore() {
    this.streams = Multimaps.synchronizedMultimap(HashMultimap.<String, String>create());
}

From source file:org.apache.twill.internal.ElectionRegistry.java

public ElectionRegistry(ZKClient zkClient) {
    this.zkClient = zkClient;
    Multimap<String, LeaderElection> multimap = HashMultimap.create();
    this.registry = Multimaps.synchronizedMultimap(multimap);
}

From source file:tachyon.worker.eviction.EvictLRUBase.java

protected EvictLRUBase(boolean lastTier) {
    mLastTier = lastTier;
    mEvictingBlockIds = Multimaps.synchronizedMultimap(HashMultimap.<StorageDir, Long>create());
}

From source file:org.ros.internal.node.server.ParameterServer.java

public ParameterServer() {
    tree = Maps.newConcurrentMap();
    subscribers = Multimaps.synchronizedMultimap(HashMultimap.<GraphName, NodeIdentifier>create());
    masterName = GraphName.of("/master");
}

From source file:com.sixt.service.framework.configuration.ConfigurationManager.java

@Inject
public ConfigurationManager(ServiceProperties props) {
    this.serviceProps = props;
    this.callbackListeners = Multimaps.synchronizedMultimap(ArrayListMultimap.create());
    this.lastProperties = new HashMap<>(props.getAllProperties());
}

From source file:org.apache.james.mailbox.store.event.MailboxListenerRegistry.java

public MailboxListenerRegistry() {
    this.globalListeners = new ConcurrentLinkedQueue<MailboxListener>();
    this.listeners = Multimaps.synchronizedMultimap(HashMultimap.<MailboxPath, MailboxListener>create());
}

From source file:cron.CronSchedule.java

public CronSchedule(ScheduledExecutorService s, boolean seconds) {
    executor = s;/*from  w w w . ja  v a  2s .co  m*/
    Multimap<CronExpression, Runnable> wrapped = HashMultimap.create();
    runnables = Multimaps.synchronizedMultimap(wrapped);
    periodInMilliseconds = seconds ? ONE_SECOND_IN_MILLISECONDS : ONE_MINUTE_IN_MILLISECONDS;
}

From source file:org.apache.james.mailbox.indexer.registrations.MailboxRegistration.java

public MailboxRegistration(MailboxPath mailboxPath) {
    this.impactingMessageEvents = Multimaps
            .synchronizedMultimap(ArrayListMultimap.<Long, ImpactingMessageEvent>create());
    this.mailboxPath = mailboxPath;
}

From source file:joachimeichborn.geotag.preview.PreviewRepo.java

@Inject
public PreviewRepo(final DatabaseAccess aDbAccess) {
    LOGGER.fine("Constructing preview repo");

    dbAccess = aDbAccess;//from  w  w  w .  j ava2 s.  co  m
    requestedImages = Multimaps.synchronizedMultimap(HashMultimap.create());
    previewCreator = new PreviewCreator(this);

    BufferedImage placeholderTmp = null;
    try {
        placeholderTmp = ImageIO.read(PreviewRepo.class.getResource(PREVIEW_PLACEHOLDER_IMAGE));
    } catch (IOException | IllegalArgumentException e) {
        LOGGER.severe("Could not load preview placeholder: " + e.getMessage());
        placeholderTmp = new BufferedImage(100, 75, BufferedImage.TYPE_INT_RGB);
    }
    placeholder = placeholderTmp;
}