public class MetadataReader extends Object
| Modifier and Type | Field and Description |
|---|---|
static String |
SHARDED_FORMAT
The
"sqlflow-sharded" manifest format tag. |
static int |
SUPPORTED_SHARDED_FORMAT_VERSION
Highest
sqlflow-sharded formatVersion this reader understands. |
static int |
UNSUPPORTED_SHARDED_VERSION
Sentinel for a
sqlflow-sharded manifest whose formatVersion is
present but unusable (out of int range, non-integral, or non-numeric). |
| Constructor and Description |
|---|
MetadataReader() |
| Modifier and Type | Method and Description |
|---|---|
static boolean |
isGrabit(String metadata) |
static boolean |
isMetadata(String metadata) |
static boolean |
isSqlflow(String metadata)
Check if the given metadata is in the old sqlflow format.
|
static boolean |
isSqlflowSharded(String metadata) |
static boolean |
isSupportedSqlflowSharded(String metadata)
True iff
metadata is a sqlflow-sharded manifest whose
formatVersion this reader supports (≤ SUPPORTED_SHARDED_FORMAT_VERSION). |
static List<MetadataRelation> |
read(String metadata) |
static int |
shardedFormatVersion(String metadata)
The declared
formatVersion of a sharded manifest, or 1 when the
field is absent (v1 predates the field). |
public static final int SUPPORTED_SHARDED_FORMAT_VERSION
sqlflow-sharded formatVersion this reader understands.
The exporter contract is additive within a major version, so a manifest at or
below this is consumed; a higher one is refused rather than silently mis-parsed.public static final String SHARDED_FORMAT
"sqlflow-sharded" manifest format tag.public static final int UNSUPPORTED_SHARDED_VERSION
sqlflow-sharded manifest whose formatVersion is
present but unusable (out of int range, non-integral, or non-numeric). It never
passes isSupportedSqlflowSharded(java.lang.String), so such a manifest is refused rather
than silently accepted via a lossy conversion.public MetadataReader()
public static int shardedFormatVersion(String metadata)
formatVersion of a sharded manifest, or 1 when the
field is absent (v1 predates the field). Returns -1 when metadata
is not a sqlflow-sharded manifest at all, and
UNSUPPORTED_SHARDED_VERSION when it IS a sharded manifest but the version
field cannot be read as a supported integer.public static boolean isSupportedSqlflowSharded(String metadata)
metadata is a sqlflow-sharded manifest whose
formatVersion this reader supports (≤ SUPPORTED_SHARDED_FORMAT_VERSION).
A manifest with a higher version is a sqlflow-sharded manifest
(isSqlflowSharded(java.lang.String) is still true) but is NOT supported — the caller must
refuse it, not consume it as if it were the supported version.public static List<MetadataRelation> read(String metadata)
public static boolean isMetadata(String metadata)
public static boolean isSqlflow(String metadata)
The old sqlflow format has no format key and identifies itself
via createdBy containing "sqlflow". This is distinct from the newer
sqlflow-sharded format, which has format: "sqlflow-sharded".
Data structure: servers[].queries[] — queries are nested under
servers, not at the root level.
metadata - the JSON string to checkpublic static boolean isSqlflowSharded(String metadata)