5
5
package io.airbyte.integrations.destination.dev_null
6
6
7
7
import io.airbyte.cdk.load.command.DestinationStream
8
- import io.airbyte.cdk.load.message.DestinationRecordAirbyteValue
8
+ import io.airbyte.cdk.load.message.DestinationRecordRaw
9
9
import io.airbyte.cdk.load.write.DirectLoader
10
10
import io.airbyte.cdk.load.write.DirectLoaderFactory
11
11
import io.github.oshai.kotlinlogging.KotlinLogging
@@ -18,9 +18,9 @@ abstract class DevNullDirectLoader(
18
18
) : DirectLoader {
19
19
private var recordCount: Long = 0L
20
20
21
- abstract fun acceptInner (record : DestinationRecordAirbyteValue )
21
+ abstract fun acceptInner (record : DestinationRecordRaw )
22
22
23
- override fun accept (record : DestinationRecordAirbyteValue ): DirectLoader .DirectLoadResult {
23
+ override fun accept (record : DestinationRecordRaw ): DirectLoader .DirectLoadResult {
24
24
acceptInner(record)
25
25
return if (++ recordCount % config.ackRatePerRecord == 0L ) {
26
26
DirectLoader .Complete
@@ -87,7 +87,7 @@ class LoggingDirectLoader(
87
87
private var logCount: Long = 0L
88
88
private val prng: Random = loggingConfig.seed?.let { Random (it) } ? : Random .Default
89
89
90
- override fun acceptInner (record : DestinationRecordAirbyteValue ) {
90
+ override fun acceptInner (record : DestinationRecordRaw ) {
91
91
if (recordCount++ % loggingConfig.logEvery == 0L ) {
92
92
if (loggingConfig.sampleRate == 1.0 || prng.nextDouble() < loggingConfig.sampleRate) {
93
93
if (++ logCount < loggingConfig.maxEntryCount) {
@@ -101,15 +101,15 @@ class LoggingDirectLoader(
101
101
}
102
102
103
103
class SilentDirectLoader (config : DevNullConfiguration ) : DevNullDirectLoader(config) {
104
- override fun acceptInner (record : DestinationRecordAirbyteValue ) {
104
+ override fun acceptInner (record : DestinationRecordRaw ) {
105
105
/* Do nothing */
106
106
}
107
107
}
108
108
109
109
class ThrottledDirectLoader (config : DevNullConfiguration , private val millisPerRecord : Long ) :
110
110
DevNullDirectLoader (config) {
111
111
112
- override fun acceptInner (record : DestinationRecordAirbyteValue ) {
112
+ override fun acceptInner (record : DestinationRecordRaw ) {
113
113
Thread .sleep(millisPerRecord)
114
114
}
115
115
}
@@ -123,7 +123,7 @@ class FailingDirectLoader(
123
123
124
124
private var messageCount: Long = 0L
125
125
126
- override fun acceptInner (record : DestinationRecordAirbyteValue ) {
126
+ override fun acceptInner (record : DestinationRecordRaw ) {
127
127
if (messageCount++ > numMessages) {
128
128
val message =
129
129
" Failing Destination(stream=$stream , numMessages=$numMessages : failing at $record )"
0 commit comments