Search in sources :

Example 6 with AvroJobSpec

use of org.apache.gobblin.runtime.job_spec.AvroJobSpec in project incubator-gobblin by apache.

the class SimpleKafkaSpecProducer method addSpec.

@Override
public Future<?> addSpec(Spec addedSpec) {
    AvroJobSpec avroJobSpec = convertToAvroJobSpec(addedSpec, SpecExecutor.Verb.ADD);
    log.info("Adding Spec: " + addedSpec + " using Kafka.");
    return getKafkaProducer().write(_serializer.serializeRecord(avroJobSpec), WriteCallback.EMPTY);
}
Also used : AvroJobSpec(org.apache.gobblin.runtime.job_spec.AvroJobSpec)

Example 7 with AvroJobSpec

use of org.apache.gobblin.runtime.job_spec.AvroJobSpec in project incubator-gobblin by apache.

the class SimpleKafkaSpecProducer method updateSpec.

@Override
public Future<?> updateSpec(Spec updatedSpec) {
    AvroJobSpec avroJobSpec = convertToAvroJobSpec(updatedSpec, SpecExecutor.Verb.UPDATE);
    log.info("Updating Spec: " + updatedSpec + " using Kafka.");
    return getKafkaProducer().write(_serializer.serializeRecord(avroJobSpec), WriteCallback.EMPTY);
}
Also used : AvroJobSpec(org.apache.gobblin.runtime.job_spec.AvroJobSpec)

Aggregations

AvroJobSpec (org.apache.gobblin.runtime.job_spec.AvroJobSpec)7 JobSpec (org.apache.gobblin.runtime.api.JobSpec)3 URI (java.net.URI)2 Properties (java.util.Properties)2 ByteArrayInputStream (java.io.ByteArrayInputStream)1 DataInputStream (java.io.DataInputStream)1 IOException (java.io.IOException)1 InputStream (java.io.InputStream)1 InvocationTargetException (java.lang.reflect.InvocationTargetException)1 URISyntaxException (java.net.URISyntaxException)1 ArrayList (java.util.ArrayList)1 ImmutablePair (org.apache.commons.lang3.tuple.ImmutablePair)1 Pair (org.apache.commons.lang3.tuple.Pair)1 ByteArrayBasedKafkaRecord (org.apache.gobblin.kafka.client.ByteArrayBasedKafkaRecord)1 DecodeableKafkaRecord (org.apache.gobblin.kafka.client.DecodeableKafkaRecord)1 KafkaConsumerRecord (org.apache.gobblin.kafka.client.KafkaConsumerRecord)1 FixedSchemaVersionWriter (org.apache.gobblin.metrics.reporter.util.FixedSchemaVersionWriter)1 Spec (org.apache.gobblin.runtime.api.Spec)1 SpecExecutor (org.apache.gobblin.runtime.api.SpecExecutor)1 Verb (org.apache.gobblin.runtime.api.SpecExecutor.Verb)1