Class CachedSchemaRegistryClient
java.lang.Object
io.confluent.kafka.schemaregistry.client.CachedSchemaRegistryClient
- All Implemented Interfaces:
SchemaRegistryClient,SchemaVersionFetcher,Closeable,AutoCloseable
Thread-safe Schema Registry Client with client side caching.
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionCachedSchemaRegistryClient(RestService restService, int cacheCapacity) CachedSchemaRegistryClient(RestService restService, int cacheCapacity, List<SchemaProvider> providers, Map<String, ?> configs, Map<String, String> httpHeaders) CachedSchemaRegistryClient(RestService restService, int cacheCapacity, List<SchemaProvider> providers, Map<String, ?> configs, Map<String, String> httpHeaders, com.google.common.base.Ticker ticker) CachedSchemaRegistryClient(RestService restService, int cacheCapacity, Map<String, ?> configs) CachedSchemaRegistryClient(RestService restService, int cacheCapacity, Map<String, ?> originals, Map<String, String> httpHeaders) CachedSchemaRegistryClient(String baseUrl, int cacheCapacity) CachedSchemaRegistryClient(String baseUrls, int identityMapCapacity, List<SchemaProvider> providers, Map<String, ?> originals) CachedSchemaRegistryClient(String baseUrls, int cacheCapacity, List<SchemaProvider> providers, Map<String, ?> originals, Map<String, String> httpHeaders) CachedSchemaRegistryClient(String baseUrl, int cacheCapacity, Map<String, ?> originals) CachedSchemaRegistryClient(String baseUrl, int cacheCapacity, Map<String, ?> originals, Map<String, String> httpHeaders) CachedSchemaRegistryClient(List<String> baseUrls, int cacheCapacity) CachedSchemaRegistryClient(List<String> baseUrls, int cacheCapacity, List<SchemaProvider> providers, Map<String, ?> originals) CachedSchemaRegistryClient(List<String> baseUrls, int cacheCapacity, List<SchemaProvider> providers, Map<String, ?> originals, Map<String, String> httpHeaders) CachedSchemaRegistryClient(List<String> baseUrls, int cacheCapacity, Map<String, ?> originals) CachedSchemaRegistryClient(List<String> baseUrls, int cacheCapacity, Map<String, ?> originals, Map<String, String> httpHeaders) -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()voiddeleteConfig(String subject) voiddeleteMode(String subject) deleteSchemaVersion(String subject, String version, boolean isPermanent) deleteSchemaVersion(Map<String, String> requestProperties, String subject, String version, boolean isPermanent) deleteSubject(String subject, boolean isPermanent) deleteSubject(Map<String, String> requestProperties, String subject, boolean isPermanent) getAllSubjects(boolean lookupDeletedSubject) getAllSubjectsById(int id) getAllSubjectsByPrefix(String subjectPrefix) getAllVersions(String subject) getAllVersions(String subject, boolean lookupDeletedSchema) getAllVersionsById(int id) getByVersion(String subject, int version, boolean lookupDeletedSchema) getGuid(String subject, ParsedSchema schema) getGuid(String subject, ParsedSchema schema, boolean normalize) intgetId(String subject, ParsedSchema schema) intgetId(String subject, ParsedSchema schema, boolean normalize) getIdWithResponse(String subject, ParsedSchema schema, boolean normalize) getLatestSchemaMetadata(String subject) getLatestWithMetadata(String subject, Map<String, String> metadata, boolean lookupDeletedSchema) getMode()getSchemaByGuid(String guid, String format) protected ParsedSchemagetSchemaByGuidFromRegistry(String guid, String format) getSchemaById(int id) protected ParsedSchemagetSchemaByIdFromRegistry(int id, String subject) getSchemaBySubjectAndId(String subject, int id) getSchemaMetadata(String subject, int version) getSchemaMetadata(String subject, int version, boolean lookupDeletedSchema) getSchemas(String subjectPrefix, boolean lookupDeletedSchema, boolean latestOnly) intgetVersion(String subject, ParsedSchema schema) intgetVersion(String subject, ParsedSchema schema, boolean normalize) parseSchema(Schema schema) parseSchema(String schemaType, String schemaString, List<SchemaReference> references) parseSchemaOrElseThrow(Schema schema) intregister(String subject, ParsedSchema schema) intregister(String subject, ParsedSchema schema, boolean normalize) intregister(String subject, ParsedSchema schema, int version, int id) registerWithResponse(String subject, ParsedSchema schema, boolean normalize, boolean propagateSchemaTags) voidreset()booleantestCompatibility(String subject, ParsedSchema schema) testCompatibilityVerbose(String subject, ParsedSchema schema) testCompatibilityVerbose(String subject, ParsedSchema schema, boolean normalize) com.google.common.base.Tickerticker()updateConfig(String subject, Config config) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface io.confluent.kafka.schemaregistry.client.SchemaRegistryClient
createAssociation, createOrUpdateAssociation, deleteAssociations, deleteCompatibility, deleteSchemaVersion, deleteSchemaVersion, deleteSubject, deleteSubject, getAssociationsByResourceId, getAssociationsBySubject, getById, getByID, getBySubjectAndId, getBySubjectAndID, getCompatibility, getId, getVersion, parseSchema, register, register, registerWithResponse, tenant, testCompatibility, updateCompatibility
-
Field Details
-
DEFAULT_REQUEST_PROPERTIES
-
-
Constructor Details
-
CachedSchemaRegistryClient
-
CachedSchemaRegistryClient
-
CachedSchemaRegistryClient
-
CachedSchemaRegistryClient
-
CachedSchemaRegistryClient
-
CachedSchemaRegistryClient
-
CachedSchemaRegistryClient
public CachedSchemaRegistryClient(String baseUrls, int identityMapCapacity, List<SchemaProvider> providers, Map<String, ?> originals) -
CachedSchemaRegistryClient
public CachedSchemaRegistryClient(RestService restService, int cacheCapacity, Map<String, ?> configs) -
CachedSchemaRegistryClient
-
CachedSchemaRegistryClient
-
CachedSchemaRegistryClient
-
CachedSchemaRegistryClient
-
CachedSchemaRegistryClient
-
CachedSchemaRegistryClient
public CachedSchemaRegistryClient(RestService restService, int cacheCapacity, List<SchemaProvider> providers, Map<String, ?> configs, Map<String, String> httpHeaders) -
CachedSchemaRegistryClient
public CachedSchemaRegistryClient(RestService restService, int cacheCapacity, List<SchemaProvider> providers, Map<String, ?> configs, Map<String, String> httpHeaders, com.google.common.base.Ticker ticker)
-
-
Method Details
-
ticker
public com.google.common.base.Ticker ticker()- Specified by:
tickerin interfaceSchemaRegistryClient
-
parseSchema
public Optional<ParsedSchema> parseSchema(String schemaType, String schemaString, List<SchemaReference> references) - Specified by:
parseSchemain interfaceSchemaRegistryClient
-
parseSchema
- Specified by:
parseSchemain interfaceSchemaRegistryClient
-
parseSchemaOrElseThrow
- Specified by:
parseSchemaOrElseThrowin interfaceSchemaRegistryClient- Throws:
IOException
-
getSchemaProviders
-
getSchemaByIdFromRegistry
protected ParsedSchema getSchemaByIdFromRegistry(int id, String subject) throws IOException, RestClientException - Throws:
IOExceptionRestClientException
-
getSchemaByGuidFromRegistry
protected ParsedSchema getSchemaByGuidFromRegistry(String guid, String format) throws IOException, RestClientException - Throws:
IOExceptionRestClientException
-
register
- Specified by:
registerin interfaceSchemaRegistryClient- Throws:
IOExceptionRestClientException
-
register
public int register(String subject, ParsedSchema schema, boolean normalize) throws IOException, RestClientException - Specified by:
registerin interfaceSchemaRegistryClient- Throws:
IOExceptionRestClientException
-
register
public int register(String subject, ParsedSchema schema, int version, int id) throws IOException, RestClientException - Specified by:
registerin interfaceSchemaRegistryClient- Throws:
IOExceptionRestClientException
-
registerWithResponse
public RegisterSchemaResponse registerWithResponse(String subject, ParsedSchema schema, boolean normalize, boolean propagateSchemaTags) throws IOException, RestClientException - Specified by:
registerWithResponsein interfaceSchemaRegistryClient- Throws:
IOExceptionRestClientException
-
getSchemaById
- Specified by:
getSchemaByIdin interfaceSchemaRegistryClient- Throws:
IOExceptionRestClientException
-
getSchemaBySubjectAndId
public ParsedSchema getSchemaBySubjectAndId(String subject, int id) throws IOException, RestClientException - Specified by:
getSchemaBySubjectAndIdin interfaceSchemaRegistryClient- Throws:
IOExceptionRestClientException
-
getSchemaByGuid
public ParsedSchema getSchemaByGuid(String guid, String format) throws IOException, RestClientException - Specified by:
getSchemaByGuidin interfaceSchemaRegistryClient- Throws:
IOExceptionRestClientException
-
getSchemas
public List<ParsedSchema> getSchemas(String subjectPrefix, boolean lookupDeletedSchema, boolean latestOnly) throws IOException, RestClientException - Specified by:
getSchemasin interfaceSchemaRegistryClient- Throws:
IOExceptionRestClientException
-
getAllSubjectsById
- Specified by:
getAllSubjectsByIdin interfaceSchemaRegistryClient- Throws:
IOExceptionRestClientException
-
getAllVersionsById
public Collection<SubjectVersion> getAllVersionsById(int id) throws IOException, RestClientException - Specified by:
getAllVersionsByIdin interfaceSchemaRegistryClient- Throws:
IOExceptionRestClientException
-
getByVersion
- Specified by:
getByVersionin interfaceSchemaRegistryClient- Specified by:
getByVersionin interfaceSchemaVersionFetcher
-
getSchemaMetadata
public SchemaMetadata getSchemaMetadata(String subject, int version) throws IOException, RestClientException - Specified by:
getSchemaMetadatain interfaceSchemaRegistryClient- Throws:
IOExceptionRestClientException
-
getSchemaMetadata
public SchemaMetadata getSchemaMetadata(String subject, int version, boolean lookupDeletedSchema) throws IOException, RestClientException - Specified by:
getSchemaMetadatain interfaceSchemaRegistryClient- Throws:
IOExceptionRestClientException
-
getLatestSchemaMetadata
public SchemaMetadata getLatestSchemaMetadata(String subject) throws IOException, RestClientException - Specified by:
getLatestSchemaMetadatain interfaceSchemaRegistryClient- Throws:
IOExceptionRestClientException
-
getLatestWithMetadata
public SchemaMetadata getLatestWithMetadata(String subject, Map<String, String> metadata, boolean lookupDeletedSchema) throws IOException, RestClientException- Specified by:
getLatestWithMetadatain interfaceSchemaRegistryClient- Throws:
IOExceptionRestClientException
-
getVersion
- Specified by:
getVersionin interfaceSchemaRegistryClient- Throws:
IOExceptionRestClientException
-
getVersion
public int getVersion(String subject, ParsedSchema schema, boolean normalize) throws IOException, RestClientException - Specified by:
getVersionin interfaceSchemaRegistryClient- Throws:
IOExceptionRestClientException
-
getAllVersions
- Specified by:
getAllVersionsin interfaceSchemaRegistryClient- Throws:
IOExceptionRestClientException
-
getAllVersions
public List<Integer> getAllVersions(String subject, boolean lookupDeletedSchema) throws IOException, RestClientException - Specified by:
getAllVersionsin interfaceSchemaRegistryClient- Throws:
IOExceptionRestClientException
-
getId
- Specified by:
getIdin interfaceSchemaRegistryClient- Throws:
IOExceptionRestClientException
-
getId
public int getId(String subject, ParsedSchema schema, boolean normalize) throws IOException, RestClientException - Specified by:
getIdin interfaceSchemaRegistryClient- Throws:
IOExceptionRestClientException
-
getGuid
- Specified by:
getGuidin interfaceSchemaRegistryClient- Throws:
IOExceptionRestClientException
-
getGuid
public String getGuid(String subject, ParsedSchema schema, boolean normalize) throws IOException, RestClientException - Specified by:
getGuidin interfaceSchemaRegistryClient- Throws:
IOExceptionRestClientException
-
getIdWithResponse
public RegisterSchemaResponse getIdWithResponse(String subject, ParsedSchema schema, boolean normalize) throws IOException, RestClientException - Specified by:
getIdWithResponsein interfaceSchemaRegistryClient- Throws:
IOExceptionRestClientException
-
deleteSubject
public List<Integer> deleteSubject(String subject, boolean isPermanent) throws IOException, RestClientException - Specified by:
deleteSubjectin interfaceSchemaRegistryClient- Throws:
IOExceptionRestClientException
-
deleteSubject
public List<Integer> deleteSubject(Map<String, String> requestProperties, String subject, boolean isPermanent) throws IOException, RestClientException- Specified by:
deleteSubjectin interfaceSchemaRegistryClient- Throws:
IOExceptionRestClientException
-
deleteSchemaVersion
public Integer deleteSchemaVersion(String subject, String version, boolean isPermanent) throws IOException, RestClientException - Specified by:
deleteSchemaVersionin interfaceSchemaRegistryClient- Throws:
IOExceptionRestClientException
-
deleteSchemaVersion
public Integer deleteSchemaVersion(Map<String, String> requestProperties, String subject, String version, boolean isPermanent) throws IOException, RestClientException- Specified by:
deleteSchemaVersionin interfaceSchemaRegistryClient- Throws:
IOExceptionRestClientException
-
testCompatibility
public boolean testCompatibility(String subject, ParsedSchema schema) throws IOException, RestClientException - Specified by:
testCompatibilityin interfaceSchemaRegistryClient- Throws:
IOExceptionRestClientException
-
testCompatibilityVerbose
public List<String> testCompatibilityVerbose(String subject, ParsedSchema schema) throws IOException, RestClientException - Specified by:
testCompatibilityVerbosein interfaceSchemaRegistryClient- Throws:
IOExceptionRestClientException
-
testCompatibilityVerbose
public List<String> testCompatibilityVerbose(String subject, ParsedSchema schema, boolean normalize) throws IOException, RestClientException - Specified by:
testCompatibilityVerbosein interfaceSchemaRegistryClient- Throws:
IOExceptionRestClientException
-
updateConfig
- Specified by:
updateConfigin interfaceSchemaRegistryClient- Throws:
IOExceptionRestClientException
-
getConfig
- Specified by:
getConfigin interfaceSchemaRegistryClient- Throws:
IOExceptionRestClientException
-
deleteConfig
- Specified by:
deleteConfigin interfaceSchemaRegistryClient- Throws:
IOExceptionRestClientException
-
setMode
- Specified by:
setModein interfaceSchemaRegistryClient- Throws:
IOExceptionRestClientException
-
setMode
- Specified by:
setModein interfaceSchemaRegistryClient- Throws:
IOExceptionRestClientException
-
setMode
public String setMode(String mode, String subject, boolean force) throws IOException, RestClientException - Specified by:
setModein interfaceSchemaRegistryClient- Throws:
IOExceptionRestClientException
-
getMode
- Specified by:
getModein interfaceSchemaRegistryClient- Throws:
IOExceptionRestClientException
-
getMode
- Specified by:
getModein interfaceSchemaRegistryClient- Throws:
IOExceptionRestClientException
-
deleteMode
- Specified by:
deleteModein interfaceSchemaRegistryClient- Throws:
IOExceptionRestClientException
-
getAllContexts
- Specified by:
getAllContextsin interfaceSchemaRegistryClient- Throws:
IOExceptionRestClientException
-
getSchemaRegistryDeployment
public SchemaRegistryDeployment getSchemaRegistryDeployment() throws IOException, RestClientException- Specified by:
getSchemaRegistryDeploymentin interfaceSchemaRegistryClient- Throws:
IOExceptionRestClientException
-
getSchemaRegistryServerVersion
public SchemaRegistryServerVersion getSchemaRegistryServerVersion() throws IOException, RestClientException- Specified by:
getSchemaRegistryServerVersionin interfaceSchemaRegistryClient- Throws:
IOExceptionRestClientException
-
getAllSubjects
- Specified by:
getAllSubjectsin interfaceSchemaRegistryClient- Throws:
IOExceptionRestClientException
-
getAllSubjects
public Collection<String> getAllSubjects(boolean lookupDeletedSubject) throws IOException, RestClientException - Specified by:
getAllSubjectsin interfaceSchemaRegistryClient- Throws:
IOExceptionRestClientException
-
getAllSubjectsByPrefix
public Collection<String> getAllSubjectsByPrefix(String subjectPrefix) throws IOException, RestClientException - Specified by:
getAllSubjectsByPrefixin interfaceSchemaRegistryClient- Throws:
IOExceptionRestClientException
-
reset
public void reset()- Specified by:
resetin interfaceSchemaRegistryClient
-
close
- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Specified by:
closein interfaceSchemaRegistryClient- Throws:
IOException
-