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

feat(store): introduce the high level StreamStore for store module #35

Merged
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
5 changes: 5 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,11 @@

<dependencyManagement>
<dependencies>
<dependency>
<groupId>com.automq.rocketmq</groupId>
<artifactId>rocketmq-s3stream</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>io.grpc</groupId>
<artifactId>grpc-bom</artifactId>
Expand Down
4 changes: 4 additions & 0 deletions store/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,10 @@
<artifactId>flatbuffers-java</artifactId>
<version>23.5.26</version>
</dependency>
<dependency>
<groupId>com.automq.rocketmq</groupId>
<artifactId>rocketmq-s3stream</artifactId>
</dependency>
</dependencies>

<build>
Expand Down
27 changes: 24 additions & 3 deletions store/src/main/java/com/automq/rocketmq/store/StreamStore.java
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,30 @@

package com.automq.rocketmq.store;

import com.automq.rocketmq.store.model.stream.FetchResult;
import java.util.UUID;
import com.automq.rocketmq.stream.api.AppendResult;
import com.automq.rocketmq.stream.api.FetchResult;
import com.automq.rocketmq.stream.api.RecordBatch;
import java.util.concurrent.CompletableFuture;

/**
* A high level abstraction of stream store, hidden the details of S3Stream module.
*/
public interface StreamStore {
FetchResult fetch(UUID topicId, int queueId, long offset, int maxCount);
/**
* Fetch records from stream store.
*
* @param streamId the target stream id.
* @param startOffset the start offset of the fetch.
* @param maxCount the max return count of the fetch.
* @return the future of fetch result.
*/
CompletableFuture<FetchResult> fetch(long streamId, long startOffset, int maxCount);
ShadowySpirits marked this conversation as resolved.
Show resolved Hide resolved

/**
* Append record batch to stream store.
* @param streamId the target stream id.
* @param recordBatch the record batch to append.
* @return the future of append result.
*/
CompletableFuture<AppendResult> append(long streamId, RecordBatch recordBatch);
ShadowySpirits marked this conversation as resolved.
Show resolved Hide resolved
}

This file was deleted.