Package org.apache.beam.sdk.util
Class ExplicitShardedFile
- java.lang.Object
-
- org.apache.beam.sdk.util.ExplicitShardedFile
-
- All Implemented Interfaces:
java.io.Serializable
,ShardedFile
@Internal public class ExplicitShardedFile extends java.lang.Object implements ShardedFile
A sharded file where the file names are simply provided.- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description ExplicitShardedFile(java.util.Collection<java.lang.String> files)
Constructs anExplicitShardedFile
for the given files.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.util.List<java.lang.String>
readFilesWithRetries()
Discovers all shards of this file.java.util.List<java.lang.String>
readFilesWithRetries(Sleeper sleeper, BackOff backOff)
java.lang.String
toString()
-
-
-
Constructor Detail
-
ExplicitShardedFile
public ExplicitShardedFile(java.util.Collection<java.lang.String> files) throws java.io.IOException
Constructs anExplicitShardedFile
for the given files.- Throws:
java.io.IOException
-
-
Method Detail
-
readFilesWithRetries
public java.util.List<java.lang.String> readFilesWithRetries(Sleeper sleeper, BackOff backOff) throws java.io.IOException, java.lang.InterruptedException
Discovers all shards of this file using the providedSleeper
andBackOff
.Because of eventual consistency, reads may discover no files or fewer files than the explicit list of files implies. In this case, the read is considered to have failed.
- Specified by:
readFilesWithRetries
in interfaceShardedFile
- Throws:
java.io.IOException
java.lang.InterruptedException
-
readFilesWithRetries
public java.util.List<java.lang.String> readFilesWithRetries() throws java.io.IOException, java.lang.InterruptedException
Discovers all shards of this file.Because of eventual consistency, reads may discover no files or fewer files than the shard template implies. In this case, the read is considered to have failed.
- Throws:
java.io.IOException
java.lang.InterruptedException
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-