Package com.linkedin.venice.controller
Class AdminTopicMetadataAccessor
java.lang.Object
com.linkedin.venice.controller.AdminTopicMetadataAccessor
- Direct Known Subclasses:
InMemoryAdminTopicMetadataAccessor
,ZkAdminTopicMetadataAccessor
This class provides a set of methods to access and update metadata for admin topics.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final String
static final String
static final String
static final String
static final Long
static final String
When remote consumption is enabled, child controller will consume directly from the source admin topic; an extra metadata called upstream offset will be maintained, which indicate the last offset in the source admin topic that gets processed successfully.static final String
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongenerateMetadataMap
(Optional<Long> localOffset, Optional<Long> upstreamOffset, Optional<Long> executionId, Optional<Long> adminOperationProtocolVersion) static long
getAdminOperationProtocolVersion
(Map<String, Long> metadata) static long
getExecutionId
(AdminMetadata metadata) static long
getExecutionId
(Map<String, Long> metadata) abstract AdminMetadata
getMetadata
(String clusterName) Retrieve the latest metadata.getOffsets
(AdminMetadata metadata) getOffsets
(Map<String, Long> metadata) getPositions
(AdminMetadata metadata) abstract void
updateMetadata
(String clusterName, AdminMetadata metadata) Update specific metadata for a given cluster in a single transaction with information provided in metadata.
-
Field Details
-
OFFSET_KEY
- See Also:
-
POSITION_KEY
- See Also:
-
UPSTREAM_OFFSET_KEY
When remote consumption is enabled, child controller will consume directly from the source admin topic; an extra metadata called upstream offset will be maintained, which indicate the last offset in the source admin topic that gets processed successfully.- See Also:
-
UPSTREAM_POSITION_KEY
- See Also:
-
EXECUTION_ID_KEY
- See Also:
-
ADMIN_OPERATION_PROTOCOL_VERSION_KEY
- See Also:
-
UNDEFINED_VALUE
-
-
Constructor Details
-
AdminTopicMetadataAccessor
public AdminTopicMetadataAccessor()
-
-
Method Details
-
generateMetadataMap
public static Map<String,Long> generateMetadataMap(Optional<Long> localOffset, Optional<Long> upstreamOffset, Optional<Long> executionId, Optional<Long> adminOperationProtocolVersion) - Returns:
- a map with OFFSET_KEY, UPSTREAM_OFFSET_KEY, EXECUTION_ID_KEY, ADMIN_OPERATION_PROTOCOL_VERSION_KEY specified to input values.
-
getOffsets
- Returns:
- a pair of values to which the specified keys are mapped to OFFSET_KEY and UPSTREAM_OFFSET_KEY.
-
getPositions
-
getExecutionId
- Returns:
- the value to which the specified key is mapped to EXECUTION_ID_KEY.
-
getAdminOperationProtocolVersion
- Returns:
- the value to which the specified key is mapped to ADMIN_OPERATION_PROTOCOL_VERSION_KEY.
-
getOffsets
- Returns:
- a pair of values representing local and upstream offsets
-
getExecutionId
- Returns:
- the execution ID from the metadata
-
updateMetadata
Update specific metadata for a given cluster in a single transaction with information provided in metadata.- Parameters:
clusterName
- of the cluster at interest.metadata
- AdminMetadata containing relevant information.
-
getMetadata
Retrieve the latest metadata.- Parameters:
clusterName
- of the cluster at interest.- Returns:
- AdminMetadata containing all metadata information
-