All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.xyro.kumulus.collector.KumulusBoltCollector.kt Maven / Gradle / Ivy

There is a newer version: 0.1.41
Show newest version
package org.xyro.kumulus.collector

import mu.KotlinLogging
import org.apache.storm.task.IOutputCollector
import org.apache.storm.tuple.Tuple
import org.xyro.kumulus.KumulusAcker
import org.xyro.kumulus.KumulusEmitter
import org.xyro.kumulus.component.KumulusBolt
import org.xyro.kumulus.component.KumulusComponent

class KumulusBoltCollector(
        component: KumulusComponent,
        private val emitter: KumulusEmitter,
        acker: KumulusAcker,
        errorHandler: ((String, Int, Throwable) -> Unit)?
) : KumulusCollector(
        component,
        emitter,
        acker,
        errorHandler
), IOutputCollector {
    companion object {
        val logger = KotlinLogging.logger { }
    }

    override fun emitDirect(taskId: Int, streamId: String?, anchors: MutableCollection?, tuple: MutableList?) {
        TODO("not implemented")
    }

    override fun resetTimeout(input: Tuple?) {
        TODO("not implemented")
    }

    override fun fail(input: Tuple?) {
        try {
            acker.fail(component, input)
        } catch (t: Throwable) {
            emitter.throwException(t)
        }
    }

    override fun ack(input: Tuple?) {
        try {
            acker.ack(component, input)
        } catch (t: Throwable) {
            emitter.throwException(t)
        }
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy