-
Notifications
You must be signed in to change notification settings - Fork 647
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Andriy Redko <andriy.redko@aiven.io>
- Loading branch information
Showing
24 changed files
with
178 additions
and
168 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
42 changes: 0 additions & 42 deletions
42
elasticsearch/src/main/scala/akka/stream/alpakka/common/WriteSettings.scala
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
42 changes: 42 additions & 0 deletions
42
elasticsearch/src/main/scala/akka/stream/alpakka/elasticsearch/WriteSettingsBase.scala
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,42 @@ | ||
/* | ||
* Copyright (C) since 2016 Lightbend Inc. <https://www.lightbend.com> | ||
*/ | ||
|
||
package akka.stream.alpakka.elasticsearch | ||
|
||
import akka.stream.alpakka.elasticsearch.ElasticsearchConnectionSettings | ||
import akka.stream.alpakka.elasticsearch.RetryLogic | ||
|
||
/** | ||
* Configure Elasticsearch/Opensearch sinks and flows. | ||
*/ | ||
abstract class WriteSettingsBase[Version <: ApiVersionBase, W <: WriteSettingsBase[Version, W]] private[alpakka] ( | ||
val connection: ElasticsearchConnectionSettings, | ||
val bufferSize: Int, | ||
val retryLogic: RetryLogic, | ||
val versionType: Option[String], | ||
val apiVersion: Version, | ||
val allowExplicitIndex: Boolean | ||
) { this: W => | ||
|
||
def withConnection(value: ElasticsearchConnectionSettings): W = copy(connection = value) | ||
|
||
def withBufferSize(value: Int): W = copy(bufferSize = value) | ||
|
||
def withRetryLogic(value: RetryLogic): W = | ||
copy(retryLogic = value) | ||
|
||
def withVersionType(value: String): W = copy(versionType = Option(value)) | ||
|
||
def withApiVersion(value: Version): W = | ||
if (apiVersion == value) this else copy(apiVersion = value) | ||
|
||
def withAllowExplicitIndex(value: Boolean): W = copy(allowExplicitIndex = value) | ||
|
||
protected def copy(connection: ElasticsearchConnectionSettings = connection, | ||
bufferSize: Int = bufferSize, | ||
retryLogic: RetryLogic = retryLogic, | ||
versionType: Option[String] = versionType, | ||
apiVersion: Version = apiVersion, | ||
allowExplicitIndex: Boolean = allowExplicitIndex): W; | ||
} |
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
Oops, something went wrong.