Search in sources :

Example 31 with ImmutableMultimap

use of com.google.common.collect.ImmutableMultimap in project gradle by gradle.

the class FileCollectionFingerprintSerializer method readRootHashes.

private ImmutableMultimap<String, HashCode> readRootHashes(Decoder decoder) throws IOException {
    int numberOfRoots = decoder.readSmallInt();
    if (numberOfRoots == 0) {
        return ImmutableMultimap.of();
    }
    ImmutableMultimap.Builder<String, HashCode> builder = ImmutableMultimap.builder();
    for (int i = 0; i < numberOfRoots; i++) {
        String absolutePath = stringInterner.intern(decoder.readString());
        HashCode rootHash = hashCodeSerializer.read(decoder);
        builder.put(absolutePath, rootHash);
    }
    return builder.build();
}
Also used : HashCode(org.gradle.internal.hash.HashCode) ImmutableMultimap(com.google.common.collect.ImmutableMultimap) FileCollectionFingerprint(org.gradle.internal.fingerprint.FileCollectionFingerprint) FileSystemLocationFingerprint(org.gradle.internal.fingerprint.FileSystemLocationFingerprint)

Aggregations

ImmutableMultimap (com.google.common.collect.ImmutableMultimap)30 Path (java.nio.file.Path)9 ImmutableMap (com.google.common.collect.ImmutableMap)8 ImmutableSet (com.google.common.collect.ImmutableSet)7 Map (java.util.Map)6 BuildTarget (com.facebook.buck.model.BuildTarget)4 ImmutableList (com.google.common.collect.ImmutableList)4 SourcePath (com.facebook.buck.rules.SourcePath)3 VisibleForTesting (com.google.common.annotations.VisibleForTesting)3 Multimap (com.google.common.collect.Multimap)3 IOException (java.io.IOException)3 List (java.util.List)3 ClasspathTraversal (com.facebook.buck.jvm.java.classes.ClasspathTraversal)2 ClasspathTraverser (com.facebook.buck.jvm.java.classes.ClasspathTraverser)2 DefaultClasspathTraverser (com.facebook.buck.jvm.java.classes.DefaultClasspathTraverser)2 FileLike (com.facebook.buck.jvm.java.classes.FileLike)2 UnflavoredBuildTarget (com.facebook.buck.model.UnflavoredBuildTarget)2 Column (com.facebook.presto.hive.metastore.Column)2 ExtendedHiveMetastore (com.facebook.presto.hive.metastore.ExtendedHiveMetastore)2 HivePrivilegeInfo (com.facebook.presto.hive.metastore.HivePrivilegeInfo)2