-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #188 from ydb-platform/release_v2.1.8
Release v2.1.8
- Loading branch information
Showing
40 changed files
with
669 additions
and
160 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
version=2.1.7 | ||
version=2.1.8 |
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
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
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
44 changes: 44 additions & 0 deletions
44
topic/src/main/java/tech/ydb/topic/read/DeferredCommitter.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,44 @@ | ||
package tech.ydb.topic.read; | ||
|
||
import tech.ydb.topic.read.events.DataReceivedEvent; | ||
import tech.ydb.topic.read.impl.DeferredCommitterImpl; | ||
|
||
/** | ||
* A helper class that is used to call deferred commits. | ||
* Several {@link Message}s or/and {@link tech.ydb.topic.read.events.DataReceivedEvent}s can be accepted to commit later | ||
* all at once. | ||
* Contains no data references and therefore may also be useful in cases where commit() is called after processing data | ||
* in an external system. | ||
* | ||
* @author Nikolay Perfilov | ||
*/ | ||
public interface DeferredCommitter { | ||
/** | ||
* Creates a new instance of {@link DeferredCommitter} | ||
* | ||
* @return a new instance of {@link DeferredCommitter} | ||
*/ | ||
static DeferredCommitter newInstance() { | ||
return new DeferredCommitterImpl(); | ||
} | ||
|
||
/** | ||
* Adds a {@link Message} to commit it later with a commit method | ||
* | ||
* @param message a {@link Message} to commit later | ||
*/ | ||
void add(Message message); | ||
|
||
/** | ||
* Adds a {@link DataReceivedEvent} to commit all its messages later with a commit method | ||
* | ||
* @param event a {@link DataReceivedEvent} to commit later | ||
*/ | ||
void add(DataReceivedEvent event); | ||
|
||
/** | ||
* Commits offset ranges from all {@link Message}s and {@link DataReceivedEvent}s | ||
* that were added to this DeferredCommitter since last commit | ||
*/ | ||
void commit(); | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
package tech.ydb.topic.read; | ||
|
||
/** | ||
* @author Nikolay Perfilov | ||
*/ | ||
public interface OffsetsRange { | ||
long getStart(); | ||
|
||
long getEnd(); | ||
} |
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
6 changes: 5 additions & 1 deletion
6
topic/src/main/java/tech/ydb/topic/read/events/CommitOffsetAcknowledgementEvent.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 |
---|---|---|
@@ -1,7 +1,11 @@ | ||
package tech.ydb.topic.read.events; | ||
|
||
import tech.ydb.topic.read.PartitionSession; | ||
|
||
/** | ||
* @author Nikolay Perfilov | ||
*/ | ||
public class CommitOffsetAcknowledgementEvent { | ||
public interface CommitOffsetAcknowledgementEvent { | ||
PartitionSession getPartitionSession(); | ||
long getCommittedOffset(); | ||
} |
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
2 changes: 1 addition & 1 deletion
2
topic/src/main/java/tech/ydb/topic/read/events/StartPartitionSessionEvent.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
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
39 changes: 39 additions & 0 deletions
39
topic/src/main/java/tech/ydb/topic/read/impl/CommitterImpl.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,39 @@ | ||
package tech.ydb.topic.read.impl; | ||
|
||
import java.util.concurrent.CompletableFuture; | ||
|
||
import org.slf4j.Logger; | ||
import org.slf4j.LoggerFactory; | ||
|
||
import tech.ydb.topic.read.OffsetsRange; | ||
|
||
/** | ||
* @author Nikolay Perfilov | ||
*/ | ||
public class CommitterImpl { | ||
private static final Logger logger = LoggerFactory.getLogger(CommitterImpl.class); | ||
private final PartitionSessionImpl partitionSession; | ||
private final int messageCount; | ||
private final OffsetsRange offsetsToCommit; | ||
|
||
public CommitterImpl(PartitionSessionImpl partitionSession, int messageCount, OffsetsRange offsetsToCommit) { | ||
this.partitionSession = partitionSession; | ||
this.messageCount = messageCount; | ||
this.offsetsToCommit = offsetsToCommit; | ||
} | ||
|
||
|
||
public CompletableFuture<Void> commit() { | ||
return commitImpl(true); | ||
} | ||
|
||
public CompletableFuture<Void> commitImpl(boolean fromCommitter) { | ||
if (logger.isDebugEnabled()) { | ||
logger.debug("[{}] partition session {} (partition {}): committing {} message(s), offsets" + | ||
" [{},{})" + (fromCommitter ? " from Committer" : ""), partitionSession.getPath(), | ||
partitionSession.getId(), partitionSession.getPartitionId(), messageCount, | ||
offsetsToCommit.getStart(), offsetsToCommit.getEnd()); | ||
} | ||
return partitionSession.commitOffsetRange(offsetsToCommit); | ||
} | ||
} |
Oops, something went wrong.