Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Revision 2 of the ksql storage impl #1054

Merged
merged 6 commits into from
Dec 7, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -375,11 +375,8 @@ public Response getLatestArtifact(String artifactId) {
return builder.build();
}

private CompletionStage<ArtifactMetaData> updateArtifactInternal(
String artifactId,
ArtifactType xRegistryArtifactType,
ContentHandle content,
String ct) {
private CompletionStage<ArtifactMetaData> updateArtifactInternal(String artifactId,
ArtifactType xRegistryArtifactType, ContentHandle content, String ct) {
Objects.requireNonNull(artifactId);
if (ContentTypeUtil.isApplicationYaml(ct)) {
content = ContentTypeUtil.yamlToJson(content);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,17 +68,24 @@ default boolean isAlive() {
*
* @param artifactId
* @param state
* @throws ArtifactNotFoundException
* @throws RegistryStorageException
*/
void updateArtifactState(String artifactId, ArtifactState state);
public void updateArtifactState(String artifactId, ArtifactState state)
throws ArtifactNotFoundException, RegistryStorageException;

/**
* Update artifact state.
*
* @param artifactId
* @param state
* @param version
* @throws ArtifactNotFoundException
* @throws VersionNotFoundException
* @throws RegistryStorageException
*/
void updateArtifactState(String artifactId, ArtifactState state, Integer version);
public void updateArtifactState(String artifactId, ArtifactState state, Integer version)
throws ArtifactNotFoundException, VersionNotFoundException, RegistryStorageException;

/**
* Creates a new artifact (from the given value) in the storage. The artifactId must be globally unique
Expand All @@ -105,7 +112,7 @@ public CompletionStage<ArtifactMetaDataDto> createArtifact(String artifactId, Ar
* @throws RegistryStorageException
*/
public CompletionStage<ArtifactMetaDataDto> createArtifactWithMetadata(String artifactId, ArtifactType artifactType, ContentHandle content, EditableArtifactMetaDataDto metaData)
throws ArtifactAlreadyExistsException, RegistryStorageException;
throws ArtifactAlreadyExistsException, RegistryStorageException;

/**
* Deletes an artifact by its unique id. Returns list of artifact versions.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -700,7 +700,7 @@ public void testDeleteArtifactRule() throws Exception {
}

@Test
public void testDeleteAllArtifactRulse() throws Exception {
public void testDeleteAllArtifactRules() throws Exception {
String artifactId = "testDeleteAllArtifactRulse-1";
ContentHandle content = ContentHandle.create(OPENAPI_CONTENT);
ArtifactMetaDataDto dto = storage().createArtifact(artifactId, ArtifactType.OPENAPI, content).toCompletableFuture().get();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@

public abstract class AlreadyExistsException extends ConflictException {

private static final long serialVersionUID = 1L;

public AlreadyExistsException(Error error) {
super(error);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@
*/
public class ArtifactAlreadyExistsException extends ConflictException {

private static final long serialVersionUID = 1L;

public ArtifactAlreadyExistsException(Error error) {
super(error);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@
*/
public class ArtifactNotFoundException extends NotFoundException {

private static final long serialVersionUID = 1L;

public ArtifactNotFoundException(Error error) {
super(error);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@

public class BadRequestException extends RestClientException {

private static final long serialVersionUID = 1L;

public BadRequestException(Error error) {
super(error);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@

public abstract class ConflictException extends RestClientException {

private static final long serialVersionUID = 1L;

public ConflictException(Error error) {
super(error);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@
*/
public class DefaultRuleDeletionException extends RestClientException {

private static final long serialVersionUID = 1L;

public DefaultRuleDeletionException(Error error) {
super(error);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@

public class InvalidArtifactStateException extends RestClientException {

private static final long serialVersionUID = 1L;

public InvalidArtifactStateException(Error error) {
super(error);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@

public class InvalidArtifactTypeException extends RestClientException {

private static final long serialVersionUID = 1L;

public InvalidArtifactTypeException(Error error) {
super(error);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@

public abstract class NotFoundException extends RestClientException {

private static final long serialVersionUID = 1L;

public NotFoundException(Error error) {
super(error);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@
*/
public class RestClientException extends RuntimeException {

private static final long serialVersionUID = 1L;

private final Error error;

public RestClientException(Error error) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@
*/
public class RuleAlreadyExistsException extends AlreadyExistsException {

private static final long serialVersionUID = 1L;

public RuleAlreadyExistsException(Error error) {
super(error);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@
*/
public class RuleNotFoundException extends NotFoundException {

private static final long serialVersionUID = 1L;

public RuleNotFoundException(Error error) {
super(error);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@

public class RuleViolationException extends RestClientException {

private static final long serialVersionUID = 1L;

public RuleViolationException(Error error) {
super(error);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@

public class UnprocessableEntityException extends RestClientException {

private static final long serialVersionUID = 1L;

public UnprocessableEntityException(Error error) {
super(error);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@
*/
public class VersionNotFoundException extends NotFoundException {

private static final long serialVersionUID = 1L;

public VersionNotFoundException(Error error) {
super(error);
}
Expand Down
4 changes: 4 additions & 0 deletions storage/ksql/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,10 @@
<groupId>commons-codec</groupId>
<artifactId>commons-codec</artifactId>
</dependency>
<dependency>
<groupId>commons-io</groupId>
<artifactId>commons-io</artifactId>
</dependency>

<!-- Test Only -->
<dependency>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@

import javax.enterprise.context.ApplicationScoped;

import io.apicurio.registry.logging.Logged;
import io.apicurio.registry.types.RegistryException;

/**
Expand All @@ -34,6 +35,7 @@
* @author [email protected]
*/
@ApplicationScoped
@Logged
public class KafkaSqlCoordinator {

private static final Object NULL = new Object();
Expand Down Expand Up @@ -83,7 +85,6 @@ public Object waitForResponse(UUID uuid) {
* @param returnValue
*/
public void notifyResponse(UUID uuid, Object returnValue) {

//we are re-using the topic from a streams based registry instance
if (uuid == null) {
return;
Expand Down
Loading