trait TableFeatureSupport extends AnyRef
Trait to be mixed into the Protocol case class to enable Table Features.
Protocol reader version 3 and writer version 7 start to support reader and writer table
features. Reader version 3 supports only reader-writer features in an explicit way,
by adding its name to readerFeatures. Similarly, writer version 7 supports only writer-only
or reader-writer features in an explicit way, by adding its name to writerFeatures.
When reading or writing a table, clients MUST respect all supported features.
See also the document of TableFeature for feature-specific terminologies.
- Self Type
- Protocol
- Alphabetic
- By Inheritance
- TableFeatureSupport
- AnyRef
- Any
- Hide All
- Show All
- Public
- All
Value Members
-
final
def
!=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
##(): Int
- Definition Classes
- AnyRef → Any
-
final
def
==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
asInstanceOf[T0]: T0
- Definition Classes
- Any
-
def
canDowngradeTo(to: Protocol, droppedFeatureName: String): Boolean
Determine whether this protocol can be safely downgraded to a new protocol
to.Determine whether this protocol can be safely downgraded to a new protocol
to. All the implicit and explicit features between the two protocols need to match, excluding the dropped feature. We also need to take into account that in some cases the downgrade process may add the CheckpointProtectionTableFeature.Note, the conditions above also account for cases where we downgrade from table features to legacy protocol versions.
-
def
canTransitionTo(to: Protocol, op: Operation): Boolean
True if this protocol can be upgraded or downgraded to the 'to' protocol.
-
def
canUpgradeTo(to: Protocol): Boolean
Determine whether this protocol can be safely upgraded to a new protocol
to.Determine whether this protocol can be safely upgraded to a new protocol
to. This means:- all features supported by this protocol are supported by
to.
Examples regarding feature status:
- from
[appendOnly]to[appendOnly]=> allowed. - from
[appendOnly, changeDataFeed]to[appendOnly]=> not allowed. - from
[appendOnly]to[appendOnly, changeDataFeed]=> allowed.
- all features supported by this protocol are supported by
-
def
clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( ... ) @native()
-
def
denormalized: Protocol
Protocol denormalization is the process of converting a legacy protocol to the the equivalent table features protocol.
Protocol denormalization is the process of converting a legacy protocol to the the equivalent table features protocol. This is the inverse of protocol normalization. It can be used to allow operations on legacy protocols that yield result which cannot be represented anymore by a legacy protocol.
-
def
denormalizedNormalized: Protocol
Helper method that applies both denormalization and normalization.
Helper method that applies both denormalization and normalization. This can be used to normalize invalid legacy protocols such as (2, 3), (1, 5). A legacy protocol is invalid when the version numbers are higher than required to support the implied feature set.
-
final
def
eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
def
equals(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
def
finalize(): Unit
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( classOf[java.lang.Throwable] )
-
final
def
getClass(): Class[_]
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
-
def
hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
-
lazy val
implicitlyAndExplicitlySupportedFeatures: Set[TableFeature]
Get all features that are supported by this protocol, implicitly and explicitly.
Get all features that are supported by this protocol, implicitly and explicitly. When the protocol supports table features, this method returns the same set of features as readerAndWriterFeatureNames; when the protocol does not support table features, this method becomes equivalent to implicitlySupportedFeatures.
- Annotations
- @JsonIgnore()
-
lazy val
implicitlySupportedFeatures: Set[TableFeature]
Get all features that are implicitly supported by this protocol, for example,
Protocol(1,2)implicitly supportsappendOnlyandinvariants.Get all features that are implicitly supported by this protocol, for example,
Protocol(1,2)implicitly supportsappendOnlyandinvariants. When this protocol is capable of requiring writer features, no feature can be implicitly supported.- Annotations
- @JsonIgnore()
-
def
isFeatureSupported(feature: TableFeature): Boolean
Check if a
featureis supported by this protocol.Check if a
featureis supported by this protocol. This means either (a) the protocol does not support table features and implicitly supports the feature, or (b) the protocol supports table features and references the feature. -
final
def
isInstanceOf[T0]: Boolean
- Definition Classes
- Any
-
def
merge(others: Protocol*): Protocol
Merge this protocol with multiple
protocolsto have the highest reader and writer versions plus all explicitly and implicitly supported features. -
lazy val
nativeReaderAndWriterFeatures: Seq[TableFeature]
A sequence of native TableFeatures.
A sequence of native TableFeatures. This is derived by filtering out all explicitly supported legacy features.
- Annotations
- @JsonIgnore()
-
final
def
ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
def
normalized: Protocol
Protocol normalization is the process of converting a table features protocol to the weakest possible form.
Protocol normalization is the process of converting a table features protocol to the weakest possible form. This primarily refers to converting a table features protocol to a legacy protocol. A Table Features protocol can be represented with the legacy representation only when the features set of the former exactly matches a legacy protocol.
Normalization can also decrease the reader version of a table features protocol when it is higher than necessary.
For example: (1, 7, AppendOnly, Invariants, CheckConstraints) -> (1, 3) (3, 7, RowTracking) -> (1, 7, RowTracking)
-
final
def
notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
-
final
def
notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
-
lazy val
readerAndWriterFeatureNames: Set[String]
Get a set of all feature names in this protocol's
readerFeaturesandwriterFeaturesfield.Get a set of all feature names in this protocol's
readerFeaturesandwriterFeaturesfield. Returns an empty set when this protocol supports none of reader and writer features.- Annotations
- @JsonIgnore()
-
lazy val
readerAndWriterFeatures: Seq[TableFeature]
Same as above but returns a sequence of TableFeature instead of a set of feature names.
Same as above but returns a sequence of TableFeature instead of a set of feature names.
- Annotations
- @JsonIgnore()
-
def
readerFeatureNames: Set[String]
Get all feature names in this protocol's
readerFeaturesfield.Get all feature names in this protocol's
readerFeaturesfield. Returns an empty set when this protocol does not support reader features. -
def
removeFeature(targetFeature: TableFeature): Protocol
Remove feature wrapper for removing either Reader/Writer or Writer features.
Remove feature wrapper for removing either Reader/Writer or Writer features. We assume the feature exists in the protocol. There is a relevant validation at AlterTableDropFeatureDeltaCommand. We also require targetFeature is removable.
After removing the feature we normalize the protocol.
-
def
supportsReaderFeatures: Boolean
Check if this protocol is capable of adding features into its
readerFeaturesfield. -
def
supportsWriterFeatures: Boolean
Check if this protocol is capable of adding features into its
writerFeaturesfield. -
final
def
synchronized[T0](arg0: ⇒ T0): T0
- Definition Classes
- AnyRef
-
def
toString(): String
- Definition Classes
- AnyRef → Any
-
final
def
wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... ) @native()
-
def
withFeature(feature: TableFeature): Protocol
Get a new Protocol object that has
featuresupported.Get a new Protocol object that has
featuresupported. Writer-only features will be added towriterFeaturesfield, and reader-writer features will be added toreaderFeaturesandwriterFeaturesfields.If
featureis already implicitly supported in the current protocol's legacy reader or writer protocol version, the new protocol will not modify the original protocol version, i.e., the feature will not be explicitly added to the protocol'sreaderFeaturesorwriterFeatures. This is to avoid unnecessary protocol upgrade for feature that it already supports. -
def
withFeatures(features: Iterable[TableFeature]): Protocol
Get a new Protocol object with multiple features supported.
Get a new Protocol object with multiple features supported.
See the documentation of withFeature for more information.
-
def
writerFeatureNames: Set[String]
Get a set of all feature names in this protocol's
writerFeaturesfield.Get a set of all feature names in this protocol's
writerFeaturesfield. Returns an empty set when this protocol does not support writer features.