Skip to content

Commit

Permalink
rename stream catalog to messaging catalog
Browse files Browse the repository at this point in the history
  • Loading branch information
mchades committed Mar 7, 2024
1 parent 8755898 commit 8be1aea
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 10 deletions.
2 changes: 1 addition & 1 deletion api/src/main/java/com/datastrato/gravitino/Catalog.java
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ enum Type {
FILESET,

/** Catalog Type for Message Queue, like kafka://topic */
STREAM
MESSAGING
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@
import java.util.Map;

/**
* The StreamCatalog interface defines the public API for managing topic objects in a schema. If the
* catalog implementation supports topic objects, it should implement this interface.
* The MessagingCatalog interface defines the public API for managing topic objects in a schema. If
* the catalog implementation supports topic objects, it should implement this interface.
*/
public interface StreamCatalog {
public interface MessagingCatalog {

/**
* List the topics in a schema namespace from the catalog.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
* Message Queue system like Kafka, Pulsar, etc.
*
* <p>{@link Topic} defines the basic properties of a topic object. A catalog implementation with
* {@link StreamCatalog} should implement this interface.
* {@link MessagingCatalog} should implement this interface.
*/
public interface Topic extends Auditable {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ static Catalog toCatalog(CatalogDTO catalog, RESTClient client) {
.withRestClient(client)
.build();

case STREAM:
case MESSAGING:
default:
throw new UnsupportedOperationException("Unsupported catalog type: " + catalog.type());
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ public void testLoadCatalog() throws JsonProcessingException {
new CatalogDTO.Builder()
.withName("mock")
.withComment("comment")
.withType(Catalog.Type.STREAM)
.withType(Catalog.Type.MESSAGING)
.withProvider("test")
.withAudit(
new AuditDTO.Builder().withCreator("creator").withCreateTime(Instant.now()).build())
Expand Down Expand Up @@ -182,22 +182,22 @@ public void testCreateCatalog() throws JsonProcessingException {
new CatalogDTO.Builder()
.withName("mock")
.withComment("comment")
.withType(Catalog.Type.STREAM)
.withType(Catalog.Type.MESSAGING)
.withProvider("test")
.withAudit(
new AuditDTO.Builder().withCreator("creator").withCreateTime(Instant.now()).build())
.build();
CatalogCreateRequest req1 =
new CatalogCreateRequest(
catalogName, Catalog.Type.STREAM, provider, "comment", Collections.emptyMap());
catalogName, Catalog.Type.MESSAGING, provider, "comment", Collections.emptyMap());
CatalogResponse resp1 = new CatalogResponse(mockCatalog1);
buildMockResource(Method.POST, path, req1, resp1, HttpStatus.SC_OK);
NameIdentifier id = NameIdentifier.of(metalakeName, catalogName);
Map<String, String> emptyMap = Collections.emptyMap();

Assertions.assertThrows(
UnsupportedOperationException.class,
() -> metalake.createCatalog(id, Catalog.Type.STREAM, provider, "comment", emptyMap));
() -> metalake.createCatalog(id, Catalog.Type.MESSAGING, provider, "comment", emptyMap));

// Test return NoSuchMetalakeException
ErrorResponse errorResponse =
Expand Down

0 comments on commit 8be1aea

Please sign in to comment.