Interface ModelEvent
- All Superinterfaces:
Converter<org.apache.polaris.core.entity.EventEntity>
@PolarisImmutable
public interface ModelEvent
extends Converter<org.apache.polaris.core.entity.EventEntity>
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Stringstatic final Stringstatic final ModelEventDummy instance to be used as a Converter when calling #fromResultSet().static final Stringstatic final Stringstatic final StringLegacy sentinel stored inevents.catalog_idfor events that are not catalog-scoped on schema versions < 5, where the column isNOT NULL.static final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final String -
Method Summary
Modifier and TypeMethodDescriptionstatic ModelEventfromEvent(org.apache.polaris.core.entity.EventEntity event, int schemaVersion) default org.apache.polaris.core.entity.EventEntityConverts a ResultSet to model.@Nullable String@Nullable String@Nullable Stringorg.apache.polaris.core.entity.EventEntity.ResourceTypelongstatic org.apache.polaris.core.entity.EventEntitytoEvent(ModelEvent model) toMap(DatabaseType databaseType) Convert a model into a Map with keys as snake case names, and values as values of member of model obj.Methods inherited from interface org.apache.polaris.persistence.relational.jdbc.models.Converter
toJsonbPGobject
-
Field Details
-
TABLE_NAME
- See Also:
-
CATALOG_ID
- See Also:
-
EVENT_ID
- See Also:
-
REQUEST_ID
- See Also:
-
EVENT_TYPE
- See Also:
-
TIMESTAMP_MS
- See Also:
-
PRINCIPAL_NAME
- See Also:
-
RESOURCE_TYPE
- See Also:
-
RESOURCE_IDENTIFIER
- See Also:
-
ADDITIONAL_PROPERTIES
- See Also:
-
LEGACY_REALM_SCOPED_CATALOG_ID
Legacy sentinel stored inevents.catalog_idfor events that are not catalog-scoped on schema versions < 5, where the column isNOT NULL. Never exposed outside the JDBC layer:fromEvent(EventEntity, int)substitutes it for a null catalog id on pre-v5 schemas, andfromResultSet(java.sql.ResultSet)coalesces it back to null on read.Because
fromResultSet(java.sql.ResultSet)cannot know which schema version a row was written under, the coalescing is unconditional, so this string remains reserved on all schema versions: a catalog literally named__realm__would have its events read back as realm-scoped.- See Also:
-
ALL_COLUMNS
-
CONVERTER
Dummy instance to be used as a Converter when calling #fromResultSet().FIXME: fromResultSet() is a factory method and should be static or moved to a factory class.
-
-
Method Details
-
getCatalogId
@Nullable String getCatalogId() -
getEventId
String getEventId() -
getRequestId
@Nullable String getRequestId() -
getEventType
String getEventType() -
getTimestampMs
long getTimestampMs() -
getPrincipalName
@Nullable String getPrincipalName() -
getResourceType
org.apache.polaris.core.entity.EventEntity.ResourceType getResourceType() -
getResourceIdentifier
String getResourceIdentifier() -
getAdditionalProperties
String getAdditionalProperties() -
fromResultSet
Description copied from interface:ConverterConverts a ResultSet to model.- Specified by:
fromResultSetin interfaceConverter<org.apache.polaris.core.entity.EventEntity>- Parameters:
rs- : ResultSet from JDBC.- Returns:
- the corresponding business entity
- Throws:
SQLException- : Exception while fetching from ResultSet.
-
toMap
Description copied from interface:ConverterConvert a model into a Map with keys as snake case names, and values as values of member of model obj. -
fromEvent
-
toEvent
-