Interface SchemaRegistry
- All Superinterfaces:
SchemaVersionFetcher
- All Known Implementing Classes:
AbstractSchemaRegistry,KafkaSchemaRegistry
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionvoidaddCustomHandler(org.eclipse.jetty.server.Handler.Singleton handler) default voidaddLeaderChangeListener(Consumer<Boolean> listener) voidaddUpdateRequestHandler(UpdateRequestHandler updateRequestHandler) default voiddefault voidvoidclose()config()default AssociationResponsecreateAssociation(String context, boolean dryRun, AssociationCreateOrUpdateRequest request) default AssociationResponsecreateAssociationOrForward(String context, boolean dryRun, AssociationCreateOrUpdateRequest request, Map<String, String> headerProperties) default AssociationResponsecreateOrUpdateAssociation(String context, boolean dryRun, AssociationCreateOrUpdateRequest request) default AssociationResponsecreateOrUpdateAssociationOrForward(String context, boolean dryRun, AssociationCreateOrUpdateRequest request, Map<String, String> headerProperties) default voiddeleteAssociations(String resourceId, String resourceType, List<String> associationTypes, boolean cascadeLifecycle) default voiddeleteAssociationsOrForward(String subject, String resourceId, String resourceType, List<String> associationTypes, boolean cascadeLifecycle, boolean dryRun, Map<String, String> headerProperties) default voiddeleteConfigOrForward(String subject, Map<String, String> headerProperties) voiddeleteContext(String delimitedContext) default voiddeleteContextOrForward(Map<String, String> requestProperties, String delimitedContext) voiddeleteSchemaVersion(String subject, Schema schema, boolean permanentDelete) default voiddeleteSchemaVersionOrForward(Map<String, String> headerProperties, String subject, Schema schema, boolean permanentDelete) deleteSubject(String subject, boolean permanentDelete) voiddeleteSubjectConfig(String subject) voiddeleteSubjectMode(String subject) default voiddeleteSubjectMode(String subject, boolean recursive) default voiddeleteSubjectModeOrForward(String subject, boolean recursive, Map<String, String> headerProperties) deleteSubjectOrForward(Map<String, String> requestProperties, String subject, boolean permanentDelete) voidextractSchemaTags(Schema schema, List<String> tags) getAllVersions(String subject, LookupFilter filter) default AssociationgetAssociationByGuid(String guid) default List<Association>getAssociationsByResourceId(String resourceId, String resourceType, List<String> associationTypes, LifecyclePolicy lifecycle) default List<Association>getAssociationsByResourceName(String resourceName, String resourceNamespace, String resourceType, List<String> associationTypes, LifecyclePolicy lifecycle) default List<Association>getAssociationsBySubject(String subject, String resourceType, List<String> associationTypes, LifecyclePolicy lifecycle) default SchemagetByVersion(String subject, int version, boolean returnDeletedSchema) getConfigInScope(String subject) List<org.eclipse.jetty.server.Handler.Singleton>default Stringdefault StringgetLatestVersion(String subject) getLatestWithMetadata(String subject, Map<String, String> metadata, boolean lookupDeletedSchema) getModeInScope(String subject) getReferencedBy(String subject, VersionId versionId, boolean lookupDeletedSchema) getSchemaValue(SchemaKey key) getUsingContexts(String subject, int version, boolean returnDeletedSchema) getVersionsWithSubjectPrefix(String prefix, boolean includeAliases, LookupFilter filter, boolean latestOnly, Predicate<Schema> postFilter) booleanhasSubjects(String subject, boolean lookupDeletedSubjects) booleanhealthy()voidinit()booleandefault voidinvalidateFromNewSchemaCache(Schema schemaKey) isCompatible(String subject, Schema newSchema, List<SchemaKey> previousSchemas, boolean normalize) default booleanisLeader()default SchemaRegistryIdentitydefault RestServicelistIdsForGuid(String guid) listSubjects(LookupFilter filter) listSubjectsForId(int id, String subject) listSubjectsForId(int id, String subject, boolean returnDeleted) listSubjectsWithPrefix(String prefix, LookupFilter filter) listVersionsForId(int id, String subject, boolean lookupDeleted) default SchemalookUpSchemaUnderSubject(String subject, Schema schema, boolean lookupDeletedSchema) lookUpSchemaUnderSubject(String subject, Schema schema, boolean normalize, boolean lookupDeletedSchema) lookUpSchemaUnderSubjectUsingContexts(String subject, Schema schema, boolean normalize, boolean lookupDeletedSchema) default SchemamodifySchemaTagsOrForward(String subject, Schema schema, TagSchemaRequest request, Map<String, String> headerProperties) default AssociationBatchResponsemutateAssociations(String context, boolean dryRun, AssociationBatchRequest request) default AssociationBatchResponsemutateAssociationsOrForward(String context, boolean dryRun, AssociationBatchRequest request, Map<String, String> headerProperties) intnormalizeContextLimit(int suppliedLimit) intnormalizeSchemaLimit(int suppliedLimit) intnormalizeSubjectLimit(int suppliedLimit) intnormalizeSubjectVersionLimit(int suppliedLimit) parseSchema(Schema schema) parseSchema(Schema schema, boolean isNew, boolean normalize) voidpostInit()default Schemadefault Schemadefault SchemaregisterOrForward(String subject, RegisterSchemaRequest request, boolean normalize, Map<String, String> headerProperties) schemaProvider(String schemaType) booleanschemaVersionExists(String subject, VersionId versionId, boolean returnDeletedSchema) default voidsetLeader(SchemaRegistryIdentity newLeader) voidsetMode(String subject, ModeUpdateRequest mode) voidsetMode(String subject, ModeUpdateRequest request, boolean force) default voidsetModeOrForward(String subject, ModeUpdateRequest mode, boolean force, Map<String, String> headerProperties) voidsetRuleSetHandler(RuleSetHandler ruleSetHandler) default voidCan be used by subclasses to implement multi-tenancydefault Stringtenant()toSchemaEntity(SchemaValue schemaValue) updateConfig(String subject, ConfigUpdateRequest config) default ConfigupdateConfigOrForward(String subject, ConfigUpdateRequest newConfig, Map<String, String> headerProperties)
-
Field Details
-
MIN_VERSION
static final int MIN_VERSIONSchema versions under a particular subject are indexed from MIN_VERSION.- See Also:
-
MAX_VERSION
static final int MAX_VERSION- See Also:
-
DEFAULT_TENANT
- See Also:
-
RESOURCE_WILDCARD
- See Also:
-
RESERVED_FIELD_REMOVED
- See Also:
-
FIELD_CONFLICTS_WITH_RESERVED_FIELD
- See Also:
-
-
Method Details
-
init
- Throws:
SchemaRegistryException
-
schemaTypes
-
register
- Throws:
SchemaRegistryException
-
register
default Schema register(String subject, Schema schema, boolean normalize) throws SchemaRegistryException - Throws:
SchemaRegistryException
-
register
Schema register(String subject, Schema schema, boolean normalize, boolean propagateSchemaTags) throws SchemaRegistryException - Throws:
SchemaRegistryException
-
getByVersion
- Specified by:
getByVersionin interfaceSchemaVersionFetcher
-
get
- Throws:
SchemaRegistryException
-
get
- Throws:
SchemaRegistryException
-
get
SchemaString get(int id, String subject, String format, boolean fetchMaxId) throws SchemaRegistryException - Throws:
SchemaRegistryException
-
listSubjects
- Throws:
SchemaRegistryException
-
listSubjects
- Throws:
SchemaRegistryException
-
listSubjectsForId
- Throws:
SchemaRegistryException
-
listSubjectsForId
Set<String> listSubjectsForId(int id, String subject, boolean returnDeleted) throws SchemaRegistryException - Throws:
SchemaRegistryException
-
getAllVersions
Iterator<SchemaKey> getAllVersions(String subject, LookupFilter filter) throws SchemaRegistryException - Throws:
SchemaRegistryException
-
getVersionsWithSubjectPrefix
Iterator<ExtendedSchema> getVersionsWithSubjectPrefix(String prefix, boolean includeAliases, LookupFilter filter, boolean latestOnly, Predicate<Schema> postFilter) throws SchemaRegistryException - Throws:
SchemaRegistryException
-
getLatestVersion
- Throws:
SchemaRegistryException
-
deleteSubject
- Throws:
SchemaRegistryException
-
deleteContext
- Throws:
SchemaRegistryException
-
lookUpSchemaUnderSubject
default Schema lookUpSchemaUnderSubject(String subject, Schema schema, boolean lookupDeletedSchema) throws SchemaRegistryException - Throws:
SchemaRegistryException
-
lookUpSchemaUnderSubject
Schema lookUpSchemaUnderSubject(String subject, Schema schema, boolean normalize, boolean lookupDeletedSchema) throws SchemaRegistryException - Throws:
SchemaRegistryException
-
getLatestWithMetadata
Schema getLatestWithMetadata(String subject, Map<String, String> metadata, boolean lookupDeletedSchema) throws SchemaRegistryException- Throws:
SchemaRegistryException
-
isCompatible
List<String> isCompatible(String subject, Schema newSchema, List<SchemaKey> previousSchemas, boolean normalize) throws SchemaRegistryException - Throws:
SchemaRegistryException
-
close
- Throws:
IOException
-
deleteSchemaVersion
void deleteSchemaVersion(String subject, Schema schema, boolean permanentDelete) throws SchemaRegistryException - Throws:
SchemaRegistryException
-
tenant
- Specified by:
tenantin interfaceSchemaVersionFetcher
-
setTenant
Can be used by subclasses to implement multi-tenancy- Parameters:
tenant- the tenant
-
config
SchemaRegistryConfig config() -
properties
-
getMetadataEncoder
MetadataEncoderService getMetadataEncoder() -
addUpdateRequestHandler
-
getModeInScope
- Throws:
SchemaRegistryStoreException
-
getCustomHandler
List<org.eclipse.jetty.server.Handler.Singleton> getCustomHandler() -
postInit
- Throws:
SchemaRegistryException
-
getCompositeUpdateRequestHandler
UpdateRequestHandler getCompositeUpdateRequestHandler() -
normalizeContextLimit
int normalizeContextLimit(int suppliedLimit) -
getConfigInScope
- Throws:
SchemaRegistryStoreException
-
getConfig
- Throws:
SchemaRegistryStoreException
-
listContexts
- Throws:
SchemaRegistryException
-
lookUpSchemaUnderSubjectUsingContexts
Schema lookUpSchemaUnderSubjectUsingContexts(String subject, Schema schema, boolean normalize, boolean lookupDeletedSchema) throws SchemaRegistryException - Throws:
SchemaRegistryException
-
hasSubjects
boolean hasSubjects(String subject, boolean lookupDeletedSubjects) throws SchemaRegistryStoreException - Throws:
SchemaRegistryStoreException
-
parseSchema
- Throws:
InvalidSchemaException
-
parseSchema
ParsedSchema parseSchema(Schema schema, boolean isNew, boolean normalize) throws InvalidSchemaException - Throws:
InvalidSchemaException
-
listSubjectsWithPrefix
Set<String> listSubjectsWithPrefix(String prefix, LookupFilter filter) throws SchemaRegistryException - Throws:
SchemaRegistryException
-
normalizeSubjectLimit
int normalizeSubjectLimit(int suppliedLimit) -
normalizeSchemaLimit
int normalizeSchemaLimit(int suppliedLimit) -
extractSchemaTags
- Throws:
SchemaRegistryException
-
listVersionsForId
List<SubjectVersion> listVersionsForId(int id, String subject, boolean lookupDeleted) throws SchemaRegistryException - Throws:
SchemaRegistryException
-
normalizeSubjectVersionLimit
int normalizeSubjectVersionLimit(int suppliedLimit) -
getByGuid
- Throws:
SchemaRegistryException
-
listIdsForGuid
- Throws:
SchemaRegistryException
-
getUsingContexts
Schema getUsingContexts(String subject, int version, boolean returnDeletedSchema) throws SchemaRegistryException - Throws:
SchemaRegistryException
-
getReferencedBy
List<ContextId> getReferencedBy(String subject, VersionId versionId, boolean lookupDeletedSchema) throws SchemaRegistryException - Throws:
SchemaRegistryException
-
schemaVersionExists
boolean schemaVersionExists(String subject, VersionId versionId, boolean returnDeletedSchema) throws SchemaRegistryException - Throws:
SchemaRegistryException
-
getMode
- Throws:
SchemaRegistryStoreException
-
getMetricsContainer
MetricsContainer getMetricsContainer() -
getResourceExtensions
List<SchemaRegistryResourceExtension> getResourceExtensions() -
updateConfig
Config updateConfig(String subject, ConfigUpdateRequest config) throws SchemaRegistryStoreException, OperationNotPermittedException, UnknownLeaderException -
deleteSubjectConfig
void deleteSubjectConfig(String subject) throws SchemaRegistryStoreException, OperationNotPermittedException -
setMode
void setMode(String subject, ModeUpdateRequest request, boolean force) throws SchemaRegistryException - Throws:
SchemaRegistryException
-
setMode
- Throws:
SchemaRegistryException
-
schemaProvider
-
toSchemaEntity
- Throws:
SchemaRegistryStoreException
-
getSchemaValue
- Throws:
SchemaRegistryException
-
subjects
Set<String> subjects(String subject, boolean lookupDeletedSubjects) throws SchemaRegistryStoreException - Throws:
SchemaRegistryStoreException
-
addCustomHandler
void addCustomHandler(org.eclipse.jetty.server.Handler.Singleton handler) -
deleteSubjectMode
void deleteSubjectMode(String subject) throws SchemaRegistryStoreException, OperationNotPermittedException -
deleteSubjectMode
default void deleteSubjectMode(String subject, boolean recursive) throws SchemaRegistryStoreException, OperationNotPermittedException -
getRuleSetHandler
RuleSetHandler getRuleSetHandler() -
setRuleSetHandler
-
getHostnameVerifier
- Throws:
SchemaRegistryStoreException
-
myIdentity
SchemaRegistryIdentity myIdentity() -
initialized
boolean initialized() -
healthy
boolean healthy() -
getSslFactory
SslFactory getSslFactory() -
getLookupCache
LookupCache<SchemaRegistryKey,SchemaRegistryValue> getLookupCache() -
getKafkaStore
-
clearOldSchemaCache
default void clearOldSchemaCache() -
clearNewSchemaCache
default void clearNewSchemaCache() -
invalidateFromNewSchemaCache
-
getGroupId
-
getKafkaClusterId
-
deleteSubjectModeOrForward
default void deleteSubjectModeOrForward(String subject, boolean recursive, Map<String, String> headerProperties) throws SchemaRegistryStoreException, SchemaRegistryRequestForwardingException, OperationNotPermittedException, UnknownLeaderException -
setModeOrForward
default void setModeOrForward(String subject, ModeUpdateRequest mode, boolean force, Map<String, String> headerProperties) throws SchemaRegistryException- Throws:
SchemaRegistryException
-
deleteSchemaVersionOrForward
default void deleteSchemaVersionOrForward(Map<String, String> headerProperties, String subject, Schema schema, boolean permanentDelete) throws SchemaRegistryException- Throws:
SchemaRegistryException
-
modifySchemaTagsOrForward
default Schema modifySchemaTagsOrForward(String subject, Schema schema, TagSchemaRequest request, Map<String, String> headerProperties) throws SchemaRegistryException- Throws:
SchemaRegistryException
-
registerOrForward
default Schema registerOrForward(String subject, RegisterSchemaRequest request, boolean normalize, Map<String, String> headerProperties) throws SchemaRegistryException- Throws:
SchemaRegistryException
-
deleteSubjectOrForward
default List<Integer> deleteSubjectOrForward(Map<String, String> requestProperties, String subject, boolean permanentDelete) throws SchemaRegistryException- Throws:
SchemaRegistryException
-
updateConfigOrForward
default Config updateConfigOrForward(String subject, ConfigUpdateRequest newConfig, Map<String, String> headerProperties) throws SchemaRegistryStoreException, SchemaRegistryRequestForwardingException, UnknownLeaderException, OperationNotPermittedException -
deleteConfigOrForward
default void deleteConfigOrForward(String subject, Map<String, String> headerProperties) throws SchemaRegistryStoreException, SchemaRegistryRequestForwardingException, OperationNotPermittedException, UnknownLeaderException -
deleteContextOrForward
default void deleteContextOrForward(Map<String, String> requestProperties, String delimitedContext) throws SchemaRegistryException- Throws:
SchemaRegistryException
-
createAssociation
default AssociationResponse createAssociation(String context, boolean dryRun, AssociationCreateOrUpdateRequest request) throws SchemaRegistryException - Throws:
SchemaRegistryException
-
createAssociationOrForward
default AssociationResponse createAssociationOrForward(String context, boolean dryRun, AssociationCreateOrUpdateRequest request, Map<String, String> headerProperties) throws SchemaRegistryException- Throws:
SchemaRegistryException
-
mutateAssociations
default AssociationBatchResponse mutateAssociations(String context, boolean dryRun, AssociationBatchRequest request) -
mutateAssociationsOrForward
default AssociationBatchResponse mutateAssociationsOrForward(String context, boolean dryRun, AssociationBatchRequest request, Map<String, String> headerProperties) throws SchemaRegistryException- Throws:
SchemaRegistryException
-
createOrUpdateAssociation
default AssociationResponse createOrUpdateAssociation(String context, boolean dryRun, AssociationCreateOrUpdateRequest request) throws SchemaRegistryException - Throws:
SchemaRegistryException
-
createOrUpdateAssociationOrForward
default AssociationResponse createOrUpdateAssociationOrForward(String context, boolean dryRun, AssociationCreateOrUpdateRequest request, Map<String, String> headerProperties) throws SchemaRegistryException- Throws:
SchemaRegistryException
-
getAssociationByGuid
- Throws:
SchemaRegistryException
-
getAssociationsBySubject
default List<Association> getAssociationsBySubject(String subject, String resourceType, List<String> associationTypes, LifecyclePolicy lifecycle) throws SchemaRegistryException - Throws:
SchemaRegistryException
-
getAssociationsByResourceId
default List<Association> getAssociationsByResourceId(String resourceId, String resourceType, List<String> associationTypes, LifecyclePolicy lifecycle) throws SchemaRegistryException - Throws:
SchemaRegistryException
-
getAssociationsByResourceName
default List<Association> getAssociationsByResourceName(String resourceName, String resourceNamespace, String resourceType, List<String> associationTypes, LifecyclePolicy lifecycle) throws SchemaRegistryException - Throws:
SchemaRegistryException
-
deleteAssociations
default void deleteAssociations(String resourceId, String resourceType, List<String> associationTypes, boolean cascadeLifecycle) throws SchemaRegistryException - Throws:
SchemaRegistryException
-
deleteAssociationsOrForward
default void deleteAssociationsOrForward(String subject, String resourceId, String resourceType, List<String> associationTypes, boolean cascadeLifecycle, boolean dryRun, Map<String, String> headerProperties) throws SchemaRegistryException- Throws:
SchemaRegistryException
-
addLeaderChangeListener
-
isLeader
default boolean isLeader() -
leaderIdentity
-
leaderRestService
-
setLeader
default void setLeader(@Nullable SchemaRegistryIdentity newLeader) throws SchemaRegistryTimeoutException, SchemaRegistryStoreException, IdGenerationException
-