-
Notifications
You must be signed in to change notification settings - Fork 4.6k
CDK: fixes for destination-postgres #36619
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -133,6 +133,7 @@ class AirbyteExceptionHandler : Thread.UncaughtExceptionHandler { | |
return matcher.replaceAll("$1?$3") | ||
} | ||
|
||
@JvmStatic | ||
fun addThrowableForDeinterpolation(klass: Class<out Throwable>) { | ||
THROWABLES_TO_DEINTERPOLATE.add(klass) | ||
} | ||
|
@@ -154,8 +155,7 @@ class AirbyteExceptionHandler : Thread.UncaughtExceptionHandler { | |
} | ||
} | ||
|
||
@VisibleForTesting | ||
fun addCommonStringsToDeinterpolate() { | ||
internal fun addCommonStringsToDeinterpolate() { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. yes |
||
// Add some common strings to deinterpolate, regardless of what the connector is doing | ||
addStringForDeinterpolation("airbyte") | ||
addStringForDeinterpolation("config") | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
version=0.28.18 | ||
version=0.28.19 |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -43,7 +43,7 @@ import org.testcontainers.containers.JdbcDatabaseContainer | |
*/ | ||
abstract class TestDatabase< | ||
C : JdbcDatabaseContainer<*>, T : TestDatabase<C, T, B>, B : TestDatabase.ConfigBuilder<T, B>> | ||
protected constructor(@JvmField val container: C) : AutoCloseable { | ||
protected constructor(val container: C) : AutoCloseable { | ||
private val suffix: String = Strings.addRandomSuffix("", "_", 10) | ||
private val cleanupSQL: ArrayList<String> = ArrayList() | ||
private val connectionProperties: MutableMap<String, String> = HashMap() | ||
|
@@ -52,16 +52,14 @@ protected constructor(@JvmField val container: C) : AutoCloseable { | |
|
||
@Volatile private lateinit var dslContext: DSLContext | ||
|
||
protected val databaseId: Int | ||
protected val containerId: Int | ||
protected val databaseId: Int = nextDatabaseId.getAndIncrement() | ||
protected val containerId: Int = | ||
containerUidToId!!.computeIfAbsent(container.containerId) { k: String? -> | ||
nextContainerId!!.getAndIncrement() | ||
}!! | ||
private val dateFormat: DateFormat = SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSS") | ||
|
||
init { | ||
this.databaseId = nextDatabaseId!!.getAndIncrement() | ||
this.containerId = | ||
containerUidToId!!.computeIfAbsent(container!!.containerId) { k: String? -> | ||
nextContainerId!!.getAndIncrement() | ||
}!! | ||
LOGGER!!.info(formatLogLine("creating database " + databaseName)) | ||
} | ||
|
||
|
@@ -300,18 +298,21 @@ protected constructor(@JvmField val container: C) : AutoCloseable { | |
} | ||
|
||
fun withSsl(sslMode: MutableMap<Any?, Any?>?): B { | ||
return with(JdbcUtils.SSL_KEY, true)!!.with(JdbcUtils.SSL_MODE_KEY, sslMode) | ||
return with(JdbcUtils.SSL_KEY, true).with(JdbcUtils.SSL_MODE_KEY, sslMode) | ||
} | ||
|
||
companion object { | ||
val DEFAULT_CDC_REPLICATION_INITIAL_WAIT: Duration? = Duration.ofSeconds(5) | ||
private val DEFAULT_CDC_REPLICATION_INITIAL_WAIT: Duration = Duration.ofSeconds(5) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. in java it looks like this There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. what about @JvmField? That should get rid of the getter, no? |
||
fun getDefaultCdcReplicationInitialWait(): Duration { | ||
return DEFAULT_CDC_REPLICATION_INITIAL_WAIT | ||
} | ||
} | ||
} | ||
|
||
companion object { | ||
private val LOGGER: Logger? = LoggerFactory.getLogger(TestDatabase::class.java) | ||
|
||
private val nextDatabaseId: AtomicInteger? = AtomicInteger(0) | ||
private val nextDatabaseId: AtomicInteger = AtomicInteger(0) | ||
|
||
private val nextContainerId: AtomicInteger? = AtomicInteger(0) | ||
private val containerUidToId: MutableMap<String?, Int?>? = ConcurrentHashMap() | ||
|
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.
@jdpgrailsdev This was accessed as a static member in Java, any better way to do than the escape hatch ?
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.
not sure what the escape hatch is