-
Notifications
You must be signed in to change notification settings - Fork 4.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Bulk Core/Load CDK: Support for connector-type-specific non-config sp…
…ec extensions
- Loading branch information
1 parent
7056428
commit 817cc46
Showing
2 changed files
with
43 additions
and
3 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
28 changes: 28 additions & 0 deletions
28
airbyte-cdk/bulk/core/load/src/main/kotlin/io/airbyte/cdk/spec/DestinationSpecification.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,28 @@ | ||
/* | ||
* Copyright (c) 2024 Airbyte, Inc., all rights reserved. | ||
*/ | ||
|
||
package io.airbyte.cdk.spec | ||
|
||
import io.airbyte.protocol.models.v0.ConnectorSpecification | ||
import io.airbyte.protocol.models.v0.DestinationSyncMode | ||
import io.micronaut.context.annotation.Replaces | ||
import io.micronaut.context.annotation.Requires | ||
import jakarta.inject.Singleton | ||
|
||
@Singleton | ||
@Replaces(IdentitySpecificationExtender::class) | ||
@Requires(env = ["destination"]) | ||
class DestinationSpecificationExtender(private val spec: DestinationSpecification) : | ||
SpecificationExtender { | ||
override fun invoke(specification: ConnectorSpecification): ConnectorSpecification { | ||
return specification | ||
.withSupportedDestinationSyncModes(spec.supportedSyncModes) | ||
.withSupportsIncremental(spec.supportsIncremental) | ||
} | ||
} | ||
|
||
interface DestinationSpecification { | ||
val supportedSyncModes: List<DestinationSyncMode> | ||
val supportsIncremental: Boolean | ||
} |