-
Notifications
You must be signed in to change notification settings - Fork 214
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
Disable the circuit breaker for buffers that write data off-heap only… #3619
Merged
dlvenable
merged 2 commits into
opensearch-project:main
from
dlvenable:3616-kafka-writes-disable-circuit-breaker
Nov 10, 2023
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
49 changes: 49 additions & 0 deletions
49
data-prepper-core/src/main/java/org/opensearch/dataprepper/parser/MultiBufferDecorator.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,49 @@ | ||
/* | ||
* Copyright OpenSearch Contributors | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
|
||
package org.opensearch.dataprepper.parser; | ||
|
||
import org.opensearch.dataprepper.model.buffer.Buffer; | ||
import org.opensearch.dataprepper.model.buffer.DelegatingBuffer; | ||
import org.opensearch.dataprepper.model.record.Record; | ||
|
||
import java.time.Duration; | ||
import java.util.ArrayList; | ||
import java.util.List; | ||
|
||
/** | ||
* Buffer decorator created for pipelines that make use of multiple buffers, such as PeerForwarder-enabled pipelines. The decorator | ||
* acts as a pass-through to the primary buffer for most methods except those that rely on a combination of the primary | ||
* and second. For example, isEmpty depends on all buffers being empty. | ||
* | ||
* @since 2.0 | ||
*/ | ||
class MultiBufferDecorator<T extends Record<?>> extends DelegatingBuffer<T> implements Buffer<T> { | ||
private final List<Buffer> allBuffers; | ||
|
||
MultiBufferDecorator(final Buffer primaryBuffer, final List<Buffer> secondaryBuffers) { | ||
super(primaryBuffer); | ||
allBuffers = new ArrayList<>(1 + secondaryBuffers.size()); | ||
allBuffers.add(primaryBuffer); | ||
allBuffers.addAll(secondaryBuffers); | ||
} | ||
|
||
@Override | ||
public boolean isEmpty() { | ||
return allBuffers.stream().allMatch(Buffer::isEmpty); | ||
} | ||
|
||
@Override | ||
public Duration getDrainTimeout() { | ||
return allBuffers.stream() | ||
.map(Buffer::getDrainTimeout) | ||
.reduce(Duration.ZERO, Duration::plus); | ||
} | ||
|
||
@Override | ||
public void shutdown() { | ||
allBuffers.forEach(Buffer::shutdown); | ||
} | ||
} |
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
83 changes: 0 additions & 83 deletions
83
data-prepper-core/src/main/java/org/opensearch/dataprepper/plugins/MultiBufferDecorator.java
This file was deleted.
Oops, something went wrong.
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.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: should be false..