-
Notifications
You must be signed in to change notification settings - Fork 278
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: make replication worker buffer size configurable (#13749)
- Loading branch information
Showing
7 changed files
with
53 additions
and
33 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
26 changes: 26 additions & 0 deletions
26
airbyte-commons-worker/src/main/kotlin/io/airbyte/workers/general/BufferConfiguration.kt
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,26 @@ | ||
package io.airbyte.workers.general | ||
|
||
import io.airbyte.commons.concurrency.ClosableLinkedBlockingQueue | ||
|
||
data class BufferConfiguration( | ||
val sourceMaxBufferSize: Int = DEFAULT_SOURCE_MAX_BUFFER_SIZE, | ||
val destinationMaxBufferSize: Int = DEFAULT_DESTINATION_MAX_BUFFER_SIZE, | ||
val pollTimeoutDuration: Int = DEFAULT_POLL_TIME_OUT_DURATION_SECONDS, | ||
) { | ||
companion object { | ||
const val DEFAULT_SOURCE_MAX_BUFFER_SIZE = 1000 | ||
const val DEFAULT_DESTINATION_MAX_BUFFER_SIZE = 1000 | ||
const val DEFAULT_POLL_TIME_OUT_DURATION_SECONDS = ClosableLinkedBlockingQueue.DEFAULT_POLL_TIME_OUT_DURATION_SECONDS | ||
|
||
// Helpers for Java due to the lack of named parameters | ||
|
||
@JvmStatic | ||
fun withBufferSize(bufferSize: Int) = BufferConfiguration(sourceMaxBufferSize = bufferSize, destinationMaxBufferSize = bufferSize) | ||
|
||
@JvmStatic | ||
fun withPollTimeout(pollTimeoutDuration: Int): BufferConfiguration = BufferConfiguration(pollTimeoutDuration = pollTimeoutDuration) | ||
|
||
@JvmStatic | ||
fun withDefaultConfiguration() = BufferConfiguration() | ||
} | ||
} |
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