Search in sources :

Example 1 with StorageObjectOrIOException

use of org.apache.beam.sdk.extensions.gcp.util.GcsUtil.StorageObjectOrIOException in project beam by apache.

the class GcsFileSystem method matchNonGlobs.

/**
 * Returns {@link MatchResult MatchResults} for the given {@link GcsPath GcsPaths}.
 *
 * <p>The number of returned {@link MatchResult MatchResults} equals to the number of given {@link
 * GcsPath GcsPaths}. Each {@link MatchResult} contains one {@link Metadata}.
 */
@VisibleForTesting
List<MatchResult> matchNonGlobs(List<GcsPath> gcsPaths) throws IOException {
    List<StorageObjectOrIOException> results = options.getGcsUtil().getObjects(gcsPaths);
    ImmutableList.Builder<MatchResult> ret = ImmutableList.builder();
    for (StorageObjectOrIOException result : results) {
        ret.add(toMatchResult(result));
    }
    return ret.build();
}
Also used : ImmutableList(org.apache.beam.vendor.guava.v26_0_jre.com.google.common.collect.ImmutableList) MatchResult(org.apache.beam.sdk.io.fs.MatchResult) StorageObjectOrIOException(org.apache.beam.sdk.extensions.gcp.util.GcsUtil.StorageObjectOrIOException) VisibleForTesting(org.apache.beam.vendor.guava.v26_0_jre.com.google.common.annotations.VisibleForTesting)

Aggregations

StorageObjectOrIOException (org.apache.beam.sdk.extensions.gcp.util.GcsUtil.StorageObjectOrIOException)1 MatchResult (org.apache.beam.sdk.io.fs.MatchResult)1 VisibleForTesting (org.apache.beam.vendor.guava.v26_0_jre.com.google.common.annotations.VisibleForTesting)1 ImmutableList (org.apache.beam.vendor.guava.v26_0_jre.com.google.common.collect.ImmutableList)1