-
Notifications
You must be signed in to change notification settings - Fork 1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add a new default SchemaRegistryClient and remove default for S…
…R url (#4325)
- Loading branch information
1 parent
89b7fcf
commit e045f7c
Showing
11 changed files
with
243 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
169 changes: 169 additions & 0 deletions
169
ksql-engine/src/main/java/io/confluent/ksql/schema/registry/DefaultSchemaRegistryClient.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,169 @@ | ||
/* | ||
* Copyright 2020 Confluent Inc. | ||
* | ||
* Licensed under the Confluent Community License (the "License"); you may not use | ||
* this file except in compliance with the License. You may obtain a copy of the | ||
* License at | ||
* | ||
* http://www.confluent.io/confluent-community-license | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT | ||
* WARRANTIES OF ANY KIND, either express or implied. See the License for the | ||
* specific language governing permissions and limitations under the License. | ||
*/ | ||
|
||
package io.confluent.ksql.schema.registry; | ||
|
||
import io.confluent.kafka.schemaregistry.ParsedSchema; | ||
import io.confluent.kafka.schemaregistry.client.SchemaMetadata; | ||
import io.confluent.kafka.schemaregistry.client.SchemaRegistryClient; | ||
import io.confluent.kafka.schemaregistry.client.rest.entities.SchemaReference; | ||
|
||
import io.confluent.ksql.rest.ErrorMessages; | ||
import java.util.Collection; | ||
import java.util.Collections; | ||
import java.util.List; | ||
import java.util.Map; | ||
import java.util.Optional; | ||
import org.apache.kafka.common.config.ConfigException; | ||
|
||
/** | ||
* Implements the SchemaRegistryClient interface. Used as default when the Schema Registry URL isn't | ||
* specified in {@link io.confluent.ksql.util.KsqlConfig} | ||
*/ | ||
public class DefaultSchemaRegistryClient implements SchemaRegistryClient { | ||
|
||
private final ConfigException configException; | ||
|
||
public DefaultSchemaRegistryClient(final ErrorMessages errorMessages) { | ||
configException = new ConfigException(errorMessages.schemaRegistryUnconfiguredErrorMessage()); | ||
} | ||
|
||
@Override | ||
public Optional<ParsedSchema> parseSchema( | ||
final String var1, final String var2, | ||
final List<SchemaReference> var3 | ||
) { | ||
throw configException; | ||
} | ||
|
||
@Override | ||
public int register(final String s, final ParsedSchema parsedSchema) { | ||
throw configException; | ||
} | ||
|
||
@Override | ||
public int register(final String s, final ParsedSchema parsedSchema, final int i, final int i1) { | ||
throw configException; | ||
} | ||
|
||
@Override | ||
public ParsedSchema getSchemaById(final int i) { | ||
throw configException; | ||
} | ||
|
||
@Override | ||
public ParsedSchema getSchemaBySubjectAndId(final String s, final int i) { | ||
throw configException; | ||
} | ||
|
||
@Override | ||
public Collection<String> getAllSubjectsById(final int i) { | ||
throw configException; | ||
} | ||
|
||
@Override | ||
public SchemaMetadata getLatestSchemaMetadata(final String s) { | ||
throw configException; | ||
} | ||
|
||
@Override | ||
public SchemaMetadata getSchemaMetadata(final String s, final int i) { | ||
throw configException; | ||
} | ||
|
||
@Override | ||
public int getVersion(final String s, final ParsedSchema parsedSchema) { | ||
throw configException; | ||
} | ||
|
||
@Override | ||
public List<Integer> getAllVersions(final String s) { | ||
throw configException; | ||
} | ||
|
||
@Override | ||
public boolean testCompatibility(final String s, final ParsedSchema parsedSchema) { | ||
throw configException; | ||
} | ||
|
||
@Override | ||
public String updateCompatibility(final String s, final String s1) { | ||
throw configException; | ||
} | ||
|
||
@Override | ||
public String getCompatibility(final String s) { | ||
throw configException; | ||
} | ||
|
||
@Override | ||
public String setMode(final String s) { | ||
throw configException; | ||
} | ||
|
||
@Override | ||
public String setMode(final String s, final String s1) { | ||
throw configException; | ||
} | ||
|
||
@Override | ||
public String getMode() { | ||
throw configException; | ||
} | ||
|
||
@Override | ||
public String getMode(final String s) { | ||
throw configException; | ||
} | ||
|
||
@Override | ||
public Collection<String> getAllSubjects() { | ||
return Collections.emptyList(); | ||
} | ||
|
||
@Override | ||
public int getId(final String s, final ParsedSchema parsedSchema) { | ||
throw configException; | ||
} | ||
|
||
@Override | ||
public List<Integer> deleteSubject(final String s) { | ||
throw configException; | ||
} | ||
|
||
@Override | ||
public List<Integer> deleteSubject(final Map<String, String> map, final String s) { | ||
throw configException; | ||
} | ||
|
||
@Override | ||
public Integer deleteSchemaVersion(final String s, final String s1) { | ||
throw configException; | ||
} | ||
|
||
@Override | ||
public Integer deleteSchemaVersion( | ||
final Map<String, String> map, | ||
final String s, | ||
final String s1 | ||
) { | ||
throw configException; | ||
} | ||
|
||
@Override | ||
public void reset() { | ||
throw configException; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.