Package dev.vortex.spark.io
Class VortexFile
java.lang.Object
dev.vortex.spark.io.VortexFile
- All Implemented Interfaces:
Serializable
A Vortex file and, when a listing already reported it, its size on storage.
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringThe extension every Vortex data file must carry.static final longSize of a file nothing has stat'ed yet. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic booleanhasVortexExtension(String path) Returns whetherpathnames a Vortex data file.longlength()path()static voidrequireVortexExtension(String path) Fails unlesspathnames a Vortex data file.static VortexFileA file whose size is not known yet.
-
Field Details
-
EXTENSION
The extension every Vortex data file must carry.- See Also:
-
UNKNOWN_LENGTH
public static final long UNKNOWN_LENGTHSize of a file nothing has stat'ed yet. Whoever opens it pays for the stat, if it needs one at all.- See Also:
-
-
Constructor Details
-
VortexFile
- Parameters:
path- the path as the caller spelled it, not as Hadoop qualifies itlength- size in bytes, orUNKNOWN_LENGTHfor a path named directly rather than listed
-
-
Method Details
-
path
-
length
public long length() -
unsized
A file whose size is not known yet. -
hasVortexExtension
Returns whetherpathnames a Vortex data file.Spark's file index hides names that begin with
_or., but it keeps_metadataand_common_metadata, and it keeps every other extension. The connector reads only files that carryEXTENSION, so this is the one test that decides what belongs to a Vortex dataset. The readers skip every other listed file. -
requireVortexExtension
Fails unlesspathnames a Vortex data file.- Throws:
IllegalArgumentException- if the path does not carryEXTENSION
-