Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 1E5CA200BC5 for ; Tue, 22 Nov 2016 09:33:54 +0100 (CET) Received: by cust-asf.ponee.io (Postfix) id 1D140160B0C; Tue, 22 Nov 2016 08:33:54 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 62448160B0A for ; Tue, 22 Nov 2016 09:33:53 +0100 (CET) Received: (qmail 21933 invoked by uid 500); 22 Nov 2016 08:33:52 -0000 Mailing-List: contact user-help@flink.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: user@flink.apache.org Delivered-To: mailing list user@flink.apache.org Received: (qmail 21922 invoked by uid 99); 22 Nov 2016 08:33:52 -0000 Received: from mail-relay.apache.org (HELO mail-relay.apache.org) (140.211.11.15) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 22 Nov 2016 08:33:52 +0000 Received: from [192.168.2.104] (p4FD41AE3.dip0.t-ipconnect.de [79.212.26.227]) by mail-relay.apache.org (ASF Mail Server at mail-relay.apache.org) with ESMTPSA id DF23C1A00A8 for ; Tue, 22 Nov 2016 08:33:51 +0000 (UTC) Subject: Re: Cassandra Connector To: user@flink.apache.org References: <27A2D724-EE90-4929-B2D6-E5016016E18C@zweitag.de> <5834022B.1010802@apache.org> From: Chesnay Schepler Message-ID: <583402EF.5050703@apache.org> Date: Tue, 22 Nov 2016 09:33:51 +0100 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.5.0 MIME-Version: 1.0 In-Reply-To: <5834022B.1010802@apache.org> Content-Type: multipart/alternative; boundary="------------040507080907050105050303" archived-at: Tue, 22 Nov 2016 08:33:54 -0000 This is a multi-part message in MIME format. --------------040507080907050105050303 Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit Actually this is a bit inaccurate. _Some_ implementations are not implemented as a sink. Also, you can in fact instantiate the sinks yourself as well, as in readings.addSink(new CassandraTupleSink(, ); On 22.11.2016 09:30, Chesnay Schepler wrote: > Hello, > > the CassandraSink is not implemented as a sink but as a special > operator, so you wouldn't be able to use the > addSink() method. (I can't remember the actual method being used.) > > There are also several different implementations for various types > (tuples, pojo's, scala case classes) but we > did not want the user to be aware of it. This has the neat property > that we can change the underlying classes > any way we want (like modifying the constructor) without breaking > anything. > > Regards, > Chesnay > > On 22.11.2016 08:06, Stephan Epping wrote: >> Hello, >> >> I wondered why the cassandra connector has such an unusual interface: >> CassandraSink csink = CassandraSink.addSink(readings) >> while all other sinks seem to look like >> >> RMQSink sink =new RMQSink(cfg, "readings_persist_out", new JSONReadingSchema()); >> readings.addSink(sink); >> best, >> Stephan >> >> >> > --------------040507080907050105050303 Content-Type: text/html; charset=windows-1252 Content-Transfer-Encoding: 7bit
Actually this is a bit inaccurate. _Some_ implementations are not implemented as a sink.

Also, you can in fact instantiate the sinks yourself as well, as in
readings.addSink(new CassandraTupleSink(<query>, <builder>);

On 22.11.2016 09:30, Chesnay Schepler wrote:
Hello,

the CassandraSink is not implemented as a sink but as a special operator, so you wouldn't be able to use the
addSink() method. (I can't remember the actual method being used.)

There are also several different implementations for various types (tuples, pojo's, scala case classes) but we
did not want the user to be aware of it. This has the neat property that we can change the underlying classes
any way we want (like modifying the constructor) without breaking anything.

Regards,
Chesnay

On 22.11.2016 08:06, Stephan Epping wrote:
Hello,

I wondered why the cassandra connector has such an unusual interface:
CassandraSink<Reading> csink = CassandraSink.addSink(readings)
while all other sinks seem to look like

RMQSink<Reading> sink = new RMQSink<Reading>(cfg, "readings_persist_out", new JSONReadingSchema());
readings.addSink(sink);
best,
Stephan





--------------040507080907050105050303--