Class StoragePath
java.lang.Object
org.elasticsearch.xpack.esql.datasources.spi.StoragePath
Represents a location in a storage system.
Uses URI-like format: scheme://[userInfo@]host[:port][/path]
Unlike java.net.URI, this class:
- Does not perform URL encoding/decoding
- Has simpler parsing rules suitable for blob storage keys
- Provides convenient methods for path manipulation
The userInfo component is preserved verbatim and exposed via
userInfo().
Its meaning is provider-defined: for Azure WASB(S) URIs in the canonical
Hadoop/Spark form (wasbs://<container>@<account>.blob.core.windows.net/<blob>),
the userInfo is the container name. The boundary between userInfo and host is the
last '@' in the authority, per RFC 3986.
Note: glob pattern detection (isPattern()) only inspects the path component.
Glob characters in the scheme or authority (e.g. s3://bucket-*/data/) are
not detected as patterns and will be treated as literal text.-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionappendPath(String element) booleanstatic StringConverts a local filesystemPathto a properly formattedfile://URI string.globPart()Returns the glob portion of the path (everything after the prefix directory).inthashCode()host()booleanReturns true if the path contains glob metacharacters: *, ?, {, [Returns the path component adjusted for use as a local filesystem path.static StoragePathstatic StoragePathofLocalPath(Path path) path()Returns a new StoragePath truncated to the longest non-pattern prefix directory.intport()scheme()toString()userInfo()Returns the userInfo component of the URI authority, ornullwhen absent.
-
Field Details
-
SCHEME_SEPARATOR
- See Also:
-
PATH_SEPARATOR
- See Also:
-
PORT_SEPARATOR
- See Also:
-
GLOB_METACHARACTERS
public static final char[] GLOB_METACHARACTERS
-
-
Method Details
-
fileUri
Converts a local filesystemPathto a properly formattedfile://URI string. Normalizes Windows backslashes and ensures the URI has three slashes (file:///). -
ofLocalPath
Builds a canonicalfile://StoragePathfrom a local filesystemPath. All local producers (directory listings, the query's location, per-object stats keys) must funnel through this so their normalized locations cannot diverge; divergence between two such producers is exactly what broke stats reconciliation on Windows. -
of
-
scheme
-
userInfo
Returns the userInfo component of the URI authority, ornullwhen absent. Empty userInfo (e.g."scheme://@host/x") is normalized tonull. The value is preserved verbatim (no URL decoding) and is provider-defined: Azure WASB(S) URIs in canonical Hadoop form carry the container name here. -
host
-
port
public int port() -
path
-
localPath
Returns the path component adjusted for use as a local filesystem path. On Windows, file:// URIs produce paths like/C:/dir/filewhere the leading slash is invalid for the OS. This method strips it when a drive letter is detected so the result can be passed toPathUtils.get()safely. -
objectName
-
parentDirectory
-
appendPath
-
isPattern
public boolean isPattern()Returns true if the path contains glob metacharacters: *, ?, {, [ -
patternPrefix
Returns a new StoragePath truncated to the longest non-pattern prefix directory. e.g. "s3://b/data/2024/*.parquet" -> "s3://b/data/2024/" -
globPart
Returns the glob portion of the path (everything after the prefix directory). e.g. "s3://b/data/2024/*.parquet" -> "*.parquet" -
toString
-
equals
-
hashCode
public int hashCode()
-