You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@beam.apache.org by Jean-Baptiste Onofré <jb...@nanthrax.net> on 2016/04/28 14:30:00 UTC
[DISCUSS] Beam IO &runners native IO
Hi all,
regarding the recent threads on the mailing list, I would like to start
a format discussion around the IO.
As we can expect the first contributions on this area (I already have
some work in progress around this ;)), I think it's a fair discussion to
have.
Now, we have two kinds of IO: the one "generic" to Beam, the one "local"
to the runners.
For example, let's take Kafka: we have the KafkaIO (in IO), and for
instance, we have the spark-streaming kafka connector (in Spark Runner).
Right now, we have two approaches for the user:
1. In the pipeline, we use KafkaIO from Beam: it's the preferred
approach for sure. However, the user may want to use the runner specific
IO for two reasons:
* Beam doesn't provide the IO yet (for instance, spark cassandra
connector is available whereas we don't have yet any CassandraIO (I'm
working on it anyway ;))
* The runner native IO is optimized or contain more features that the
Beam native IO
2. So, for the previous reasons, the user could want to use the native
runner IO. The drawback of this approach is that the pipeline will be
tight to a specific runner, which is completely against the Beam design.
I wonder if it wouldn't make sense to add flag on the IO API (and
related on Runner API) like .useNative().
For instance, the user would be able to do:
pipeline.apply(KafkaIO.read().withBootstrapServers("...").withTopics("...").useNative(true);
then, if the runner has a "native" IO, it will use it, else, if
useNative(false) (the default), it won't use any runner native IO.
The point there is for the configuration: assuming the Beam IO and the
runner IO can differ, it means that the "Beam IO" would have to populate
all runner specific IO configuration.
Of course, it's always possible to use a PTransform to wrap the runner
native IO, but we are back on the same concern: the pipeline will be
couple to a specific runner.
The purpose of the useNative() flag is to "automatically" inform the
runner to use a specific IO if it has one: the pipeline stays decoupled
from the runners.
Thoughts ?
Thanks
Regards
JB
--
Jean-Baptiste Onofré
jbonofre@apache.org
http://blog.nanthrax.net
Talend - http://www.talend.com
Re: [DISCUSS] Beam IO &runners native IO
Posted by Dan Halperin <dh...@google.com.INVALID>.
Certainly, there are a number of patterns for which careful co-design using
the pipeline structure in conjunction with the output system gives best
semantics. It may be worth looking at the (batch) Write transform to see
how the sink is split into
1) single initialize
2) parallel write
3) single finalize
and at FileBasedSink to see how it uses temp files and idempotent rename to
get correctness. The above are all done within the existing model's
semantics, using Create and side inputs and the
startBundle/processElement/finishBundle design patterns.
Admittedly, this is harder for some external systems, and the correctness
guarantees can depend on the APIs they provide. E.g., whether they support
atomic bulk operations such as a database bulk load or a filesystem rename.
I need to spend some time reviewing the Flink RollingSink, but it may be
that we can get close within the model already, or that the right
application of the forthcoming state APIs will help with the internal
checkpointing that Aljoscha is probably referencing.
Dan
On Tue, May 3, 2016 at 10:15 AM, Raghu Angadi <ra...@google.com.invalid>
wrote:
> agreed. finishBundle() helps but can not guarantee consistent state.
>
> On Tue, May 3, 2016 at 1:49 AM, Maximilian Michels <mx...@apache.org> wrote:
>
> > Correct, Kafka doesn't support rollbacks of the producer. In Flink
> > there is the RollingSink which supports transactional rolling files.
> > Admittedly, that is the only one. Still, checkpointing sinks in Beam
> > could be useful for users who are concerned about exactly once
> > semantics. I'm not sure whether we can implement something similar
> > with the bundle mechanism.
> >
> > On Mon, May 2, 2016 at 11:50 PM, Raghu Angadi
> > <ra...@google.com.invalid> wrote:
> > > What are good examples of streaming sinks that support checkpointing
> (or
> > > transactions/rollbacks)? I don't Kafka supports a rollback.
> > >
> > > On Mon, May 2, 2016 at 2:54 AM, Maximilian Michels <mx...@apache.org>
> > wrote:
> > >
> > >> Yes, I would expect sinks to provide similar additional interfaces
> > >> like sources, e.g. checkpointing. We could also use the
> > >> startBundle/processElement/finishBundle lifecycle methods to implement
> > >> checkpointing. I just wonder, if we want to make it more explicit.
> > >> Also, does it make sense that sinks can return a PCollection? You can
> > >> return PDone but you don't have to.
> > >>
> > >> Since sinks are fundamental in streaming pipelines, it just seemed odd
> > >> to me that there is not dedicated interface. I understand a bit
> > >> clearer now that it is not viewed as crucial because we can use
> > >> existing primitives to create sinks. In a way, that might be elegant
> > >> but also less explicit.
> > >>
> > >> On Fri, Apr 29, 2016 at 11:00 PM, Frances Perry
> <fjp@google.com.invalid
> > >
> > >> wrote:
> > >> >>
> > >> >> @Frances Sources are not simple DoFns. They add additional
> > >> >> functionality, e.g. checkpointing, watermark generation, creating
> > >> >> splits. If we want sinks to be portable, we should think about a
> > >> >> dedicated interface. At least for the checkpointing.
> > >> >>
> > >> >
> > >> > We might be mixing sources and sinks in this conversation. ;-)
> Sources
> > >> > definitely provide additional functionality as you mentioned. But at
> > >> least
> > >> > currently, sinks don't provide any new primitive functionality. Are
> > you
> > >> > suggestion there needs to be a checkpointing interface for sinks
> > beyond
> > >> > DoFn's bundle finalization? (Note that the existing Write for batch
> is
> > >> just
> > >> > a PTransform based around ParDo.)
> > >>
> >
>
Re: [DISCUSS] Beam IO &runners native IO
Posted by Raghu Angadi <ra...@google.com.INVALID>.
agreed. finishBundle() helps but can not guarantee consistent state.
On Tue, May 3, 2016 at 1:49 AM, Maximilian Michels <mx...@apache.org> wrote:
> Correct, Kafka doesn't support rollbacks of the producer. In Flink
> there is the RollingSink which supports transactional rolling files.
> Admittedly, that is the only one. Still, checkpointing sinks in Beam
> could be useful for users who are concerned about exactly once
> semantics. I'm not sure whether we can implement something similar
> with the bundle mechanism.
>
> On Mon, May 2, 2016 at 11:50 PM, Raghu Angadi
> <ra...@google.com.invalid> wrote:
> > What are good examples of streaming sinks that support checkpointing (or
> > transactions/rollbacks)? I don't Kafka supports a rollback.
> >
> > On Mon, May 2, 2016 at 2:54 AM, Maximilian Michels <mx...@apache.org>
> wrote:
> >
> >> Yes, I would expect sinks to provide similar additional interfaces
> >> like sources, e.g. checkpointing. We could also use the
> >> startBundle/processElement/finishBundle lifecycle methods to implement
> >> checkpointing. I just wonder, if we want to make it more explicit.
> >> Also, does it make sense that sinks can return a PCollection? You can
> >> return PDone but you don't have to.
> >>
> >> Since sinks are fundamental in streaming pipelines, it just seemed odd
> >> to me that there is not dedicated interface. I understand a bit
> >> clearer now that it is not viewed as crucial because we can use
> >> existing primitives to create sinks. In a way, that might be elegant
> >> but also less explicit.
> >>
> >> On Fri, Apr 29, 2016 at 11:00 PM, Frances Perry <fjp@google.com.invalid
> >
> >> wrote:
> >> >>
> >> >> @Frances Sources are not simple DoFns. They add additional
> >> >> functionality, e.g. checkpointing, watermark generation, creating
> >> >> splits. If we want sinks to be portable, we should think about a
> >> >> dedicated interface. At least for the checkpointing.
> >> >>
> >> >
> >> > We might be mixing sources and sinks in this conversation. ;-) Sources
> >> > definitely provide additional functionality as you mentioned. But at
> >> least
> >> > currently, sinks don't provide any new primitive functionality. Are
> you
> >> > suggestion there needs to be a checkpointing interface for sinks
> beyond
> >> > DoFn's bundle finalization? (Note that the existing Write for batch is
> >> just
> >> > a PTransform based around ParDo.)
> >>
>
Re: [DISCUSS] Beam IO &runners native IO
Posted by Maximilian Michels <mx...@apache.org>.
Correct, Kafka doesn't support rollbacks of the producer. In Flink
there is the RollingSink which supports transactional rolling files.
Admittedly, that is the only one. Still, checkpointing sinks in Beam
could be useful for users who are concerned about exactly once
semantics. I'm not sure whether we can implement something similar
with the bundle mechanism.
On Mon, May 2, 2016 at 11:50 PM, Raghu Angadi
<ra...@google.com.invalid> wrote:
> What are good examples of streaming sinks that support checkpointing (or
> transactions/rollbacks)? I don't Kafka supports a rollback.
>
> On Mon, May 2, 2016 at 2:54 AM, Maximilian Michels <mx...@apache.org> wrote:
>
>> Yes, I would expect sinks to provide similar additional interfaces
>> like sources, e.g. checkpointing. We could also use the
>> startBundle/processElement/finishBundle lifecycle methods to implement
>> checkpointing. I just wonder, if we want to make it more explicit.
>> Also, does it make sense that sinks can return a PCollection? You can
>> return PDone but you don't have to.
>>
>> Since sinks are fundamental in streaming pipelines, it just seemed odd
>> to me that there is not dedicated interface. I understand a bit
>> clearer now that it is not viewed as crucial because we can use
>> existing primitives to create sinks. In a way, that might be elegant
>> but also less explicit.
>>
>> On Fri, Apr 29, 2016 at 11:00 PM, Frances Perry <fj...@google.com.invalid>
>> wrote:
>> >>
>> >> @Frances Sources are not simple DoFns. They add additional
>> >> functionality, e.g. checkpointing, watermark generation, creating
>> >> splits. If we want sinks to be portable, we should think about a
>> >> dedicated interface. At least for the checkpointing.
>> >>
>> >
>> > We might be mixing sources and sinks in this conversation. ;-) Sources
>> > definitely provide additional functionality as you mentioned. But at
>> least
>> > currently, sinks don't provide any new primitive functionality. Are you
>> > suggestion there needs to be a checkpointing interface for sinks beyond
>> > DoFn's bundle finalization? (Note that the existing Write for batch is
>> just
>> > a PTransform based around ParDo.)
>>
Re: [DISCUSS] Beam IO &runners native IO
Posted by Raghu Angadi <ra...@google.com.INVALID>.
What are good examples of streaming sinks that support checkpointing (or
transactions/rollbacks)? I don't Kafka supports a rollback.
On Mon, May 2, 2016 at 2:54 AM, Maximilian Michels <mx...@apache.org> wrote:
> Yes, I would expect sinks to provide similar additional interfaces
> like sources, e.g. checkpointing. We could also use the
> startBundle/processElement/finishBundle lifecycle methods to implement
> checkpointing. I just wonder, if we want to make it more explicit.
> Also, does it make sense that sinks can return a PCollection? You can
> return PDone but you don't have to.
>
> Since sinks are fundamental in streaming pipelines, it just seemed odd
> to me that there is not dedicated interface. I understand a bit
> clearer now that it is not viewed as crucial because we can use
> existing primitives to create sinks. In a way, that might be elegant
> but also less explicit.
>
> On Fri, Apr 29, 2016 at 11:00 PM, Frances Perry <fj...@google.com.invalid>
> wrote:
> >>
> >> @Frances Sources are not simple DoFns. They add additional
> >> functionality, e.g. checkpointing, watermark generation, creating
> >> splits. If we want sinks to be portable, we should think about a
> >> dedicated interface. At least for the checkpointing.
> >>
> >
> > We might be mixing sources and sinks in this conversation. ;-) Sources
> > definitely provide additional functionality as you mentioned. But at
> least
> > currently, sinks don't provide any new primitive functionality. Are you
> > suggestion there needs to be a checkpointing interface for sinks beyond
> > DoFn's bundle finalization? (Note that the existing Write for batch is
> just
> > a PTransform based around ParDo.)
>
Re: [DISCUSS] Beam IO &runners native IO
Posted by Maximilian Michels <mx...@apache.org>.
Yes, I would expect sinks to provide similar additional interfaces
like sources, e.g. checkpointing. We could also use the
startBundle/processElement/finishBundle lifecycle methods to implement
checkpointing. I just wonder, if we want to make it more explicit.
Also, does it make sense that sinks can return a PCollection? You can
return PDone but you don't have to.
Since sinks are fundamental in streaming pipelines, it just seemed odd
to me that there is not dedicated interface. I understand a bit
clearer now that it is not viewed as crucial because we can use
existing primitives to create sinks. In a way, that might be elegant
but also less explicit.
On Fri, Apr 29, 2016 at 11:00 PM, Frances Perry <fj...@google.com.invalid> wrote:
>>
>> @Frances Sources are not simple DoFns. They add additional
>> functionality, e.g. checkpointing, watermark generation, creating
>> splits. If we want sinks to be portable, we should think about a
>> dedicated interface. At least for the checkpointing.
>>
>
> We might be mixing sources and sinks in this conversation. ;-) Sources
> definitely provide additional functionality as you mentioned. But at least
> currently, sinks don't provide any new primitive functionality. Are you
> suggestion there needs to be a checkpointing interface for sinks beyond
> DoFn's bundle finalization? (Note that the existing Write for batch is just
> a PTransform based around ParDo.)
Re: [DISCUSS] Beam IO &runners native IO
Posted by Frances Perry <fj...@google.com.INVALID>.
>
> @Frances Sources are not simple DoFns. They add additional
> functionality, e.g. checkpointing, watermark generation, creating
> splits. If we want sinks to be portable, we should think about a
> dedicated interface. At least for the checkpointing.
>
We might be mixing sources and sinks in this conversation. ;-) Sources
definitely provide additional functionality as you mentioned. But at least
currently, sinks don't provide any new primitive functionality. Are you
suggestion there needs to be a checkpointing interface for sinks beyond
DoFn's bundle finalization? (Note that the existing Write for batch is just
a PTransform based around ParDo.)
Re: [DISCUSS] Beam IO &runners native IO
Posted by Maximilian Michels <mx...@apache.org>.
@Raghu Thanks for the explanation. I had already realized after
Aljoscha's comment that Kafka enforces this data model. I was too much
in the Flink land, where we usually only use the value part (although
it its also possible to set the key).
Good to hear you agree on factoring out the watermark/timestamp
extraction API methods into a separate interface so that it can be
reused across sources.
@Frances Sources are not simple DoFns. They add additional
functionality, e.g. checkpointing, watermark generation, creating
splits. If we want sinks to be portable, we should think about a
dedicated interface. At least for the checkpointing.
To come back to the original question, I think we reached a consensus
that we don't want a 'useNative()' method on Beam sources :)
On Fri, Apr 29, 2016 at 5:14 PM, Raghu Angadi
<ra...@google.com.invalid> wrote:
> On Fri, Apr 29, 2016 at 2:11 AM, Maximilian Michels <mx...@apache.org> wrote:
>
>> Further, the KafkaIO enforces a <key, value> data model which AFAIK is
>> not enforced by the Beam model. I don't know the details for this
>> design decision but I would like this to be communicated before it is
>> merged into the master.
>>
>
> <key, value> structure comes from Kafka. It is not related to Beam or any
> runner. I am not sure if I understood the concern here correctly. Every Kafka
> record
> <https://kafka.apache.org/090/javadoc/org/apache/kafka/clients/consumer/ConsumerRecord.html#ConsumerRecord(java.lang.String,%20int,%20long,%20K,%20V)>
> has key, value, and some metadata like offset and partition. KafkaIO
> directly reflects that.
>
> As most users don't need Kafka metadata, we added '.withoutMetadata()
> <https://github.com/apache/incubator-beam/blob/master/sdks/java/io/kafka/src/main/java/org/apache/beam/sdk/io/kafka/KafkaIO.java#L130>'
> that returns just <key, value>.
>
> One can argue many kafka consumers don't need key either. We debated adding
> another helper method '.dropKey()', but left it out. Users can easily drop
> keys in Beam :
>
> pipeline.apply(KafkaIO.read()....withoutMetaData())
> *.apply(Values.<String>create())*
>
>
>> Otherwise, it will be harder to achieve
>> portability among the Runners. In Flink and Spark we are already
>> experienced with all kinds of connectors and user's needs. It would be
>> nice to feed that back in the course of adding new connectors to the
>> Beam API.
>>
Re: [DISCUSS] Beam IO &runners native IO
Posted by Raghu Angadi <ra...@google.com.INVALID>.
On Fri, Apr 29, 2016 at 2:11 AM, Maximilian Michels <mx...@apache.org> wrote:
> Further, the KafkaIO enforces a <key, value> data model which AFAIK is
> not enforced by the Beam model. I don't know the details for this
> design decision but I would like this to be communicated before it is
> merged into the master.
>
<key, value> structure comes from Kafka. It is not related to Beam or any
runner. I am not sure if I understood the concern here correctly. Every Kafka
record
<https://kafka.apache.org/090/javadoc/org/apache/kafka/clients/consumer/ConsumerRecord.html#ConsumerRecord(java.lang.String,%20int,%20long,%20K,%20V)>
has key, value, and some metadata like offset and partition. KafkaIO
directly reflects that.
As most users don't need Kafka metadata, we added '.withoutMetadata()
<https://github.com/apache/incubator-beam/blob/master/sdks/java/io/kafka/src/main/java/org/apache/beam/sdk/io/kafka/KafkaIO.java#L130>'
that returns just <key, value>.
One can argue many kafka consumers don't need key either. We debated adding
another helper method '.dropKey()', but left it out. Users can easily drop
keys in Beam :
pipeline.apply(KafkaIO.read()....withoutMetaData())
*.apply(Values.<String>create())*
> Otherwise, it will be harder to achieve
> portability among the Runners. In Flink and Spark we are already
> experienced with all kinds of connectors and user's needs. It would be
> nice to feed that back in the course of adding new connectors to the
> Beam API.
>
Re: [DISCUSS] Beam IO &runners native IO
Posted by Raghu Angadi <ra...@google.com.INVALID>.
I agree with the sentiment here. Please note that runner specific sources
continue to work as they do now. The original question was about
'.useNative()' which requires generic to Beam sources to interact with the
specific routers (on those lines).
On Fri, Apr 29, 2016 at 2:11 AM, Maximilian Michels <mx...@apache.org> wrote:
> 1) Improving the integration of Runners with the Beam sink/source API
> 2) Providing interfaces to implement new connectors (i.e. still no
> existing UnboundedSink)
> 3) Extending existing interfaces to ease implementation of connectors
> and provide a uniform API (i.e. on top of UnboundedSource)
> 4) Working on a more complete set of connectors in Beam
>
> Looking at the KafkaIO implementation, I wonder shouldn't we extract
> the custom Watermark and Timestamp function into an extra interface?
>
All connectors are going to have methods these methods. It would be
> nice to have a uniform API among the connectors.
>
+1. It would be simpler both for source developers and users if these
timestamps could be set outside the sources (sources could still provide
timestamps if it makes sense).
will comment on <key, value> separately.
Raghu.
Re: [DISCUSS] Beam IO &runners native IO
Posted by Jean-Baptiste Onofré <jb...@nanthrax.net>.
Hi Max,
Understood. It remembers me a discussion we had with Dan.
Regards
JB
On 04/29/2016 12:44 PM, Maximilian Michels wrote:
> @Aljoscha I didn't know that Kafka always stores Key/Value but I see
> that we also have support for setting Kafka keys in Flink.
>
> @JB I get your point that a sink is simply a DoFn, but a ParDo is not
> a good match for a sink. A Sink doesn't produce a PCollection but
> represents the end of a pipeline. Like an UnboundedSource, an
> UnboundedSink has also special needs, i.e. it needs to provide a
> checkpointing mechanism. I think we need something along the lines of
> the existing Write transform for batch.
>
> On Fri, Apr 29, 2016 at 12:27 PM, Jean-Baptiste Onofr� <jb...@nanthrax.net> wrote:
>> Hi,
>>
>> KafkaIO uses KafkaRecord which is basically key,value + some metadata
>> (topic, partition, offset).
>>
>> Can you describe the behavior of an UnboundedSink ?
>>
>> UnboundedSource is obvious: it's still consuming data creating PCollection
>> sent into the pipeline.
>>
>> But UnboundedSink ? Do you mean that the UnboundedSink will write each
>> record in the PCollection ? When does it stop ?
>>
>> Regards
>> JB
>>
>>
>> On 04/29/2016 12:07 PM, Aljoscha Krettek wrote:
>>>
>>> Hi,
>>> I think the fact that KafkaIO has a <key, value> model comes from Kafka
>>> having a <key, value> model. I imagine most sources will emit the type of
>>> values appropriate for them.
>>>
>>> I agree with Max that the lack of an UnboundedSink seems strange. Do we
>>> have any "sinks" implemented as a ParDo already?
>>>
>>> Cheers,
>>> Aljoscha
>>>
>>> On Fri, 29 Apr 2016 at 11:22 Jean-Baptiste Onofr� <jb...@nanthrax.net> wrote:
>>>
>>>> Hi Max,
>>>>
>>>> Your four points are valid and we already discussed about that.
>>>>
>>>> 1. +1, the runner API should bring utils around that
>>>> 2. UnboundedSink has been discussed (I don't see strong use case for
>>>> now, as it takes a PCollection).
>>>> 3. +1, Dan talked about improving the hierarchy.
>>>> 4. +1, I'm working on new IO (JMS, MQTT, JDBC, Cassandra, Camel, ...).
>>>>
>>>> I would add:
>>>>
>>>> 5. Add a page on the website listing the IO, their usage and
>>>> configuration. Something like we have in Camel:
>>>> http://camel.apache.org/components.html
>>>> 6. Refactore the FileIO to avoid usage of IOChannelFactory and use a
>>>> filesystem plugin (file, hdfs, s3, aws, etc).
>>>>
>>>> Dan planned to create "util" to deal with watermark and timestamps.
>>>>
>>>> Regards
>>>> JB
>>>>
>>>> On 04/29/2016 11:11 AM, Maximilian Michels wrote:
>>>>>
>>>>> @Amir: This is the Developer mailing list. Please post your questions
>>>>> regarding Beam on the user mailing list.
>>>>>
>>>>> +1 for portability in general. However, I see some crucial TODOs coming
>>>>
>>>> up:
>>>>>
>>>>>
>>>>> 1) Improving the integration of Runners with the Beam sink/source API
>>>>> 2) Providing interfaces to implement new connectors (i.e. still no
>>>>> existing UnboundedSink)
>>>>> 3) Extending existing interfaces to ease implementation of connectors
>>>>> and provide a uniform API (i.e. on top of UnboundedSource)
>>>>> 4) Working on a more complete set of connectors in Beam
>>>>>
>>>>> Looking at the KafkaIO implementation, I wonder shouldn't we extract
>>>>> the custom Watermark and Timestamp function into an extra interface?
>>>>> All connectors are going to have methods these methods. It would be
>>>>> nice to have a uniform API among the connectors.
>>>>>
>>>>> Further, the KafkaIO enforces a <key, value> data model which AFAIK is
>>>>> not enforced by the Beam model. I don't know the details for this
>>>>> design decision but I would like this to be communicated before it is
>>>>> merged into the master. Otherwise, it will be harder to achieve
>>>>> portability among the Runners. In Flink and Spark we are already
>>>>> experienced with all kinds of connectors and user's needs. It would be
>>>>> nice to feed that back in the course of adding new connectors to the
>>>>> Beam API.
>>>>>
>>>>> I would expect an active discussion on the Dev mailing list before any
>>>>> new connector API gets merged. Furthermore, let us provide better
>>>>> interfaces for connector needs. Finally, let us introduce unbounded
>>>>> sinks :)
>>>>>
>>>>> On Fri, Apr 29, 2016 at 7:54 AM, amir bahmanyari
>>>>> <am...@yahoo.com.invalid> wrote:
>>>>>>
>>>>>> This may help trace it:Exception in thread "main"
>>>>
>>>> java.lang.IllegalStateException: no evaluator registered for
>>>> Read(UnboundedKafkaSource) at
>>>>
>>>> org.apache.beam.sdk.runners.DirectPipelineRunner$Evaluator.visitTransform(DirectPipelineRunner.java:898)
>>>> at
>>>>
>>>> org.apache.beam.sdk.runners.TransformTreeNode.visit(TransformTreeNode.java:221)
>>>> at
>>>>
>>>> org.apache.beam.sdk.runners.TransformTreeNode.visit(TransformTreeNode.java:217)
>>>> at
>>>>
>>>> org.apache.beam.sdk.runners.TransformTreeNode.visit(TransformTreeNode.java:217)
>>>> at
>>>>
>>>> org.apache.beam.sdk.runners.TransformHierarchy.visit(TransformHierarchy.java:104)
>>>> at org.apache.beam.sdk.Pipeline.traverseTopologically(Pipeline.java:261)
>>>> at
>>>>
>>>> org.apache.beam.sdk.runners.DirectPipelineRunner$Evaluator.run(DirectPipelineRunner.java:860)
>>>> at
>>>>
>>>> org.apache.beam.sdk.runners.DirectPipelineRunner.run(DirectPipelineRunner.java:572)
>>>> at
>>>>
>>>> org.apache.beam.sdk.runners.DirectPipelineRunner.run(DirectPipelineRunner.java:106)
>>>> at org.apache.beam.sdk.Pipeline.run(Pipeline.java:182) at benchmark.fli
>>>> n
>>>> kspark.flink.ReadFromKafka2.main(ReadFromKafka2.java:286)
>>>>>>
>>>>>>
>>>>>> From: Jean-Baptiste Onofr� <jb...@nanthrax.net>
>>>>>> To: dev@beam.incubator.apache.org
>>>>>> Sent: Thursday, April 28, 2016 10:08 PM
>>>>>> Subject: Re: [DISCUSS] Beam IO &runners native IO
>>>>>>
>>>>>> I gonna take a look. The DirectPipelineRunner didn't support the
>>>>>> unbounded collection (it has been fixed last night AFAIR). It could be
>>>>>> related.
>>>>>>
>>>>>> Regards
>>>>>> JB
>>>>>>
>>>>>> On 04/29/2016 07:00 AM, amir bahmanyari wrote:
>>>>>>>
>>>>>>> Hi JB,I used the sample KafkaIO usage
>>>>
>>>>
>>>> below.p.apply(KafkaIO.read().withBootstrapServers("kafkahost:9092").withTopics(topics));
>>>>>>>
>>>>>>> p.run();
>>>>>>>
>>>>>>> It threw the following at p.run():Exception in thread "main"
>>>>
>>>> java.lang.IllegalStateException: no evaluator registered for
>>>> Read(UnboundedKafkaSource) at
>>>>
>>>> org.apache.beam.sdk.runners.DirectPipelineRunner$Evaluator.visitTransform(DirectPipelineRunner.java:898)
>>>> I am sure I am missing something.Would be great if I could see a sample
>>>> code.I appreciate it sir.Cheers
>>>>>>>
>>>>>>>
>>>>>>> From: Jean-Baptiste Onofr� <jb...@nanthrax.net>
>>>>>>> To: dev@beam.incubator.apache.org
>>>>>>> Sent: Thursday, April 28, 2016 5:30 AM
>>>>>>> Subject: [DISCUSS] Beam IO &runners native IO
>>>>>>>
>>>>>>> Hi all,
>>>>>>>
>>>>>>> regarding the recent threads on the mailing list, I would like to
>>>>>>> start
>>>>>>> a format discussion around the IO.
>>>>>>> As we can expect the first contributions on this area (I already have
>>>>>>> some work in progress around this ;)), I think it's a fair discussion
>>>>
>>>> to
>>>>>>>
>>>>>>> have.
>>>>>>>
>>>>>>> Now, we have two kinds of IO: the one "generic" to Beam, the one
>>>>
>>>> "local"
>>>>>>>
>>>>>>> to the runners.
>>>>>>>
>>>>>>> For example, let's take Kafka: we have the KafkaIO (in IO), and for
>>>>>>> instance, we have the spark-streaming kafka connector (in Spark
>>>>
>>>> Runner).
>>>>>>>
>>>>>>>
>>>>>>> Right now, we have two approaches for the user:
>>>>>>> 1. In the pipeline, we use KafkaIO from Beam: it's the preferred
>>>>>>> approach for sure. However, the user may want to use the runner
>>>>
>>>> specific
>>>>>>>
>>>>>>> IO for two reasons:
>>>>>>> * Beam doesn't provide the IO yet (for instance, spark
>>>>>>> cassandra
>>>>>>> connector is available whereas we don't have yet any CassandraIO (I'm
>>>>>>> working on it anyway ;))
>>>>>>> * The runner native IO is optimized or contain more features
>>>>
>>>> that the
>>>>>>>
>>>>>>> Beam native IO
>>>>>>> 2. So, for the previous reasons, the user could want to use the native
>>>>>>> runner IO. The drawback of this approach is that the pipeline will be
>>>>>>> tight to a specific runner, which is completely against the Beam
>>>>
>>>> design.
>>>>>>>
>>>>>>>
>>>>>>> I wonder if it wouldn't make sense to add flag on the IO API (and
>>>>>>> related on Runner API) like .useNative().
>>>>>>>
>>>>>>> For instance, the user would be able to do:
>>>>>>>
>>>>>>>
>>>>
>>>> pipeline.apply(KafkaIO.read().withBootstrapServers("...").withTopics("...").useNative(true);
>>>>>>>
>>>>>>>
>>>>>>> then, if the runner has a "native" IO, it will use it, else, if
>>>>>>> useNative(false) (the default), it won't use any runner native IO.
>>>>>>>
>>>>>>> The point there is for the configuration: assuming the Beam IO and the
>>>>>>> runner IO can differ, it means that the "Beam IO" would have to
>>>>
>>>> populate
>>>>>>>
>>>>>>> all runner specific IO configuration.
>>>>>>>
>>>>>>> Of course, it's always possible to use a PTransform to wrap the runner
>>>>>>> native IO, but we are back on the same concern: the pipeline will be
>>>>>>> couple to a specific runner.
>>>>>>>
>>>>>>> The purpose of the useNative() flag is to "automatically" inform the
>>>>>>> runner to use a specific IO if it has one: the pipeline stays
>>>>>>> decoupled
>>>>>>> from the runners.
>>>>>>>
>>>>>>> Thoughts ?
>>>>>>>
>>>>>>> Thanks
>>>>>>> Regards
>>>>>>> JB
>>>>>>>
>>>>>>
>>>>>> --
>>>>>> Jean-Baptiste Onofr�
>>>>>> jbonofre@apache.org
>>>>>> http://blog.nanthrax.net
>>>>>> Talend - http://www.talend.com
>>>>>>
>>>>>>
>>>>>>
>>>>
>>>> --
>>>> Jean-Baptiste Onofr�
>>>> jbonofre@apache.org
>>>> http://blog.nanthrax.net
>>>> Talend - http://www.talend.com
>>>>
>>>
>>
>> --
>> Jean-Baptiste Onofr�
>> jbonofre@apache.org
>> http://blog.nanthrax.net
>> Talend - http://www.talend.com
--
Jean-Baptiste Onofr�
jbonofre@apache.org
http://blog.nanthrax.net
Talend - http://www.talend.com
Re: [DISCUSS] Beam IO &runners native IO
Posted by Frances Perry <fj...@google.com.INVALID>.
+Dan Halperin (who is OOO for a couple of days)
Yes, there are plans for unbounded sinks. But unlike sources, sinks don't
add any additional functionality beyond a ParDo (they just make it more
obvious how to use a ParDo appropriately to get the right fault tolerance).
So they haven't been prioritized yet.
On Fri, Apr 29, 2016 at 4:43 AM, Jean-Baptiste Onofré <jb...@nanthrax.net>
wrote:
> Hi Amit,
>
> yes, definitely, the highest priority is that the existing runners have to
> fully work with Beam IO. I will work with you on the Spark runner about
> that.
>
> Regards
> JB
>
>
> On 04/29/2016 01:06 PM, Amit Sela wrote:
>
>> +1 on Max's comment on active discussion for connector API.
>> I think that we can use Spark and Flink's existing connectors (Spark
>> supports many) as test cases and consider a bottom-up design approach
>> rather than top-down, especially since we're in incubation.
>>
>> Also +1 for Davor that runners should make SDK IOs a high priority - this
>> will probably give us more input then any good email thread.. I'll do my
>> best to make this happen for the Spark runner.
>>
>> On Fri, Apr 29, 2016 at 1:45 PM Maximilian Michels <mx...@apache.org>
>> wrote:
>>
>> @Aljoscha I didn't know that Kafka always stores Key/Value but I see
>>> that we also have support for setting Kafka keys in Flink.
>>>
>>> @JB I get your point that a sink is simply a DoFn, but a ParDo is not
>>> a good match for a sink. A Sink doesn't produce a PCollection but
>>> represents the end of a pipeline. Like an UnboundedSource, an
>>> UnboundedSink has also special needs, i.e. it needs to provide a
>>> checkpointing mechanism. I think we need something along the lines of
>>> the existing Write transform for batch.
>>>
>>> On Fri, Apr 29, 2016 at 12:27 PM, Jean-Baptiste Onofré <jb...@nanthrax.net>
>>> wrote:
>>>
>>>> Hi,
>>>>
>>>> KafkaIO uses KafkaRecord which is basically key,value + some metadata
>>>> (topic, partition, offset).
>>>>
>>>> Can you describe the behavior of an UnboundedSink ?
>>>>
>>>> UnboundedSource is obvious: it's still consuming data creating
>>>>
>>> PCollection
>>>
>>>> sent into the pipeline.
>>>>
>>>> But UnboundedSink ? Do you mean that the UnboundedSink will write each
>>>> record in the PCollection ? When does it stop ?
>>>>
>>>> Regards
>>>> JB
>>>>
>>>>
>>>> On 04/29/2016 12:07 PM, Aljoscha Krettek wrote:
>>>>
>>>>>
>>>>> Hi,
>>>>> I think the fact that KafkaIO has a <key, value> model comes from Kafka
>>>>> having a <key, value> model. I imagine most sources will emit the type
>>>>>
>>>> of
>>>
>>>> values appropriate for them.
>>>>>
>>>>> I agree with Max that the lack of an UnboundedSink seems strange. Do we
>>>>> have any "sinks" implemented as a ParDo already?
>>>>>
>>>>> Cheers,
>>>>> Aljoscha
>>>>>
>>>>> On Fri, 29 Apr 2016 at 11:22 Jean-Baptiste Onofré <jb...@nanthrax.net>
>>>>>
>>>> wrote:
>>>
>>>>
>>>>> Hi Max,
>>>>>>
>>>>>> Your four points are valid and we already discussed about that.
>>>>>>
>>>>>> 1. +1, the runner API should bring utils around that
>>>>>> 2. UnboundedSink has been discussed (I don't see strong use case for
>>>>>> now, as it takes a PCollection).
>>>>>> 3. +1, Dan talked about improving the hierarchy.
>>>>>> 4. +1, I'm working on new IO (JMS, MQTT, JDBC, Cassandra, Camel, ...).
>>>>>>
>>>>>> I would add:
>>>>>>
>>>>>> 5. Add a page on the website listing the IO, their usage and
>>>>>> configuration. Something like we have in Camel:
>>>>>> http://camel.apache.org/components.html
>>>>>> 6. Refactore the FileIO to avoid usage of IOChannelFactory and use a
>>>>>> filesystem plugin (file, hdfs, s3, aws, etc).
>>>>>>
>>>>>> Dan planned to create "util" to deal with watermark and timestamps.
>>>>>>
>>>>>> Regards
>>>>>> JB
>>>>>>
>>>>>> On 04/29/2016 11:11 AM, Maximilian Michels wrote:
>>>>>>
>>>>>>>
>>>>>>> @Amir: This is the Developer mailing list. Please post your questions
>>>>>>> regarding Beam on the user mailing list.
>>>>>>>
>>>>>>> +1 for portability in general. However, I see some crucial TODOs
>>>>>>>
>>>>>> coming
>>>
>>>>
>>>>>> up:
>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> 1) Improving the integration of Runners with the Beam sink/source API
>>>>>>> 2) Providing interfaces to implement new connectors (i.e. still no
>>>>>>> existing UnboundedSink)
>>>>>>> 3) Extending existing interfaces to ease implementation of connectors
>>>>>>> and provide a uniform API (i.e. on top of UnboundedSource)
>>>>>>> 4) Working on a more complete set of connectors in Beam
>>>>>>>
>>>>>>> Looking at the KafkaIO implementation, I wonder shouldn't we extract
>>>>>>> the custom Watermark and Timestamp function into an extra interface?
>>>>>>> All connectors are going to have methods these methods. It would be
>>>>>>> nice to have a uniform API among the connectors.
>>>>>>>
>>>>>>> Further, the KafkaIO enforces a <key, value> data model which AFAIK
>>>>>>> is
>>>>>>> not enforced by the Beam model. I don't know the details for this
>>>>>>> design decision but I would like this to be communicated before it is
>>>>>>> merged into the master. Otherwise, it will be harder to achieve
>>>>>>> portability among the Runners. In Flink and Spark we are already
>>>>>>> experienced with all kinds of connectors and user's needs. It would
>>>>>>> be
>>>>>>> nice to feed that back in the course of adding new connectors to the
>>>>>>> Beam API.
>>>>>>>
>>>>>>> I would expect an active discussion on the Dev mailing list before
>>>>>>> any
>>>>>>> new connector API gets merged. Furthermore, let us provide better
>>>>>>> interfaces for connector needs. Finally, let us introduce unbounded
>>>>>>> sinks :)
>>>>>>>
>>>>>>> On Fri, Apr 29, 2016 at 7:54 AM, amir bahmanyari
>>>>>>> <am...@yahoo.com.invalid> wrote:
>>>>>>>
>>>>>>>>
>>>>>>>> This may help trace it:Exception in thread "main"
>>>>>>>>
>>>>>>>
>>>>>> java.lang.IllegalStateException: no evaluator registered for
>>>>>> Read(UnboundedKafkaSource) at
>>>>>>
>>>>>>
>>>>>>
>>> org.apache.beam.sdk.runners.DirectPipelineRunner$Evaluator.visitTransform(DirectPipelineRunner.java:898)
>>>
>>>> at
>>>>>>
>>>>>>
>>>>>>
>>> org.apache.beam.sdk.runners.TransformTreeNode.visit(TransformTreeNode.java:221)
>>>
>>>> at
>>>>>>
>>>>>>
>>>>>>
>>> org.apache.beam.sdk.runners.TransformTreeNode.visit(TransformTreeNode.java:217)
>>>
>>>> at
>>>>>>
>>>>>>
>>>>>>
>>> org.apache.beam.sdk.runners.TransformTreeNode.visit(TransformTreeNode.java:217)
>>>
>>>> at
>>>>>>
>>>>>>
>>>>>>
>>> org.apache.beam.sdk.runners.TransformHierarchy.visit(TransformHierarchy.java:104)
>>>
>>>> at
>>>>>>
>>>>> org.apache.beam.sdk.Pipeline.traverseTopologically(Pipeline.java:261)
>>>
>>>> at
>>>>>>
>>>>>>
>>>>>>
>>> org.apache.beam.sdk.runners.DirectPipelineRunner$Evaluator.run(DirectPipelineRunner.java:860)
>>>
>>>> at
>>>>>>
>>>>>>
>>>>>>
>>> org.apache.beam.sdk.runners.DirectPipelineRunner.run(DirectPipelineRunner.java:572)
>>>
>>>> at
>>>>>>
>>>>>>
>>>>>>
>>> org.apache.beam.sdk.runners.DirectPipelineRunner.run(DirectPipelineRunner.java:106)
>>>
>>>> at org.apache.beam.sdk.Pipeline.run(Pipeline.java:182) at benchmark.fli
>>>>>> n
>>>>>> kspark.flink.ReadFromKafka2.main(ReadFromKafka2.java:286)
>>>>>>
>>>>>>>
>>>>>>>>
>>>>>>>> From: Jean-Baptiste Onofré <jb...@nanthrax.net>
>>>>>>>> To: dev@beam.incubator.apache.org
>>>>>>>> Sent: Thursday, April 28, 2016 10:08 PM
>>>>>>>> Subject: Re: [DISCUSS] Beam IO &runners native IO
>>>>>>>>
>>>>>>>> I gonna take a look. The DirectPipelineRunner didn't support the
>>>>>>>> unbounded collection (it has been fixed last night AFAIR). It could
>>>>>>>>
>>>>>>> be
>>>
>>>> related.
>>>>>>>>
>>>>>>>> Regards
>>>>>>>> JB
>>>>>>>>
>>>>>>>> On 04/29/2016 07:00 AM, amir bahmanyari wrote:
>>>>>>>>
>>>>>>>>>
>>>>>>>>> Hi JB,I used the sample KafkaIO usage
>>>>>>>>>
>>>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>> below.p.apply(KafkaIO.read().withBootstrapServers("kafkahost:9092").withTopics(topics));
>>>
>>>>
>>>>>>>>> p.run();
>>>>>>>>>
>>>>>>>>> It threw the following at p.run():Exception in thread "main"
>>>>>>>>>
>>>>>>>>
>>>>>> java.lang.IllegalStateException: no evaluator registered for
>>>>>> Read(UnboundedKafkaSource) at
>>>>>>
>>>>>>
>>>>>>
>>> org.apache.beam.sdk.runners.DirectPipelineRunner$Evaluator.visitTransform(DirectPipelineRunner.java:898)
>>>
>>>> I am sure I am missing something.Would be great if I could see a sample
>>>>>> code.I appreciate it sir.Cheers
>>>>>>
>>>>>>>
>>>>>>>>>
>>>>>>>>> From: Jean-Baptiste Onofré <jb...@nanthrax.net>
>>>>>>>>> To: dev@beam.incubator.apache.org
>>>>>>>>> Sent: Thursday, April 28, 2016 5:30 AM
>>>>>>>>> Subject: [DISCUSS] Beam IO &runners native IO
>>>>>>>>>
>>>>>>>>> Hi all,
>>>>>>>>>
>>>>>>>>> regarding the recent threads on the mailing list, I would like to
>>>>>>>>> start
>>>>>>>>> a format discussion around the IO.
>>>>>>>>> As we can expect the first contributions on this area (I already
>>>>>>>>>
>>>>>>>> have
>>>
>>>> some work in progress around this ;)), I think it's a fair
>>>>>>>>>
>>>>>>>> discussion
>>>
>>>>
>>>>>> to
>>>>>>
>>>>>>>
>>>>>>>>> have.
>>>>>>>>>
>>>>>>>>> Now, we have two kinds of IO: the one "generic" to Beam, the one
>>>>>>>>>
>>>>>>>>
>>>>>> "local"
>>>>>>
>>>>>>>
>>>>>>>>> to the runners.
>>>>>>>>>
>>>>>>>>> For example, let's take Kafka: we have the KafkaIO (in IO), and for
>>>>>>>>> instance, we have the spark-streaming kafka connector (in Spark
>>>>>>>>>
>>>>>>>>
>>>>>> Runner).
>>>>>>
>>>>>>>
>>>>>>>>>
>>>>>>>>> Right now, we have two approaches for the user:
>>>>>>>>> 1. In the pipeline, we use KafkaIO from Beam: it's the preferred
>>>>>>>>> approach for sure. However, the user may want to use the runner
>>>>>>>>>
>>>>>>>>
>>>>>> specific
>>>>>>
>>>>>>>
>>>>>>>>> IO for two reasons:
>>>>>>>>> * Beam doesn't provide the IO yet (for instance, spark
>>>>>>>>> cassandra
>>>>>>>>> connector is available whereas we don't have yet any CassandraIO
>>>>>>>>>
>>>>>>>> (I'm
>>>
>>>> working on it anyway ;))
>>>>>>>>> * The runner native IO is optimized or contain more
>>>>>>>>> features
>>>>>>>>>
>>>>>>>>
>>>>>> that the
>>>>>>
>>>>>>>
>>>>>>>>> Beam native IO
>>>>>>>>> 2. So, for the previous reasons, the user could want to use the
>>>>>>>>>
>>>>>>>> native
>>>
>>>> runner IO. The drawback of this approach is that the pipeline will
>>>>>>>>>
>>>>>>>> be
>>>
>>>> tight to a specific runner, which is completely against the Beam
>>>>>>>>>
>>>>>>>>
>>>>>> design.
>>>>>>
>>>>>>>
>>>>>>>>>
>>>>>>>>> I wonder if it wouldn't make sense to add flag on the IO API (and
>>>>>>>>> related on Runner API) like .useNative().
>>>>>>>>>
>>>>>>>>> For instance, the user would be able to do:
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>
>>>>>>
>>> pipeline.apply(KafkaIO.read().withBootstrapServers("...").withTopics("...").useNative(true);
>>>
>>>>
>>>>>>>>>
>>>>>>>>> then, if the runner has a "native" IO, it will use it, else, if
>>>>>>>>> useNative(false) (the default), it won't use any runner native IO.
>>>>>>>>>
>>>>>>>>> The point there is for the configuration: assuming the Beam IO and
>>>>>>>>>
>>>>>>>> the
>>>
>>>> runner IO can differ, it means that the "Beam IO" would have to
>>>>>>>>>
>>>>>>>>
>>>>>> populate
>>>>>>
>>>>>>>
>>>>>>>>> all runner specific IO configuration.
>>>>>>>>>
>>>>>>>>> Of course, it's always possible to use a PTransform to wrap the
>>>>>>>>>
>>>>>>>> runner
>>>
>>>> native IO, but we are back on the same concern: the pipeline will be
>>>>>>>>> couple to a specific runner.
>>>>>>>>>
>>>>>>>>> The purpose of the useNative() flag is to "automatically" inform
>>>>>>>>> the
>>>>>>>>> runner to use a specific IO if it has one: the pipeline stays
>>>>>>>>> decoupled
>>>>>>>>> from the runners.
>>>>>>>>>
>>>>>>>>> Thoughts ?
>>>>>>>>>
>>>>>>>>> Thanks
>>>>>>>>> Regards
>>>>>>>>> JB
>>>>>>>>>
>>>>>>>>>
>>>>>>>> --
>>>>>>>> Jean-Baptiste Onofré
>>>>>>>> jbonofre@apache.org
>>>>>>>> http://blog.nanthrax.net
>>>>>>>> Talend - http://www.talend.com
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>> --
>>>>>> Jean-Baptiste Onofré
>>>>>> jbonofre@apache.org
>>>>>> http://blog.nanthrax.net
>>>>>> Talend - http://www.talend.com
>>>>>>
>>>>>>
>>>>>
>>>> --
>>>> Jean-Baptiste Onofré
>>>> jbonofre@apache.org
>>>> http://blog.nanthrax.net
>>>> Talend - http://www.talend.com
>>>>
>>>
>>>
>>
> --
> Jean-Baptiste Onofré
> jbonofre@apache.org
> http://blog.nanthrax.net
> Talend - http://www.talend.com
>
Re: [DISCUSS] Beam IO &runners native IO
Posted by Jean-Baptiste Onofré <jb...@nanthrax.net>.
Hi Amit,
yes, definitely, the highest priority is that the existing runners have
to fully work with Beam IO. I will work with you on the Spark runner
about that.
Regards
JB
On 04/29/2016 01:06 PM, Amit Sela wrote:
> +1 on Max's comment on active discussion for connector API.
> I think that we can use Spark and Flink's existing connectors (Spark
> supports many) as test cases and consider a bottom-up design approach
> rather than top-down, especially since we're in incubation.
>
> Also +1 for Davor that runners should make SDK IOs a high priority - this
> will probably give us more input then any good email thread.. I'll do my
> best to make this happen for the Spark runner.
>
> On Fri, Apr 29, 2016 at 1:45 PM Maximilian Michels <mx...@apache.org> wrote:
>
>> @Aljoscha I didn't know that Kafka always stores Key/Value but I see
>> that we also have support for setting Kafka keys in Flink.
>>
>> @JB I get your point that a sink is simply a DoFn, but a ParDo is not
>> a good match for a sink. A Sink doesn't produce a PCollection but
>> represents the end of a pipeline. Like an UnboundedSource, an
>> UnboundedSink has also special needs, i.e. it needs to provide a
>> checkpointing mechanism. I think we need something along the lines of
>> the existing Write transform for batch.
>>
>> On Fri, Apr 29, 2016 at 12:27 PM, Jean-Baptiste Onofr� <jb...@nanthrax.net>
>> wrote:
>>> Hi,
>>>
>>> KafkaIO uses KafkaRecord which is basically key,value + some metadata
>>> (topic, partition, offset).
>>>
>>> Can you describe the behavior of an UnboundedSink ?
>>>
>>> UnboundedSource is obvious: it's still consuming data creating
>> PCollection
>>> sent into the pipeline.
>>>
>>> But UnboundedSink ? Do you mean that the UnboundedSink will write each
>>> record in the PCollection ? When does it stop ?
>>>
>>> Regards
>>> JB
>>>
>>>
>>> On 04/29/2016 12:07 PM, Aljoscha Krettek wrote:
>>>>
>>>> Hi,
>>>> I think the fact that KafkaIO has a <key, value> model comes from Kafka
>>>> having a <key, value> model. I imagine most sources will emit the type
>> of
>>>> values appropriate for them.
>>>>
>>>> I agree with Max that the lack of an UnboundedSink seems strange. Do we
>>>> have any "sinks" implemented as a ParDo already?
>>>>
>>>> Cheers,
>>>> Aljoscha
>>>>
>>>> On Fri, 29 Apr 2016 at 11:22 Jean-Baptiste Onofr� <jb...@nanthrax.net>
>> wrote:
>>>>
>>>>> Hi Max,
>>>>>
>>>>> Your four points are valid and we already discussed about that.
>>>>>
>>>>> 1. +1, the runner API should bring utils around that
>>>>> 2. UnboundedSink has been discussed (I don't see strong use case for
>>>>> now, as it takes a PCollection).
>>>>> 3. +1, Dan talked about improving the hierarchy.
>>>>> 4. +1, I'm working on new IO (JMS, MQTT, JDBC, Cassandra, Camel, ...).
>>>>>
>>>>> I would add:
>>>>>
>>>>> 5. Add a page on the website listing the IO, their usage and
>>>>> configuration. Something like we have in Camel:
>>>>> http://camel.apache.org/components.html
>>>>> 6. Refactore the FileIO to avoid usage of IOChannelFactory and use a
>>>>> filesystem plugin (file, hdfs, s3, aws, etc).
>>>>>
>>>>> Dan planned to create "util" to deal with watermark and timestamps.
>>>>>
>>>>> Regards
>>>>> JB
>>>>>
>>>>> On 04/29/2016 11:11 AM, Maximilian Michels wrote:
>>>>>>
>>>>>> @Amir: This is the Developer mailing list. Please post your questions
>>>>>> regarding Beam on the user mailing list.
>>>>>>
>>>>>> +1 for portability in general. However, I see some crucial TODOs
>> coming
>>>>>
>>>>> up:
>>>>>>
>>>>>>
>>>>>> 1) Improving the integration of Runners with the Beam sink/source API
>>>>>> 2) Providing interfaces to implement new connectors (i.e. still no
>>>>>> existing UnboundedSink)
>>>>>> 3) Extending existing interfaces to ease implementation of connectors
>>>>>> and provide a uniform API (i.e. on top of UnboundedSource)
>>>>>> 4) Working on a more complete set of connectors in Beam
>>>>>>
>>>>>> Looking at the KafkaIO implementation, I wonder shouldn't we extract
>>>>>> the custom Watermark and Timestamp function into an extra interface?
>>>>>> All connectors are going to have methods these methods. It would be
>>>>>> nice to have a uniform API among the connectors.
>>>>>>
>>>>>> Further, the KafkaIO enforces a <key, value> data model which AFAIK is
>>>>>> not enforced by the Beam model. I don't know the details for this
>>>>>> design decision but I would like this to be communicated before it is
>>>>>> merged into the master. Otherwise, it will be harder to achieve
>>>>>> portability among the Runners. In Flink and Spark we are already
>>>>>> experienced with all kinds of connectors and user's needs. It would be
>>>>>> nice to feed that back in the course of adding new connectors to the
>>>>>> Beam API.
>>>>>>
>>>>>> I would expect an active discussion on the Dev mailing list before any
>>>>>> new connector API gets merged. Furthermore, let us provide better
>>>>>> interfaces for connector needs. Finally, let us introduce unbounded
>>>>>> sinks :)
>>>>>>
>>>>>> On Fri, Apr 29, 2016 at 7:54 AM, amir bahmanyari
>>>>>> <am...@yahoo.com.invalid> wrote:
>>>>>>>
>>>>>>> This may help trace it:Exception in thread "main"
>>>>>
>>>>> java.lang.IllegalStateException: no evaluator registered for
>>>>> Read(UnboundedKafkaSource) at
>>>>>
>>>>>
>> org.apache.beam.sdk.runners.DirectPipelineRunner$Evaluator.visitTransform(DirectPipelineRunner.java:898)
>>>>> at
>>>>>
>>>>>
>> org.apache.beam.sdk.runners.TransformTreeNode.visit(TransformTreeNode.java:221)
>>>>> at
>>>>>
>>>>>
>> org.apache.beam.sdk.runners.TransformTreeNode.visit(TransformTreeNode.java:217)
>>>>> at
>>>>>
>>>>>
>> org.apache.beam.sdk.runners.TransformTreeNode.visit(TransformTreeNode.java:217)
>>>>> at
>>>>>
>>>>>
>> org.apache.beam.sdk.runners.TransformHierarchy.visit(TransformHierarchy.java:104)
>>>>> at
>> org.apache.beam.sdk.Pipeline.traverseTopologically(Pipeline.java:261)
>>>>> at
>>>>>
>>>>>
>> org.apache.beam.sdk.runners.DirectPipelineRunner$Evaluator.run(DirectPipelineRunner.java:860)
>>>>> at
>>>>>
>>>>>
>> org.apache.beam.sdk.runners.DirectPipelineRunner.run(DirectPipelineRunner.java:572)
>>>>> at
>>>>>
>>>>>
>> org.apache.beam.sdk.runners.DirectPipelineRunner.run(DirectPipelineRunner.java:106)
>>>>> at org.apache.beam.sdk.Pipeline.run(Pipeline.java:182) at benchmark.fli
>>>>> n
>>>>> kspark.flink.ReadFromKafka2.main(ReadFromKafka2.java:286)
>>>>>>>
>>>>>>>
>>>>>>> From: Jean-Baptiste Onofr� <jb...@nanthrax.net>
>>>>>>> To: dev@beam.incubator.apache.org
>>>>>>> Sent: Thursday, April 28, 2016 10:08 PM
>>>>>>> Subject: Re: [DISCUSS] Beam IO &runners native IO
>>>>>>>
>>>>>>> I gonna take a look. The DirectPipelineRunner didn't support the
>>>>>>> unbounded collection (it has been fixed last night AFAIR). It could
>> be
>>>>>>> related.
>>>>>>>
>>>>>>> Regards
>>>>>>> JB
>>>>>>>
>>>>>>> On 04/29/2016 07:00 AM, amir bahmanyari wrote:
>>>>>>>>
>>>>>>>> Hi JB,I used the sample KafkaIO usage
>>>>>
>>>>>
>>>>>
>> below.p.apply(KafkaIO.read().withBootstrapServers("kafkahost:9092").withTopics(topics));
>>>>>>>>
>>>>>>>> p.run();
>>>>>>>>
>>>>>>>> It threw the following at p.run():Exception in thread "main"
>>>>>
>>>>> java.lang.IllegalStateException: no evaluator registered for
>>>>> Read(UnboundedKafkaSource) at
>>>>>
>>>>>
>> org.apache.beam.sdk.runners.DirectPipelineRunner$Evaluator.visitTransform(DirectPipelineRunner.java:898)
>>>>> I am sure I am missing something.Would be great if I could see a sample
>>>>> code.I appreciate it sir.Cheers
>>>>>>>>
>>>>>>>>
>>>>>>>> From: Jean-Baptiste Onofr� <jb...@nanthrax.net>
>>>>>>>> To: dev@beam.incubator.apache.org
>>>>>>>> Sent: Thursday, April 28, 2016 5:30 AM
>>>>>>>> Subject: [DISCUSS] Beam IO &runners native IO
>>>>>>>>
>>>>>>>> Hi all,
>>>>>>>>
>>>>>>>> regarding the recent threads on the mailing list, I would like to
>>>>>>>> start
>>>>>>>> a format discussion around the IO.
>>>>>>>> As we can expect the first contributions on this area (I already
>> have
>>>>>>>> some work in progress around this ;)), I think it's a fair
>> discussion
>>>>>
>>>>> to
>>>>>>>>
>>>>>>>> have.
>>>>>>>>
>>>>>>>> Now, we have two kinds of IO: the one "generic" to Beam, the one
>>>>>
>>>>> "local"
>>>>>>>>
>>>>>>>> to the runners.
>>>>>>>>
>>>>>>>> For example, let's take Kafka: we have the KafkaIO (in IO), and for
>>>>>>>> instance, we have the spark-streaming kafka connector (in Spark
>>>>>
>>>>> Runner).
>>>>>>>>
>>>>>>>>
>>>>>>>> Right now, we have two approaches for the user:
>>>>>>>> 1. In the pipeline, we use KafkaIO from Beam: it's the preferred
>>>>>>>> approach for sure. However, the user may want to use the runner
>>>>>
>>>>> specific
>>>>>>>>
>>>>>>>> IO for two reasons:
>>>>>>>> * Beam doesn't provide the IO yet (for instance, spark
>>>>>>>> cassandra
>>>>>>>> connector is available whereas we don't have yet any CassandraIO
>> (I'm
>>>>>>>> working on it anyway ;))
>>>>>>>> * The runner native IO is optimized or contain more features
>>>>>
>>>>> that the
>>>>>>>>
>>>>>>>> Beam native IO
>>>>>>>> 2. So, for the previous reasons, the user could want to use the
>> native
>>>>>>>> runner IO. The drawback of this approach is that the pipeline will
>> be
>>>>>>>> tight to a specific runner, which is completely against the Beam
>>>>>
>>>>> design.
>>>>>>>>
>>>>>>>>
>>>>>>>> I wonder if it wouldn't make sense to add flag on the IO API (and
>>>>>>>> related on Runner API) like .useNative().
>>>>>>>>
>>>>>>>> For instance, the user would be able to do:
>>>>>>>>
>>>>>>>>
>>>>>
>>>>>
>> pipeline.apply(KafkaIO.read().withBootstrapServers("...").withTopics("...").useNative(true);
>>>>>>>>
>>>>>>>>
>>>>>>>> then, if the runner has a "native" IO, it will use it, else, if
>>>>>>>> useNative(false) (the default), it won't use any runner native IO.
>>>>>>>>
>>>>>>>> The point there is for the configuration: assuming the Beam IO and
>> the
>>>>>>>> runner IO can differ, it means that the "Beam IO" would have to
>>>>>
>>>>> populate
>>>>>>>>
>>>>>>>> all runner specific IO configuration.
>>>>>>>>
>>>>>>>> Of course, it's always possible to use a PTransform to wrap the
>> runner
>>>>>>>> native IO, but we are back on the same concern: the pipeline will be
>>>>>>>> couple to a specific runner.
>>>>>>>>
>>>>>>>> The purpose of the useNative() flag is to "automatically" inform the
>>>>>>>> runner to use a specific IO if it has one: the pipeline stays
>>>>>>>> decoupled
>>>>>>>> from the runners.
>>>>>>>>
>>>>>>>> Thoughts ?
>>>>>>>>
>>>>>>>> Thanks
>>>>>>>> Regards
>>>>>>>> JB
>>>>>>>>
>>>>>>>
>>>>>>> --
>>>>>>> Jean-Baptiste Onofr�
>>>>>>> jbonofre@apache.org
>>>>>>> http://blog.nanthrax.net
>>>>>>> Talend - http://www.talend.com
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>
>>>>> --
>>>>> Jean-Baptiste Onofr�
>>>>> jbonofre@apache.org
>>>>> http://blog.nanthrax.net
>>>>> Talend - http://www.talend.com
>>>>>
>>>>
>>>
>>> --
>>> Jean-Baptiste Onofr�
>>> jbonofre@apache.org
>>> http://blog.nanthrax.net
>>> Talend - http://www.talend.com
>>
>
--
Jean-Baptiste Onofr�
jbonofre@apache.org
http://blog.nanthrax.net
Talend - http://www.talend.com
Re: [DISCUSS] Beam IO &runners native IO
Posted by Amit Sela <am...@gmail.com>.
+1 on Max's comment on active discussion for connector API.
I think that we can use Spark and Flink's existing connectors (Spark
supports many) as test cases and consider a bottom-up design approach
rather than top-down, especially since we're in incubation.
Also +1 for Davor that runners should make SDK IOs a high priority - this
will probably give us more input then any good email thread.. I'll do my
best to make this happen for the Spark runner.
On Fri, Apr 29, 2016 at 1:45 PM Maximilian Michels <mx...@apache.org> wrote:
> @Aljoscha I didn't know that Kafka always stores Key/Value but I see
> that we also have support for setting Kafka keys in Flink.
>
> @JB I get your point that a sink is simply a DoFn, but a ParDo is not
> a good match for a sink. A Sink doesn't produce a PCollection but
> represents the end of a pipeline. Like an UnboundedSource, an
> UnboundedSink has also special needs, i.e. it needs to provide a
> checkpointing mechanism. I think we need something along the lines of
> the existing Write transform for batch.
>
> On Fri, Apr 29, 2016 at 12:27 PM, Jean-Baptiste Onofré <jb...@nanthrax.net>
> wrote:
> > Hi,
> >
> > KafkaIO uses KafkaRecord which is basically key,value + some metadata
> > (topic, partition, offset).
> >
> > Can you describe the behavior of an UnboundedSink ?
> >
> > UnboundedSource is obvious: it's still consuming data creating
> PCollection
> > sent into the pipeline.
> >
> > But UnboundedSink ? Do you mean that the UnboundedSink will write each
> > record in the PCollection ? When does it stop ?
> >
> > Regards
> > JB
> >
> >
> > On 04/29/2016 12:07 PM, Aljoscha Krettek wrote:
> >>
> >> Hi,
> >> I think the fact that KafkaIO has a <key, value> model comes from Kafka
> >> having a <key, value> model. I imagine most sources will emit the type
> of
> >> values appropriate for them.
> >>
> >> I agree with Max that the lack of an UnboundedSink seems strange. Do we
> >> have any "sinks" implemented as a ParDo already?
> >>
> >> Cheers,
> >> Aljoscha
> >>
> >> On Fri, 29 Apr 2016 at 11:22 Jean-Baptiste Onofré <jb...@nanthrax.net>
> wrote:
> >>
> >>> Hi Max,
> >>>
> >>> Your four points are valid and we already discussed about that.
> >>>
> >>> 1. +1, the runner API should bring utils around that
> >>> 2. UnboundedSink has been discussed (I don't see strong use case for
> >>> now, as it takes a PCollection).
> >>> 3. +1, Dan talked about improving the hierarchy.
> >>> 4. +1, I'm working on new IO (JMS, MQTT, JDBC, Cassandra, Camel, ...).
> >>>
> >>> I would add:
> >>>
> >>> 5. Add a page on the website listing the IO, their usage and
> >>> configuration. Something like we have in Camel:
> >>> http://camel.apache.org/components.html
> >>> 6. Refactore the FileIO to avoid usage of IOChannelFactory and use a
> >>> filesystem plugin (file, hdfs, s3, aws, etc).
> >>>
> >>> Dan planned to create "util" to deal with watermark and timestamps.
> >>>
> >>> Regards
> >>> JB
> >>>
> >>> On 04/29/2016 11:11 AM, Maximilian Michels wrote:
> >>>>
> >>>> @Amir: This is the Developer mailing list. Please post your questions
> >>>> regarding Beam on the user mailing list.
> >>>>
> >>>> +1 for portability in general. However, I see some crucial TODOs
> coming
> >>>
> >>> up:
> >>>>
> >>>>
> >>>> 1) Improving the integration of Runners with the Beam sink/source API
> >>>> 2) Providing interfaces to implement new connectors (i.e. still no
> >>>> existing UnboundedSink)
> >>>> 3) Extending existing interfaces to ease implementation of connectors
> >>>> and provide a uniform API (i.e. on top of UnboundedSource)
> >>>> 4) Working on a more complete set of connectors in Beam
> >>>>
> >>>> Looking at the KafkaIO implementation, I wonder shouldn't we extract
> >>>> the custom Watermark and Timestamp function into an extra interface?
> >>>> All connectors are going to have methods these methods. It would be
> >>>> nice to have a uniform API among the connectors.
> >>>>
> >>>> Further, the KafkaIO enforces a <key, value> data model which AFAIK is
> >>>> not enforced by the Beam model. I don't know the details for this
> >>>> design decision but I would like this to be communicated before it is
> >>>> merged into the master. Otherwise, it will be harder to achieve
> >>>> portability among the Runners. In Flink and Spark we are already
> >>>> experienced with all kinds of connectors and user's needs. It would be
> >>>> nice to feed that back in the course of adding new connectors to the
> >>>> Beam API.
> >>>>
> >>>> I would expect an active discussion on the Dev mailing list before any
> >>>> new connector API gets merged. Furthermore, let us provide better
> >>>> interfaces for connector needs. Finally, let us introduce unbounded
> >>>> sinks :)
> >>>>
> >>>> On Fri, Apr 29, 2016 at 7:54 AM, amir bahmanyari
> >>>> <am...@yahoo.com.invalid> wrote:
> >>>>>
> >>>>> This may help trace it:Exception in thread "main"
> >>>
> >>> java.lang.IllegalStateException: no evaluator registered for
> >>> Read(UnboundedKafkaSource) at
> >>>
> >>>
> org.apache.beam.sdk.runners.DirectPipelineRunner$Evaluator.visitTransform(DirectPipelineRunner.java:898)
> >>> at
> >>>
> >>>
> org.apache.beam.sdk.runners.TransformTreeNode.visit(TransformTreeNode.java:221)
> >>> at
> >>>
> >>>
> org.apache.beam.sdk.runners.TransformTreeNode.visit(TransformTreeNode.java:217)
> >>> at
> >>>
> >>>
> org.apache.beam.sdk.runners.TransformTreeNode.visit(TransformTreeNode.java:217)
> >>> at
> >>>
> >>>
> org.apache.beam.sdk.runners.TransformHierarchy.visit(TransformHierarchy.java:104)
> >>> at
> org.apache.beam.sdk.Pipeline.traverseTopologically(Pipeline.java:261)
> >>> at
> >>>
> >>>
> org.apache.beam.sdk.runners.DirectPipelineRunner$Evaluator.run(DirectPipelineRunner.java:860)
> >>> at
> >>>
> >>>
> org.apache.beam.sdk.runners.DirectPipelineRunner.run(DirectPipelineRunner.java:572)
> >>> at
> >>>
> >>>
> org.apache.beam.sdk.runners.DirectPipelineRunner.run(DirectPipelineRunner.java:106)
> >>> at org.apache.beam.sdk.Pipeline.run(Pipeline.java:182) at benchmark.fli
> >>> n
> >>> kspark.flink.ReadFromKafka2.main(ReadFromKafka2.java:286)
> >>>>>
> >>>>>
> >>>>> From: Jean-Baptiste Onofré <jb...@nanthrax.net>
> >>>>> To: dev@beam.incubator.apache.org
> >>>>> Sent: Thursday, April 28, 2016 10:08 PM
> >>>>> Subject: Re: [DISCUSS] Beam IO &runners native IO
> >>>>>
> >>>>> I gonna take a look. The DirectPipelineRunner didn't support the
> >>>>> unbounded collection (it has been fixed last night AFAIR). It could
> be
> >>>>> related.
> >>>>>
> >>>>> Regards
> >>>>> JB
> >>>>>
> >>>>> On 04/29/2016 07:00 AM, amir bahmanyari wrote:
> >>>>>>
> >>>>>> Hi JB,I used the sample KafkaIO usage
> >>>
> >>>
> >>>
> below.p.apply(KafkaIO.read().withBootstrapServers("kafkahost:9092").withTopics(topics));
> >>>>>>
> >>>>>> p.run();
> >>>>>>
> >>>>>> It threw the following at p.run():Exception in thread "main"
> >>>
> >>> java.lang.IllegalStateException: no evaluator registered for
> >>> Read(UnboundedKafkaSource) at
> >>>
> >>>
> org.apache.beam.sdk.runners.DirectPipelineRunner$Evaluator.visitTransform(DirectPipelineRunner.java:898)
> >>> I am sure I am missing something.Would be great if I could see a sample
> >>> code.I appreciate it sir.Cheers
> >>>>>>
> >>>>>>
> >>>>>> From: Jean-Baptiste Onofré <jb...@nanthrax.net>
> >>>>>> To: dev@beam.incubator.apache.org
> >>>>>> Sent: Thursday, April 28, 2016 5:30 AM
> >>>>>> Subject: [DISCUSS] Beam IO &runners native IO
> >>>>>>
> >>>>>> Hi all,
> >>>>>>
> >>>>>> regarding the recent threads on the mailing list, I would like to
> >>>>>> start
> >>>>>> a format discussion around the IO.
> >>>>>> As we can expect the first contributions on this area (I already
> have
> >>>>>> some work in progress around this ;)), I think it's a fair
> discussion
> >>>
> >>> to
> >>>>>>
> >>>>>> have.
> >>>>>>
> >>>>>> Now, we have two kinds of IO: the one "generic" to Beam, the one
> >>>
> >>> "local"
> >>>>>>
> >>>>>> to the runners.
> >>>>>>
> >>>>>> For example, let's take Kafka: we have the KafkaIO (in IO), and for
> >>>>>> instance, we have the spark-streaming kafka connector (in Spark
> >>>
> >>> Runner).
> >>>>>>
> >>>>>>
> >>>>>> Right now, we have two approaches for the user:
> >>>>>> 1. In the pipeline, we use KafkaIO from Beam: it's the preferred
> >>>>>> approach for sure. However, the user may want to use the runner
> >>>
> >>> specific
> >>>>>>
> >>>>>> IO for two reasons:
> >>>>>> * Beam doesn't provide the IO yet (for instance, spark
> >>>>>> cassandra
> >>>>>> connector is available whereas we don't have yet any CassandraIO
> (I'm
> >>>>>> working on it anyway ;))
> >>>>>> * The runner native IO is optimized or contain more features
> >>>
> >>> that the
> >>>>>>
> >>>>>> Beam native IO
> >>>>>> 2. So, for the previous reasons, the user could want to use the
> native
> >>>>>> runner IO. The drawback of this approach is that the pipeline will
> be
> >>>>>> tight to a specific runner, which is completely against the Beam
> >>>
> >>> design.
> >>>>>>
> >>>>>>
> >>>>>> I wonder if it wouldn't make sense to add flag on the IO API (and
> >>>>>> related on Runner API) like .useNative().
> >>>>>>
> >>>>>> For instance, the user would be able to do:
> >>>>>>
> >>>>>>
> >>>
> >>>
> pipeline.apply(KafkaIO.read().withBootstrapServers("...").withTopics("...").useNative(true);
> >>>>>>
> >>>>>>
> >>>>>> then, if the runner has a "native" IO, it will use it, else, if
> >>>>>> useNative(false) (the default), it won't use any runner native IO.
> >>>>>>
> >>>>>> The point there is for the configuration: assuming the Beam IO and
> the
> >>>>>> runner IO can differ, it means that the "Beam IO" would have to
> >>>
> >>> populate
> >>>>>>
> >>>>>> all runner specific IO configuration.
> >>>>>>
> >>>>>> Of course, it's always possible to use a PTransform to wrap the
> runner
> >>>>>> native IO, but we are back on the same concern: the pipeline will be
> >>>>>> couple to a specific runner.
> >>>>>>
> >>>>>> The purpose of the useNative() flag is to "automatically" inform the
> >>>>>> runner to use a specific IO if it has one: the pipeline stays
> >>>>>> decoupled
> >>>>>> from the runners.
> >>>>>>
> >>>>>> Thoughts ?
> >>>>>>
> >>>>>> Thanks
> >>>>>> Regards
> >>>>>> JB
> >>>>>>
> >>>>>
> >>>>> --
> >>>>> Jean-Baptiste Onofré
> >>>>> jbonofre@apache.org
> >>>>> http://blog.nanthrax.net
> >>>>> Talend - http://www.talend.com
> >>>>>
> >>>>>
> >>>>>
> >>>
> >>> --
> >>> Jean-Baptiste Onofré
> >>> jbonofre@apache.org
> >>> http://blog.nanthrax.net
> >>> Talend - http://www.talend.com
> >>>
> >>
> >
> > --
> > Jean-Baptiste Onofré
> > jbonofre@apache.org
> > http://blog.nanthrax.net
> > Talend - http://www.talend.com
>
Re: [DISCUSS] Beam IO &runners native IO
Posted by Maximilian Michels <mx...@apache.org>.
@Aljoscha I didn't know that Kafka always stores Key/Value but I see
that we also have support for setting Kafka keys in Flink.
@JB I get your point that a sink is simply a DoFn, but a ParDo is not
a good match for a sink. A Sink doesn't produce a PCollection but
represents the end of a pipeline. Like an UnboundedSource, an
UnboundedSink has also special needs, i.e. it needs to provide a
checkpointing mechanism. I think we need something along the lines of
the existing Write transform for batch.
On Fri, Apr 29, 2016 at 12:27 PM, Jean-Baptiste Onofré <jb...@nanthrax.net> wrote:
> Hi,
>
> KafkaIO uses KafkaRecord which is basically key,value + some metadata
> (topic, partition, offset).
>
> Can you describe the behavior of an UnboundedSink ?
>
> UnboundedSource is obvious: it's still consuming data creating PCollection
> sent into the pipeline.
>
> But UnboundedSink ? Do you mean that the UnboundedSink will write each
> record in the PCollection ? When does it stop ?
>
> Regards
> JB
>
>
> On 04/29/2016 12:07 PM, Aljoscha Krettek wrote:
>>
>> Hi,
>> I think the fact that KafkaIO has a <key, value> model comes from Kafka
>> having a <key, value> model. I imagine most sources will emit the type of
>> values appropriate for them.
>>
>> I agree with Max that the lack of an UnboundedSink seems strange. Do we
>> have any "sinks" implemented as a ParDo already?
>>
>> Cheers,
>> Aljoscha
>>
>> On Fri, 29 Apr 2016 at 11:22 Jean-Baptiste Onofré <jb...@nanthrax.net> wrote:
>>
>>> Hi Max,
>>>
>>> Your four points are valid and we already discussed about that.
>>>
>>> 1. +1, the runner API should bring utils around that
>>> 2. UnboundedSink has been discussed (I don't see strong use case for
>>> now, as it takes a PCollection).
>>> 3. +1, Dan talked about improving the hierarchy.
>>> 4. +1, I'm working on new IO (JMS, MQTT, JDBC, Cassandra, Camel, ...).
>>>
>>> I would add:
>>>
>>> 5. Add a page on the website listing the IO, their usage and
>>> configuration. Something like we have in Camel:
>>> http://camel.apache.org/components.html
>>> 6. Refactore the FileIO to avoid usage of IOChannelFactory and use a
>>> filesystem plugin (file, hdfs, s3, aws, etc).
>>>
>>> Dan planned to create "util" to deal with watermark and timestamps.
>>>
>>> Regards
>>> JB
>>>
>>> On 04/29/2016 11:11 AM, Maximilian Michels wrote:
>>>>
>>>> @Amir: This is the Developer mailing list. Please post your questions
>>>> regarding Beam on the user mailing list.
>>>>
>>>> +1 for portability in general. However, I see some crucial TODOs coming
>>>
>>> up:
>>>>
>>>>
>>>> 1) Improving the integration of Runners with the Beam sink/source API
>>>> 2) Providing interfaces to implement new connectors (i.e. still no
>>>> existing UnboundedSink)
>>>> 3) Extending existing interfaces to ease implementation of connectors
>>>> and provide a uniform API (i.e. on top of UnboundedSource)
>>>> 4) Working on a more complete set of connectors in Beam
>>>>
>>>> Looking at the KafkaIO implementation, I wonder shouldn't we extract
>>>> the custom Watermark and Timestamp function into an extra interface?
>>>> All connectors are going to have methods these methods. It would be
>>>> nice to have a uniform API among the connectors.
>>>>
>>>> Further, the KafkaIO enforces a <key, value> data model which AFAIK is
>>>> not enforced by the Beam model. I don't know the details for this
>>>> design decision but I would like this to be communicated before it is
>>>> merged into the master. Otherwise, it will be harder to achieve
>>>> portability among the Runners. In Flink and Spark we are already
>>>> experienced with all kinds of connectors and user's needs. It would be
>>>> nice to feed that back in the course of adding new connectors to the
>>>> Beam API.
>>>>
>>>> I would expect an active discussion on the Dev mailing list before any
>>>> new connector API gets merged. Furthermore, let us provide better
>>>> interfaces for connector needs. Finally, let us introduce unbounded
>>>> sinks :)
>>>>
>>>> On Fri, Apr 29, 2016 at 7:54 AM, amir bahmanyari
>>>> <am...@yahoo.com.invalid> wrote:
>>>>>
>>>>> This may help trace it:Exception in thread "main"
>>>
>>> java.lang.IllegalStateException: no evaluator registered for
>>> Read(UnboundedKafkaSource) at
>>>
>>> org.apache.beam.sdk.runners.DirectPipelineRunner$Evaluator.visitTransform(DirectPipelineRunner.java:898)
>>> at
>>>
>>> org.apache.beam.sdk.runners.TransformTreeNode.visit(TransformTreeNode.java:221)
>>> at
>>>
>>> org.apache.beam.sdk.runners.TransformTreeNode.visit(TransformTreeNode.java:217)
>>> at
>>>
>>> org.apache.beam.sdk.runners.TransformTreeNode.visit(TransformTreeNode.java:217)
>>> at
>>>
>>> org.apache.beam.sdk.runners.TransformHierarchy.visit(TransformHierarchy.java:104)
>>> at org.apache.beam.sdk.Pipeline.traverseTopologically(Pipeline.java:261)
>>> at
>>>
>>> org.apache.beam.sdk.runners.DirectPipelineRunner$Evaluator.run(DirectPipelineRunner.java:860)
>>> at
>>>
>>> org.apache.beam.sdk.runners.DirectPipelineRunner.run(DirectPipelineRunner.java:572)
>>> at
>>>
>>> org.apache.beam.sdk.runners.DirectPipelineRunner.run(DirectPipelineRunner.java:106)
>>> at org.apache.beam.sdk.Pipeline.run(Pipeline.java:182) at benchmark.fli
>>> n
>>> kspark.flink.ReadFromKafka2.main(ReadFromKafka2.java:286)
>>>>>
>>>>>
>>>>> From: Jean-Baptiste Onofré <jb...@nanthrax.net>
>>>>> To: dev@beam.incubator.apache.org
>>>>> Sent: Thursday, April 28, 2016 10:08 PM
>>>>> Subject: Re: [DISCUSS] Beam IO &runners native IO
>>>>>
>>>>> I gonna take a look. The DirectPipelineRunner didn't support the
>>>>> unbounded collection (it has been fixed last night AFAIR). It could be
>>>>> related.
>>>>>
>>>>> Regards
>>>>> JB
>>>>>
>>>>> On 04/29/2016 07:00 AM, amir bahmanyari wrote:
>>>>>>
>>>>>> Hi JB,I used the sample KafkaIO usage
>>>
>>>
>>> below.p.apply(KafkaIO.read().withBootstrapServers("kafkahost:9092").withTopics(topics));
>>>>>>
>>>>>> p.run();
>>>>>>
>>>>>> It threw the following at p.run():Exception in thread "main"
>>>
>>> java.lang.IllegalStateException: no evaluator registered for
>>> Read(UnboundedKafkaSource) at
>>>
>>> org.apache.beam.sdk.runners.DirectPipelineRunner$Evaluator.visitTransform(DirectPipelineRunner.java:898)
>>> I am sure I am missing something.Would be great if I could see a sample
>>> code.I appreciate it sir.Cheers
>>>>>>
>>>>>>
>>>>>> From: Jean-Baptiste Onofré <jb...@nanthrax.net>
>>>>>> To: dev@beam.incubator.apache.org
>>>>>> Sent: Thursday, April 28, 2016 5:30 AM
>>>>>> Subject: [DISCUSS] Beam IO &runners native IO
>>>>>>
>>>>>> Hi all,
>>>>>>
>>>>>> regarding the recent threads on the mailing list, I would like to
>>>>>> start
>>>>>> a format discussion around the IO.
>>>>>> As we can expect the first contributions on this area (I already have
>>>>>> some work in progress around this ;)), I think it's a fair discussion
>>>
>>> to
>>>>>>
>>>>>> have.
>>>>>>
>>>>>> Now, we have two kinds of IO: the one "generic" to Beam, the one
>>>
>>> "local"
>>>>>>
>>>>>> to the runners.
>>>>>>
>>>>>> For example, let's take Kafka: we have the KafkaIO (in IO), and for
>>>>>> instance, we have the spark-streaming kafka connector (in Spark
>>>
>>> Runner).
>>>>>>
>>>>>>
>>>>>> Right now, we have two approaches for the user:
>>>>>> 1. In the pipeline, we use KafkaIO from Beam: it's the preferred
>>>>>> approach for sure. However, the user may want to use the runner
>>>
>>> specific
>>>>>>
>>>>>> IO for two reasons:
>>>>>> * Beam doesn't provide the IO yet (for instance, spark
>>>>>> cassandra
>>>>>> connector is available whereas we don't have yet any CassandraIO (I'm
>>>>>> working on it anyway ;))
>>>>>> * The runner native IO is optimized or contain more features
>>>
>>> that the
>>>>>>
>>>>>> Beam native IO
>>>>>> 2. So, for the previous reasons, the user could want to use the native
>>>>>> runner IO. The drawback of this approach is that the pipeline will be
>>>>>> tight to a specific runner, which is completely against the Beam
>>>
>>> design.
>>>>>>
>>>>>>
>>>>>> I wonder if it wouldn't make sense to add flag on the IO API (and
>>>>>> related on Runner API) like .useNative().
>>>>>>
>>>>>> For instance, the user would be able to do:
>>>>>>
>>>>>>
>>>
>>> pipeline.apply(KafkaIO.read().withBootstrapServers("...").withTopics("...").useNative(true);
>>>>>>
>>>>>>
>>>>>> then, if the runner has a "native" IO, it will use it, else, if
>>>>>> useNative(false) (the default), it won't use any runner native IO.
>>>>>>
>>>>>> The point there is for the configuration: assuming the Beam IO and the
>>>>>> runner IO can differ, it means that the "Beam IO" would have to
>>>
>>> populate
>>>>>>
>>>>>> all runner specific IO configuration.
>>>>>>
>>>>>> Of course, it's always possible to use a PTransform to wrap the runner
>>>>>> native IO, but we are back on the same concern: the pipeline will be
>>>>>> couple to a specific runner.
>>>>>>
>>>>>> The purpose of the useNative() flag is to "automatically" inform the
>>>>>> runner to use a specific IO if it has one: the pipeline stays
>>>>>> decoupled
>>>>>> from the runners.
>>>>>>
>>>>>> Thoughts ?
>>>>>>
>>>>>> Thanks
>>>>>> Regards
>>>>>> JB
>>>>>>
>>>>>
>>>>> --
>>>>> Jean-Baptiste Onofré
>>>>> jbonofre@apache.org
>>>>> http://blog.nanthrax.net
>>>>> Talend - http://www.talend.com
>>>>>
>>>>>
>>>>>
>>>
>>> --
>>> Jean-Baptiste Onofré
>>> jbonofre@apache.org
>>> http://blog.nanthrax.net
>>> Talend - http://www.talend.com
>>>
>>
>
> --
> Jean-Baptiste Onofré
> jbonofre@apache.org
> http://blog.nanthrax.net
> Talend - http://www.talend.com
Re: [DISCUSS] Beam IO &runners native IO
Posted by Jean-Baptiste Onofré <jb...@nanthrax.net>.
Hi,
KafkaIO uses KafkaRecord which is basically key,value + some metadata
(topic, partition, offset).
Can you describe the behavior of an UnboundedSink ?
UnboundedSource is obvious: it's still consuming data creating
PCollection sent into the pipeline.
But UnboundedSink ? Do you mean that the UnboundedSink will write each
record in the PCollection ? When does it stop ?
Regards
JB
On 04/29/2016 12:07 PM, Aljoscha Krettek wrote:
> Hi,
> I think the fact that KafkaIO has a <key, value> model comes from Kafka
> having a <key, value> model. I imagine most sources will emit the type of
> values appropriate for them.
>
> I agree with Max that the lack of an UnboundedSink seems strange. Do we
> have any "sinks" implemented as a ParDo already?
>
> Cheers,
> Aljoscha
>
> On Fri, 29 Apr 2016 at 11:22 Jean-Baptiste Onofr� <jb...@nanthrax.net> wrote:
>
>> Hi Max,
>>
>> Your four points are valid and we already discussed about that.
>>
>> 1. +1, the runner API should bring utils around that
>> 2. UnboundedSink has been discussed (I don't see strong use case for
>> now, as it takes a PCollection).
>> 3. +1, Dan talked about improving the hierarchy.
>> 4. +1, I'm working on new IO (JMS, MQTT, JDBC, Cassandra, Camel, ...).
>>
>> I would add:
>>
>> 5. Add a page on the website listing the IO, their usage and
>> configuration. Something like we have in Camel:
>> http://camel.apache.org/components.html
>> 6. Refactore the FileIO to avoid usage of IOChannelFactory and use a
>> filesystem plugin (file, hdfs, s3, aws, etc).
>>
>> Dan planned to create "util" to deal with watermark and timestamps.
>>
>> Regards
>> JB
>>
>> On 04/29/2016 11:11 AM, Maximilian Michels wrote:
>>> @Amir: This is the Developer mailing list. Please post your questions
>>> regarding Beam on the user mailing list.
>>>
>>> +1 for portability in general. However, I see some crucial TODOs coming
>> up:
>>>
>>> 1) Improving the integration of Runners with the Beam sink/source API
>>> 2) Providing interfaces to implement new connectors (i.e. still no
>>> existing UnboundedSink)
>>> 3) Extending existing interfaces to ease implementation of connectors
>>> and provide a uniform API (i.e. on top of UnboundedSource)
>>> 4) Working on a more complete set of connectors in Beam
>>>
>>> Looking at the KafkaIO implementation, I wonder shouldn't we extract
>>> the custom Watermark and Timestamp function into an extra interface?
>>> All connectors are going to have methods these methods. It would be
>>> nice to have a uniform API among the connectors.
>>>
>>> Further, the KafkaIO enforces a <key, value> data model which AFAIK is
>>> not enforced by the Beam model. I don't know the details for this
>>> design decision but I would like this to be communicated before it is
>>> merged into the master. Otherwise, it will be harder to achieve
>>> portability among the Runners. In Flink and Spark we are already
>>> experienced with all kinds of connectors and user's needs. It would be
>>> nice to feed that back in the course of adding new connectors to the
>>> Beam API.
>>>
>>> I would expect an active discussion on the Dev mailing list before any
>>> new connector API gets merged. Furthermore, let us provide better
>>> interfaces for connector needs. Finally, let us introduce unbounded
>>> sinks :)
>>>
>>> On Fri, Apr 29, 2016 at 7:54 AM, amir bahmanyari
>>> <am...@yahoo.com.invalid> wrote:
>>>> This may help trace it:Exception in thread "main"
>> java.lang.IllegalStateException: no evaluator registered for
>> Read(UnboundedKafkaSource) at
>> org.apache.beam.sdk.runners.DirectPipelineRunner$Evaluator.visitTransform(DirectPipelineRunner.java:898)
>> at
>> org.apache.beam.sdk.runners.TransformTreeNode.visit(TransformTreeNode.java:221)
>> at
>> org.apache.beam.sdk.runners.TransformTreeNode.visit(TransformTreeNode.java:217)
>> at
>> org.apache.beam.sdk.runners.TransformTreeNode.visit(TransformTreeNode.java:217)
>> at
>> org.apache.beam.sdk.runners.TransformHierarchy.visit(TransformHierarchy.java:104)
>> at org.apache.beam.sdk.Pipeline.traverseTopologically(Pipeline.java:261) at
>> org.apache.beam.sdk.runners.DirectPipelineRunner$Evaluator.run(DirectPipelineRunner.java:860)
>> at
>> org.apache.beam.sdk.runners.DirectPipelineRunner.run(DirectPipelineRunner.java:572)
>> at
>> org.apache.beam.sdk.runners.DirectPipelineRunner.run(DirectPipelineRunner.java:106)
>> at org.apache.beam.sdk.Pipeline.run(Pipeline.java:182) at benchmark.fli
>> n
>> kspark.flink.ReadFromKafka2.main(ReadFromKafka2.java:286)
>>>>
>>>> From: Jean-Baptiste Onofr� <jb...@nanthrax.net>
>>>> To: dev@beam.incubator.apache.org
>>>> Sent: Thursday, April 28, 2016 10:08 PM
>>>> Subject: Re: [DISCUSS] Beam IO &runners native IO
>>>>
>>>> I gonna take a look. The DirectPipelineRunner didn't support the
>>>> unbounded collection (it has been fixed last night AFAIR). It could be
>>>> related.
>>>>
>>>> Regards
>>>> JB
>>>>
>>>> On 04/29/2016 07:00 AM, amir bahmanyari wrote:
>>>>> Hi JB,I used the sample KafkaIO usage
>> below.p.apply(KafkaIO.read().withBootstrapServers("kafkahost:9092").withTopics(topics));
>>>>> p.run();
>>>>>
>>>>> It threw the following at p.run():Exception in thread "main"
>> java.lang.IllegalStateException: no evaluator registered for
>> Read(UnboundedKafkaSource) at
>> org.apache.beam.sdk.runners.DirectPipelineRunner$Evaluator.visitTransform(DirectPipelineRunner.java:898)
>> I am sure I am missing something.Would be great if I could see a sample
>> code.I appreciate it sir.Cheers
>>>>>
>>>>> From: Jean-Baptiste Onofr� <jb...@nanthrax.net>
>>>>> To: dev@beam.incubator.apache.org
>>>>> Sent: Thursday, April 28, 2016 5:30 AM
>>>>> Subject: [DISCUSS] Beam IO &runners native IO
>>>>>
>>>>> Hi all,
>>>>>
>>>>> regarding the recent threads on the mailing list, I would like to start
>>>>> a format discussion around the IO.
>>>>> As we can expect the first contributions on this area (I already have
>>>>> some work in progress around this ;)), I think it's a fair discussion
>> to
>>>>> have.
>>>>>
>>>>> Now, we have two kinds of IO: the one "generic" to Beam, the one
>> "local"
>>>>> to the runners.
>>>>>
>>>>> For example, let's take Kafka: we have the KafkaIO (in IO), and for
>>>>> instance, we have the spark-streaming kafka connector (in Spark
>> Runner).
>>>>>
>>>>> Right now, we have two approaches for the user:
>>>>> 1. In the pipeline, we use KafkaIO from Beam: it's the preferred
>>>>> approach for sure. However, the user may want to use the runner
>> specific
>>>>> IO for two reasons:
>>>>> * Beam doesn't provide the IO yet (for instance, spark cassandra
>>>>> connector is available whereas we don't have yet any CassandraIO (I'm
>>>>> working on it anyway ;))
>>>>> * The runner native IO is optimized or contain more features
>> that the
>>>>> Beam native IO
>>>>> 2. So, for the previous reasons, the user could want to use the native
>>>>> runner IO. The drawback of this approach is that the pipeline will be
>>>>> tight to a specific runner, which is completely against the Beam
>> design.
>>>>>
>>>>> I wonder if it wouldn't make sense to add flag on the IO API (and
>>>>> related on Runner API) like .useNative().
>>>>>
>>>>> For instance, the user would be able to do:
>>>>>
>>>>>
>> pipeline.apply(KafkaIO.read().withBootstrapServers("...").withTopics("...").useNative(true);
>>>>>
>>>>> then, if the runner has a "native" IO, it will use it, else, if
>>>>> useNative(false) (the default), it won't use any runner native IO.
>>>>>
>>>>> The point there is for the configuration: assuming the Beam IO and the
>>>>> runner IO can differ, it means that the "Beam IO" would have to
>> populate
>>>>> all runner specific IO configuration.
>>>>>
>>>>> Of course, it's always possible to use a PTransform to wrap the runner
>>>>> native IO, but we are back on the same concern: the pipeline will be
>>>>> couple to a specific runner.
>>>>>
>>>>> The purpose of the useNative() flag is to "automatically" inform the
>>>>> runner to use a specific IO if it has one: the pipeline stays decoupled
>>>>> from the runners.
>>>>>
>>>>> Thoughts ?
>>>>>
>>>>> Thanks
>>>>> Regards
>>>>> JB
>>>>>
>>>>
>>>> --
>>>> Jean-Baptiste Onofr�
>>>> jbonofre@apache.org
>>>> http://blog.nanthrax.net
>>>> Talend - http://www.talend.com
>>>>
>>>>
>>>>
>>
>> --
>> Jean-Baptiste Onofr�
>> jbonofre@apache.org
>> http://blog.nanthrax.net
>> Talend - http://www.talend.com
>>
>
--
Jean-Baptiste Onofr�
jbonofre@apache.org
http://blog.nanthrax.net
Talend - http://www.talend.com
Re: [DISCUSS] Beam IO &runners native IO
Posted by Aljoscha Krettek <al...@apache.org>.
Hi,
I think the fact that KafkaIO has a <key, value> model comes from Kafka
having a <key, value> model. I imagine most sources will emit the type of
values appropriate for them.
I agree with Max that the lack of an UnboundedSink seems strange. Do we
have any "sinks" implemented as a ParDo already?
Cheers,
Aljoscha
On Fri, 29 Apr 2016 at 11:22 Jean-Baptiste Onofré <jb...@nanthrax.net> wrote:
> Hi Max,
>
> Your four points are valid and we already discussed about that.
>
> 1. +1, the runner API should bring utils around that
> 2. UnboundedSink has been discussed (I don't see strong use case for
> now, as it takes a PCollection).
> 3. +1, Dan talked about improving the hierarchy.
> 4. +1, I'm working on new IO (JMS, MQTT, JDBC, Cassandra, Camel, ...).
>
> I would add:
>
> 5. Add a page on the website listing the IO, their usage and
> configuration. Something like we have in Camel:
> http://camel.apache.org/components.html
> 6. Refactore the FileIO to avoid usage of IOChannelFactory and use a
> filesystem plugin (file, hdfs, s3, aws, etc).
>
> Dan planned to create "util" to deal with watermark and timestamps.
>
> Regards
> JB
>
> On 04/29/2016 11:11 AM, Maximilian Michels wrote:
> > @Amir: This is the Developer mailing list. Please post your questions
> > regarding Beam on the user mailing list.
> >
> > +1 for portability in general. However, I see some crucial TODOs coming
> up:
> >
> > 1) Improving the integration of Runners with the Beam sink/source API
> > 2) Providing interfaces to implement new connectors (i.e. still no
> > existing UnboundedSink)
> > 3) Extending existing interfaces to ease implementation of connectors
> > and provide a uniform API (i.e. on top of UnboundedSource)
> > 4) Working on a more complete set of connectors in Beam
> >
> > Looking at the KafkaIO implementation, I wonder shouldn't we extract
> > the custom Watermark and Timestamp function into an extra interface?
> > All connectors are going to have methods these methods. It would be
> > nice to have a uniform API among the connectors.
> >
> > Further, the KafkaIO enforces a <key, value> data model which AFAIK is
> > not enforced by the Beam model. I don't know the details for this
> > design decision but I would like this to be communicated before it is
> > merged into the master. Otherwise, it will be harder to achieve
> > portability among the Runners. In Flink and Spark we are already
> > experienced with all kinds of connectors and user's needs. It would be
> > nice to feed that back in the course of adding new connectors to the
> > Beam API.
> >
> > I would expect an active discussion on the Dev mailing list before any
> > new connector API gets merged. Furthermore, let us provide better
> > interfaces for connector needs. Finally, let us introduce unbounded
> > sinks :)
> >
> > On Fri, Apr 29, 2016 at 7:54 AM, amir bahmanyari
> > <am...@yahoo.com.invalid> wrote:
> >> This may help trace it:Exception in thread "main"
> java.lang.IllegalStateException: no evaluator registered for
> Read(UnboundedKafkaSource) at
> org.apache.beam.sdk.runners.DirectPipelineRunner$Evaluator.visitTransform(DirectPipelineRunner.java:898)
> at
> org.apache.beam.sdk.runners.TransformTreeNode.visit(TransformTreeNode.java:221)
> at
> org.apache.beam.sdk.runners.TransformTreeNode.visit(TransformTreeNode.java:217)
> at
> org.apache.beam.sdk.runners.TransformTreeNode.visit(TransformTreeNode.java:217)
> at
> org.apache.beam.sdk.runners.TransformHierarchy.visit(TransformHierarchy.java:104)
> at org.apache.beam.sdk.Pipeline.traverseTopologically(Pipeline.java:261) at
> org.apache.beam.sdk.runners.DirectPipelineRunner$Evaluator.run(DirectPipelineRunner.java:860)
> at
> org.apache.beam.sdk.runners.DirectPipelineRunner.run(DirectPipelineRunner.java:572)
> at
> org.apache.beam.sdk.runners.DirectPipelineRunner.run(DirectPipelineRunner.java:106)
> at org.apache.beam.sdk.Pipeline.run(Pipeline.java:182) at benchmark.fli
> n
> kspark.flink.ReadFromKafka2.main(ReadFromKafka2.java:286)
> >>
> >> From: Jean-Baptiste Onofré <jb...@nanthrax.net>
> >> To: dev@beam.incubator.apache.org
> >> Sent: Thursday, April 28, 2016 10:08 PM
> >> Subject: Re: [DISCUSS] Beam IO &runners native IO
> >>
> >> I gonna take a look. The DirectPipelineRunner didn't support the
> >> unbounded collection (it has been fixed last night AFAIR). It could be
> >> related.
> >>
> >> Regards
> >> JB
> >>
> >> On 04/29/2016 07:00 AM, amir bahmanyari wrote:
> >>> Hi JB,I used the sample KafkaIO usage
> below.p.apply(KafkaIO.read().withBootstrapServers("kafkahost:9092").withTopics(topics));
> >>> p.run();
> >>>
> >>> It threw the following at p.run():Exception in thread "main"
> java.lang.IllegalStateException: no evaluator registered for
> Read(UnboundedKafkaSource) at
> org.apache.beam.sdk.runners.DirectPipelineRunner$Evaluator.visitTransform(DirectPipelineRunner.java:898)
> I am sure I am missing something.Would be great if I could see a sample
> code.I appreciate it sir.Cheers
> >>>
> >>> From: Jean-Baptiste Onofré <jb...@nanthrax.net>
> >>> To: dev@beam.incubator.apache.org
> >>> Sent: Thursday, April 28, 2016 5:30 AM
> >>> Subject: [DISCUSS] Beam IO &runners native IO
> >>>
> >>> Hi all,
> >>>
> >>> regarding the recent threads on the mailing list, I would like to start
> >>> a format discussion around the IO.
> >>> As we can expect the first contributions on this area (I already have
> >>> some work in progress around this ;)), I think it's a fair discussion
> to
> >>> have.
> >>>
> >>> Now, we have two kinds of IO: the one "generic" to Beam, the one
> "local"
> >>> to the runners.
> >>>
> >>> For example, let's take Kafka: we have the KafkaIO (in IO), and for
> >>> instance, we have the spark-streaming kafka connector (in Spark
> Runner).
> >>>
> >>> Right now, we have two approaches for the user:
> >>> 1. In the pipeline, we use KafkaIO from Beam: it's the preferred
> >>> approach for sure. However, the user may want to use the runner
> specific
> >>> IO for two reasons:
> >>> * Beam doesn't provide the IO yet (for instance, spark cassandra
> >>> connector is available whereas we don't have yet any CassandraIO (I'm
> >>> working on it anyway ;))
> >>> * The runner native IO is optimized or contain more features
> that the
> >>> Beam native IO
> >>> 2. So, for the previous reasons, the user could want to use the native
> >>> runner IO. The drawback of this approach is that the pipeline will be
> >>> tight to a specific runner, which is completely against the Beam
> design.
> >>>
> >>> I wonder if it wouldn't make sense to add flag on the IO API (and
> >>> related on Runner API) like .useNative().
> >>>
> >>> For instance, the user would be able to do:
> >>>
> >>>
> pipeline.apply(KafkaIO.read().withBootstrapServers("...").withTopics("...").useNative(true);
> >>>
> >>> then, if the runner has a "native" IO, it will use it, else, if
> >>> useNative(false) (the default), it won't use any runner native IO.
> >>>
> >>> The point there is for the configuration: assuming the Beam IO and the
> >>> runner IO can differ, it means that the "Beam IO" would have to
> populate
> >>> all runner specific IO configuration.
> >>>
> >>> Of course, it's always possible to use a PTransform to wrap the runner
> >>> native IO, but we are back on the same concern: the pipeline will be
> >>> couple to a specific runner.
> >>>
> >>> The purpose of the useNative() flag is to "automatically" inform the
> >>> runner to use a specific IO if it has one: the pipeline stays decoupled
> >>> from the runners.
> >>>
> >>> Thoughts ?
> >>>
> >>> Thanks
> >>> Regards
> >>> JB
> >>>
> >>
> >> --
> >> Jean-Baptiste Onofré
> >> jbonofre@apache.org
> >> http://blog.nanthrax.net
> >> Talend - http://www.talend.com
> >>
> >>
> >>
>
> --
> Jean-Baptiste Onofré
> jbonofre@apache.org
> http://blog.nanthrax.net
> Talend - http://www.talend.com
>
Re: [DISCUSS] Beam IO &runners native IO
Posted by Jean-Baptiste Onofré <jb...@nanthrax.net>.
Hi Max,
Your four points are valid and we already discussed about that.
1. +1, the runner API should bring utils around that
2. UnboundedSink has been discussed (I don't see strong use case for
now, as it takes a PCollection).
3. +1, Dan talked about improving the hierarchy.
4. +1, I'm working on new IO (JMS, MQTT, JDBC, Cassandra, Camel, ...).
I would add:
5. Add a page on the website listing the IO, their usage and
configuration. Something like we have in Camel:
http://camel.apache.org/components.html
6. Refactore the FileIO to avoid usage of IOChannelFactory and use a
filesystem plugin (file, hdfs, s3, aws, etc).
Dan planned to create "util" to deal with watermark and timestamps.
Regards
JB
On 04/29/2016 11:11 AM, Maximilian Michels wrote:
> @Amir: This is the Developer mailing list. Please post your questions
> regarding Beam on the user mailing list.
>
> +1 for portability in general. However, I see some crucial TODOs coming up:
>
> 1) Improving the integration of Runners with the Beam sink/source API
> 2) Providing interfaces to implement new connectors (i.e. still no
> existing UnboundedSink)
> 3) Extending existing interfaces to ease implementation of connectors
> and provide a uniform API (i.e. on top of UnboundedSource)
> 4) Working on a more complete set of connectors in Beam
>
> Looking at the KafkaIO implementation, I wonder shouldn't we extract
> the custom Watermark and Timestamp function into an extra interface?
> All connectors are going to have methods these methods. It would be
> nice to have a uniform API among the connectors.
>
> Further, the KafkaIO enforces a <key, value> data model which AFAIK is
> not enforced by the Beam model. I don't know the details for this
> design decision but I would like this to be communicated before it is
> merged into the master. Otherwise, it will be harder to achieve
> portability among the Runners. In Flink and Spark we are already
> experienced with all kinds of connectors and user's needs. It would be
> nice to feed that back in the course of adding new connectors to the
> Beam API.
>
> I would expect an active discussion on the Dev mailing list before any
> new connector API gets merged. Furthermore, let us provide better
> interfaces for connector needs. Finally, let us introduce unbounded
> sinks :)
>
> On Fri, Apr 29, 2016 at 7:54 AM, amir bahmanyari
> <am...@yahoo.com.invalid> wrote:
>> This may help trace it:Exception in thread "main" java.lang.IllegalStateException: no evaluator registered for Read(UnboundedKafkaSource) at org.apache.beam.sdk.runners.DirectPipelineRunner$Evaluator.visitTransform(DirectPipelineRunner.java:898) at org.apache.beam.sdk.runners.TransformTreeNode.visit(TransformTreeNode.java:221) at org.apache.beam.sdk.runners.TransformTreeNode.visit(TransformTreeNode.java:217) at org.apache.beam.sdk.runners.TransformTreeNode.visit(TransformTreeNode.java:217) at org.apache.beam.sdk.runners.TransformHierarchy.visit(TransformHierarchy.java:104) at org.apache.beam.sdk.Pipeline.traverseTopologically(Pipeline.java:261) at org.apache.beam.sdk.runners.DirectPipelineRunner$Evaluator.run(DirectPipelineRunner.java:860) at org.apache.beam.sdk.runners.DirectPipelineRunner.run(DirectPipelineRunner.java:572) at org.apache.beam.sdk.runners.DirectPipelineRunner.run(DirectPipelineRunner.java:106) at org.apache.beam.sdk.Pipeline.run(Pipeline.java:182) at benchmark.fli
n
kspark.flink.ReadFromKafka2.main(ReadFromKafka2.java:286)
>>
>> From: Jean-Baptiste Onofr� <jb...@nanthrax.net>
>> To: dev@beam.incubator.apache.org
>> Sent: Thursday, April 28, 2016 10:08 PM
>> Subject: Re: [DISCUSS] Beam IO &runners native IO
>>
>> I gonna take a look. The DirectPipelineRunner didn't support the
>> unbounded collection (it has been fixed last night AFAIR). It could be
>> related.
>>
>> Regards
>> JB
>>
>> On 04/29/2016 07:00 AM, amir bahmanyari wrote:
>>> Hi JB,I used the sample KafkaIO usage below.p.apply(KafkaIO.read().withBootstrapServers("kafkahost:9092").withTopics(topics));
>>> p.run();
>>>
>>> It threw the following at p.run():Exception in thread "main" java.lang.IllegalStateException: no evaluator registered for Read(UnboundedKafkaSource) at org.apache.beam.sdk.runners.DirectPipelineRunner$Evaluator.visitTransform(DirectPipelineRunner.java:898) I am sure I am missing something.Would be great if I could see a sample code.I appreciate it sir.Cheers
>>>
>>> From: Jean-Baptiste Onofr� <jb...@nanthrax.net>
>>> To: dev@beam.incubator.apache.org
>>> Sent: Thursday, April 28, 2016 5:30 AM
>>> Subject: [DISCUSS] Beam IO &runners native IO
>>>
>>> Hi all,
>>>
>>> regarding the recent threads on the mailing list, I would like to start
>>> a format discussion around the IO.
>>> As we can expect the first contributions on this area (I already have
>>> some work in progress around this ;)), I think it's a fair discussion to
>>> have.
>>>
>>> Now, we have two kinds of IO: the one "generic" to Beam, the one "local"
>>> to the runners.
>>>
>>> For example, let's take Kafka: we have the KafkaIO (in IO), and for
>>> instance, we have the spark-streaming kafka connector (in Spark Runner).
>>>
>>> Right now, we have two approaches for the user:
>>> 1. In the pipeline, we use KafkaIO from Beam: it's the preferred
>>> approach for sure. However, the user may want to use the runner specific
>>> IO for two reasons:
>>> * Beam doesn't provide the IO yet (for instance, spark cassandra
>>> connector is available whereas we don't have yet any CassandraIO (I'm
>>> working on it anyway ;))
>>> * The runner native IO is optimized or contain more features that the
>>> Beam native IO
>>> 2. So, for the previous reasons, the user could want to use the native
>>> runner IO. The drawback of this approach is that the pipeline will be
>>> tight to a specific runner, which is completely against the Beam design.
>>>
>>> I wonder if it wouldn't make sense to add flag on the IO API (and
>>> related on Runner API) like .useNative().
>>>
>>> For instance, the user would be able to do:
>>>
>>> pipeline.apply(KafkaIO.read().withBootstrapServers("...").withTopics("...").useNative(true);
>>>
>>> then, if the runner has a "native" IO, it will use it, else, if
>>> useNative(false) (the default), it won't use any runner native IO.
>>>
>>> The point there is for the configuration: assuming the Beam IO and the
>>> runner IO can differ, it means that the "Beam IO" would have to populate
>>> all runner specific IO configuration.
>>>
>>> Of course, it's always possible to use a PTransform to wrap the runner
>>> native IO, but we are back on the same concern: the pipeline will be
>>> couple to a specific runner.
>>>
>>> The purpose of the useNative() flag is to "automatically" inform the
>>> runner to use a specific IO if it has one: the pipeline stays decoupled
>>> from the runners.
>>>
>>> Thoughts ?
>>>
>>> Thanks
>>> Regards
>>> JB
>>>
>>
>> --
>> Jean-Baptiste Onofr�
>> jbonofre@apache.org
>> http://blog.nanthrax.net
>> Talend - http://www.talend.com
>>
>>
>>
--
Jean-Baptiste Onofr�
jbonofre@apache.org
http://blog.nanthrax.net
Talend - http://www.talend.com
Re: [DISCUSS] Beam IO &runners native IO
Posted by Maximilian Michels <mx...@apache.org>.
@Amir: This is the Developer mailing list. Please post your questions
regarding Beam on the user mailing list.
+1 for portability in general. However, I see some crucial TODOs coming up:
1) Improving the integration of Runners with the Beam sink/source API
2) Providing interfaces to implement new connectors (i.e. still no
existing UnboundedSink)
3) Extending existing interfaces to ease implementation of connectors
and provide a uniform API (i.e. on top of UnboundedSource)
4) Working on a more complete set of connectors in Beam
Looking at the KafkaIO implementation, I wonder shouldn't we extract
the custom Watermark and Timestamp function into an extra interface?
All connectors are going to have methods these methods. It would be
nice to have a uniform API among the connectors.
Further, the KafkaIO enforces a <key, value> data model which AFAIK is
not enforced by the Beam model. I don't know the details for this
design decision but I would like this to be communicated before it is
merged into the master. Otherwise, it will be harder to achieve
portability among the Runners. In Flink and Spark we are already
experienced with all kinds of connectors and user's needs. It would be
nice to feed that back in the course of adding new connectors to the
Beam API.
I would expect an active discussion on the Dev mailing list before any
new connector API gets merged. Furthermore, let us provide better
interfaces for connector needs. Finally, let us introduce unbounded
sinks :)
On Fri, Apr 29, 2016 at 7:54 AM, amir bahmanyari
<am...@yahoo.com.invalid> wrote:
> This may help trace it:Exception in thread "main" java.lang.IllegalStateException: no evaluator registered for Read(UnboundedKafkaSource) at org.apache.beam.sdk.runners.DirectPipelineRunner$Evaluator.visitTransform(DirectPipelineRunner.java:898) at org.apache.beam.sdk.runners.TransformTreeNode.visit(TransformTreeNode.java:221) at org.apache.beam.sdk.runners.TransformTreeNode.visit(TransformTreeNode.java:217) at org.apache.beam.sdk.runners.TransformTreeNode.visit(TransformTreeNode.java:217) at org.apache.beam.sdk.runners.TransformHierarchy.visit(TransformHierarchy.java:104) at org.apache.beam.sdk.Pipeline.traverseTopologically(Pipeline.java:261) at org.apache.beam.sdk.runners.DirectPipelineRunner$Evaluator.run(DirectPipelineRunner.java:860) at org.apache.beam.sdk.runners.DirectPipelineRunner.run(DirectPipelineRunner.java:572) at org.apache.beam.sdk.runners.DirectPipelineRunner.run(DirectPipelineRunner.java:106) at org.apache.beam.sdk.Pipeline.run(Pipeline.java:182) at benchmark.flinkspark.flink.ReadFromKafka2.main(ReadFromKafka2.java:286)
>
> From: Jean-Baptiste Onofré <jb...@nanthrax.net>
> To: dev@beam.incubator.apache.org
> Sent: Thursday, April 28, 2016 10:08 PM
> Subject: Re: [DISCUSS] Beam IO &runners native IO
>
> I gonna take a look. The DirectPipelineRunner didn't support the
> unbounded collection (it has been fixed last night AFAIR). It could be
> related.
>
> Regards
> JB
>
> On 04/29/2016 07:00 AM, amir bahmanyari wrote:
>> Hi JB,I used the sample KafkaIO usage below.p.apply(KafkaIO.read().withBootstrapServers("kafkahost:9092").withTopics(topics));
>> p.run();
>>
>> It threw the following at p.run():Exception in thread "main" java.lang.IllegalStateException: no evaluator registered for Read(UnboundedKafkaSource) at org.apache.beam.sdk.runners.DirectPipelineRunner$Evaluator.visitTransform(DirectPipelineRunner.java:898) I am sure I am missing something.Would be great if I could see a sample code.I appreciate it sir.Cheers
>>
>> From: Jean-Baptiste Onofré <jb...@nanthrax.net>
>> To: dev@beam.incubator.apache.org
>> Sent: Thursday, April 28, 2016 5:30 AM
>> Subject: [DISCUSS] Beam IO &runners native IO
>>
>> Hi all,
>>
>> regarding the recent threads on the mailing list, I would like to start
>> a format discussion around the IO.
>> As we can expect the first contributions on this area (I already have
>> some work in progress around this ;)), I think it's a fair discussion to
>> have.
>>
>> Now, we have two kinds of IO: the one "generic" to Beam, the one "local"
>> to the runners.
>>
>> For example, let's take Kafka: we have the KafkaIO (in IO), and for
>> instance, we have the spark-streaming kafka connector (in Spark Runner).
>>
>> Right now, we have two approaches for the user:
>> 1. In the pipeline, we use KafkaIO from Beam: it's the preferred
>> approach for sure. However, the user may want to use the runner specific
>> IO for two reasons:
>> * Beam doesn't provide the IO yet (for instance, spark cassandra
>> connector is available whereas we don't have yet any CassandraIO (I'm
>> working on it anyway ;))
>> * The runner native IO is optimized or contain more features that the
>> Beam native IO
>> 2. So, for the previous reasons, the user could want to use the native
>> runner IO. The drawback of this approach is that the pipeline will be
>> tight to a specific runner, which is completely against the Beam design.
>>
>> I wonder if it wouldn't make sense to add flag on the IO API (and
>> related on Runner API) like .useNative().
>>
>> For instance, the user would be able to do:
>>
>> pipeline.apply(KafkaIO.read().withBootstrapServers("...").withTopics("...").useNative(true);
>>
>> then, if the runner has a "native" IO, it will use it, else, if
>> useNative(false) (the default), it won't use any runner native IO.
>>
>> The point there is for the configuration: assuming the Beam IO and the
>> runner IO can differ, it means that the "Beam IO" would have to populate
>> all runner specific IO configuration.
>>
>> Of course, it's always possible to use a PTransform to wrap the runner
>> native IO, but we are back on the same concern: the pipeline will be
>> couple to a specific runner.
>>
>> The purpose of the useNative() flag is to "automatically" inform the
>> runner to use a specific IO if it has one: the pipeline stays decoupled
>> from the runners.
>>
>> Thoughts ?
>>
>> Thanks
>> Regards
>> JB
>>
>
> --
> Jean-Baptiste Onofré
> jbonofre@apache.org
> http://blog.nanthrax.net
> Talend - http://www.talend.com
>
>
>
Re: [DISCUSS] Beam IO &runners native IO
Posted by amir bahmanyari <am...@yahoo.com.INVALID>.
This may help trace it:Exception in thread "main" java.lang.IllegalStateException: no evaluator registered for Read(UnboundedKafkaSource) at org.apache.beam.sdk.runners.DirectPipelineRunner$Evaluator.visitTransform(DirectPipelineRunner.java:898) at org.apache.beam.sdk.runners.TransformTreeNode.visit(TransformTreeNode.java:221) at org.apache.beam.sdk.runners.TransformTreeNode.visit(TransformTreeNode.java:217) at org.apache.beam.sdk.runners.TransformTreeNode.visit(TransformTreeNode.java:217) at org.apache.beam.sdk.runners.TransformHierarchy.visit(TransformHierarchy.java:104) at org.apache.beam.sdk.Pipeline.traverseTopologically(Pipeline.java:261) at org.apache.beam.sdk.runners.DirectPipelineRunner$Evaluator.run(DirectPipelineRunner.java:860) at org.apache.beam.sdk.runners.DirectPipelineRunner.run(DirectPipelineRunner.java:572) at org.apache.beam.sdk.runners.DirectPipelineRunner.run(DirectPipelineRunner.java:106) at org.apache.beam.sdk.Pipeline.run(Pipeline.java:182) at benchmark.flinkspark.flink.ReadFromKafka2.main(ReadFromKafka2.java:286)
From: Jean-Baptiste Onofré <jb...@nanthrax.net>
To: dev@beam.incubator.apache.org
Sent: Thursday, April 28, 2016 10:08 PM
Subject: Re: [DISCUSS] Beam IO &runners native IO
I gonna take a look. The DirectPipelineRunner didn't support the
unbounded collection (it has been fixed last night AFAIR). It could be
related.
Regards
JB
On 04/29/2016 07:00 AM, amir bahmanyari wrote:
> Hi JB,I used the sample KafkaIO usage below.p.apply(KafkaIO.read().withBootstrapServers("kafkahost:9092").withTopics(topics));
> p.run();
>
> It threw the following at p.run():Exception in thread "main" java.lang.IllegalStateException: no evaluator registered for Read(UnboundedKafkaSource) at org.apache.beam.sdk.runners.DirectPipelineRunner$Evaluator.visitTransform(DirectPipelineRunner.java:898) I am sure I am missing something.Would be great if I could see a sample code.I appreciate it sir.Cheers
>
> From: Jean-Baptiste Onofré <jb...@nanthrax.net>
> To: dev@beam.incubator.apache.org
> Sent: Thursday, April 28, 2016 5:30 AM
> Subject: [DISCUSS] Beam IO &runners native IO
>
> Hi all,
>
> regarding the recent threads on the mailing list, I would like to start
> a format discussion around the IO.
> As we can expect the first contributions on this area (I already have
> some work in progress around this ;)), I think it's a fair discussion to
> have.
>
> Now, we have two kinds of IO: the one "generic" to Beam, the one "local"
> to the runners.
>
> For example, let's take Kafka: we have the KafkaIO (in IO), and for
> instance, we have the spark-streaming kafka connector (in Spark Runner).
>
> Right now, we have two approaches for the user:
> 1. In the pipeline, we use KafkaIO from Beam: it's the preferred
> approach for sure. However, the user may want to use the runner specific
> IO for two reasons:
> * Beam doesn't provide the IO yet (for instance, spark cassandra
> connector is available whereas we don't have yet any CassandraIO (I'm
> working on it anyway ;))
> * The runner native IO is optimized or contain more features that the
> Beam native IO
> 2. So, for the previous reasons, the user could want to use the native
> runner IO. The drawback of this approach is that the pipeline will be
> tight to a specific runner, which is completely against the Beam design.
>
> I wonder if it wouldn't make sense to add flag on the IO API (and
> related on Runner API) like .useNative().
>
> For instance, the user would be able to do:
>
> pipeline.apply(KafkaIO.read().withBootstrapServers("...").withTopics("...").useNative(true);
>
> then, if the runner has a "native" IO, it will use it, else, if
> useNative(false) (the default), it won't use any runner native IO.
>
> The point there is for the configuration: assuming the Beam IO and the
> runner IO can differ, it means that the "Beam IO" would have to populate
> all runner specific IO configuration.
>
> Of course, it's always possible to use a PTransform to wrap the runner
> native IO, but we are back on the same concern: the pipeline will be
> couple to a specific runner.
>
> The purpose of the useNative() flag is to "automatically" inform the
> runner to use a specific IO if it has one: the pipeline stays decoupled
> from the runners.
>
> Thoughts ?
>
> Thanks
> Regards
> JB
>
--
Jean-Baptiste Onofré
jbonofre@apache.org
http://blog.nanthrax.net
Talend - http://www.talend.com
Re: [DISCUSS] Beam IO &runners native IO
Posted by Jean-Baptiste Onofré <jb...@nanthrax.net>.
I gonna take a look. The DirectPipelineRunner didn't support the
unbounded collection (it has been fixed last night AFAIR). It could be
related.
Regards
JB
On 04/29/2016 07:00 AM, amir bahmanyari wrote:
> Hi JB,I used the sample KafkaIO usage below.p.apply(KafkaIO.read().withBootstrapServers("kafkahost:9092").withTopics(topics));
> p.run();
>
> It threw the following at p.run():Exception in thread "main" java.lang.IllegalStateException: no evaluator registered for Read(UnboundedKafkaSource) at org.apache.beam.sdk.runners.DirectPipelineRunner$Evaluator.visitTransform(DirectPipelineRunner.java:898) I am sure I am missing something.Would be great if I could see a sample code.I appreciate it sir.Cheers
>
> From: Jean-Baptiste Onofré <jb...@nanthrax.net>
> To: dev@beam.incubator.apache.org
> Sent: Thursday, April 28, 2016 5:30 AM
> Subject: [DISCUSS] Beam IO &runners native IO
>
> Hi all,
>
> regarding the recent threads on the mailing list, I would like to start
> a format discussion around the IO.
> As we can expect the first contributions on this area (I already have
> some work in progress around this ;)), I think it's a fair discussion to
> have.
>
> Now, we have two kinds of IO: the one "generic" to Beam, the one "local"
> to the runners.
>
> For example, let's take Kafka: we have the KafkaIO (in IO), and for
> instance, we have the spark-streaming kafka connector (in Spark Runner).
>
> Right now, we have two approaches for the user:
> 1. In the pipeline, we use KafkaIO from Beam: it's the preferred
> approach for sure. However, the user may want to use the runner specific
> IO for two reasons:
> * Beam doesn't provide the IO yet (for instance, spark cassandra
> connector is available whereas we don't have yet any CassandraIO (I'm
> working on it anyway ;))
> * The runner native IO is optimized or contain more features that the
> Beam native IO
> 2. So, for the previous reasons, the user could want to use the native
> runner IO. The drawback of this approach is that the pipeline will be
> tight to a specific runner, which is completely against the Beam design.
>
> I wonder if it wouldn't make sense to add flag on the IO API (and
> related on Runner API) like .useNative().
>
> For instance, the user would be able to do:
>
> pipeline.apply(KafkaIO.read().withBootstrapServers("...").withTopics("...").useNative(true);
>
> then, if the runner has a "native" IO, it will use it, else, if
> useNative(false) (the default), it won't use any runner native IO.
>
> The point there is for the configuration: assuming the Beam IO and the
> runner IO can differ, it means that the "Beam IO" would have to populate
> all runner specific IO configuration.
>
> Of course, it's always possible to use a PTransform to wrap the runner
> native IO, but we are back on the same concern: the pipeline will be
> couple to a specific runner.
>
> The purpose of the useNative() flag is to "automatically" inform the
> runner to use a specific IO if it has one: the pipeline stays decoupled
> from the runners.
>
> Thoughts ?
>
> Thanks
> Regards
> JB
>
--
Jean-Baptiste Onofré
jbonofre@apache.org
http://blog.nanthrax.net
Talend - http://www.talend.com
Re: [DISCUSS] Beam IO &runners native IO
Posted by amir bahmanyari <am...@yahoo.com.INVALID>.
Hi JB,I used the sample KafkaIO usage below.p.apply(KafkaIO.read().withBootstrapServers("kafkahost:9092").withTopics(topics));
p.run();
It threw the following at p.run():Exception in thread "main" java.lang.IllegalStateException: no evaluator registered for Read(UnboundedKafkaSource) at org.apache.beam.sdk.runners.DirectPipelineRunner$Evaluator.visitTransform(DirectPipelineRunner.java:898) I am sure I am missing something.Would be great if I could see a sample code.I appreciate it sir.Cheers
From: Jean-Baptiste Onofré <jb...@nanthrax.net>
To: dev@beam.incubator.apache.org
Sent: Thursday, April 28, 2016 5:30 AM
Subject: [DISCUSS] Beam IO &runners native IO
Hi all,
regarding the recent threads on the mailing list, I would like to start
a format discussion around the IO.
As we can expect the first contributions on this area (I already have
some work in progress around this ;)), I think it's a fair discussion to
have.
Now, we have two kinds of IO: the one "generic" to Beam, the one "local"
to the runners.
For example, let's take Kafka: we have the KafkaIO (in IO), and for
instance, we have the spark-streaming kafka connector (in Spark Runner).
Right now, we have two approaches for the user:
1. In the pipeline, we use KafkaIO from Beam: it's the preferred
approach for sure. However, the user may want to use the runner specific
IO for two reasons:
* Beam doesn't provide the IO yet (for instance, spark cassandra
connector is available whereas we don't have yet any CassandraIO (I'm
working on it anyway ;))
* The runner native IO is optimized or contain more features that the
Beam native IO
2. So, for the previous reasons, the user could want to use the native
runner IO. The drawback of this approach is that the pipeline will be
tight to a specific runner, which is completely against the Beam design.
I wonder if it wouldn't make sense to add flag on the IO API (and
related on Runner API) like .useNative().
For instance, the user would be able to do:
pipeline.apply(KafkaIO.read().withBootstrapServers("...").withTopics("...").useNative(true);
then, if the runner has a "native" IO, it will use it, else, if
useNative(false) (the default), it won't use any runner native IO.
The point there is for the configuration: assuming the Beam IO and the
runner IO can differ, it means that the "Beam IO" would have to populate
all runner specific IO configuration.
Of course, it's always possible to use a PTransform to wrap the runner
native IO, but we are back on the same concern: the pipeline will be
couple to a specific runner.
The purpose of the useNative() flag is to "automatically" inform the
runner to use a specific IO if it has one: the pipeline stays decoupled
from the runners.
Thoughts ?
Thanks
Regards
JB
--
Jean-Baptiste Onofré
jbonofre@apache.org
http://blog.nanthrax.net
Talend - http://www.talend.com