Search in sources :

Example 1 with StorageObjectOrIOException

use of org.apache.beam.sdk.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(com.google.common.collect.ImmutableList) MatchResult(org.apache.beam.sdk.io.fs.MatchResult) StorageObjectOrIOException(org.apache.beam.sdk.util.GcsUtil.StorageObjectOrIOException) VisibleForTesting(com.google.common.annotations.VisibleForTesting)

Aggregations

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