You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@pulsar.apache.org by Ruguo Yu <ji...@163.com> on 2023/01/15 10:31:49 UTC
[DISCUSS] Add unified newTableView method in PulsarClient
Hi Community,
Currently, we can use PulsarClient to create `Producer`, `Consumer`, `Reader` and `TableView`, releated method as below:
```
ProducerBuilder<byte[]> newProducer();
<T> ProducerBuilder<T> newProducer(Schema<T> schema);
ConsumerBuilder<byte[]> newConsumer();
<T> ConsumerBuilder<T> newConsumer(Schema<T> schema);
ReaderBuilder<byte[]> newReader();
<T> ReaderBuilder<T> newReader(Schema<T> schema);
<T> TableViewBuilder<T> newTableViewBuilder(Schema<T> schema);
```
However, it is obvious that the method of creating `TableView` is not consistent with other methods, and no method with default scheme is provided.
### Motivation
Add unified `newTableView(Schema)` method and replace `newTableViewBuilder(Schema)`(attach `@Deprecated` annotation to it) in PulsarClient, which could consistent with `newProducer(Schema)`, `newConsumer(Schema)`, `newReader(Schema)`.
In addition, we will provide `newTableView()` method which has default schema.
### Modifications
1. Add `newTableView(Schema)` method and replace `newTableViewBuilder(Schema)`(attach `@Deprecated` annotation to it) in PulsarClient
2. Add `newTableView()` method and Scheme default is `Schema.BYTES` in PulsarClient
Thanks
Ruguo Yu
Re: [DISCUSS] Add unified newTableView method in PulsarClient
Posted by Haiting Jiang <ji...@gmail.com>.
+1
Haiting
On Mon, Jan 16, 2023 at 3:14 PM Enrico Olivelli <eo...@gmail.com> wrote:
>
> +1
>
> Enrico
>
> Il Lun 16 Gen 2023, 03:11 PengHui Li <pe...@apache.org> ha scritto:
>
> > +1
> >
> > And It might be a typo when adding the table view APIs
> > From the example:
> >
> >
> > https://github.com/apache/pulsar/blob/246c2701e5c43e02e9783c82d4d107d06b019951/pulsar-client-api/src/main/java/org/apache/pulsar/client/api/PulsarClient.java#L232-L238
> >
> > And from the proposal, the method name is newTableView()
> >
> > https://github.com/apache/pulsar/issues/12356
> >
> > Thanks,
> > Penghui
> >
> > On Sun, Jan 15, 2023 at 6:31 PM Ruguo Yu <ji...@163.com> wrote:
> >
> > > Hi Community,
> > >
> > > Currently, we can use PulsarClient to create `Producer`, `Consumer`,
> > > `Reader` and `TableView`, releated method as below:
> > >
> > > ```
> > >
> > > ProducerBuilder<byte[]> newProducer();
> > >
> > > <T> ProducerBuilder<T> newProducer(Schema<T> schema);
> > >
> > > ConsumerBuilder<byte[]> newConsumer();
> > >
> > > <T> ConsumerBuilder<T> newConsumer(Schema<T> schema);
> > >
> > > ReaderBuilder<byte[]> newReader();
> > >
> > > <T> ReaderBuilder<T> newReader(Schema<T> schema);
> > >
> > > <T> TableViewBuilder<T> newTableViewBuilder(Schema<T> schema);
> > >
> > > ```
> > >
> > > However, it is obvious that the method of creating `TableView` is not
> > > consistent with other methods, and no method with default scheme is
> > > provided.
> > >
> > >
> > >
> > > ### Motivation
> > >
> > > Add unified `newTableView(Schema)` method and replace
> > > `newTableViewBuilder(Schema)`(attach `@Deprecated` annotation to it) in
> > > PulsarClient, which could consistent with `newProducer(Schema)`,
> > > `newConsumer(Schema)`, `newReader(Schema)`.
> > >
> > > In addition, we will provide `newTableView()` method which has default
> > > schema.
> > >
> > >
> > >
> > > ### Modifications
> > >
> > > 1. Add `newTableView(Schema)` method and replace
> > > `newTableViewBuilder(Schema)`(attach `@Deprecated` annotation to it) in
> > > PulsarClient
> > >
> > > 2. Add `newTableView()` method and Scheme default is `Schema.BYTES` in
> > > PulsarClient
> > >
> > >
> > >
> > > Thanks
> > >
> > > Ruguo Yu
> > >
> > >
> >
Re: [DISCUSS] Add unified newTableView method in PulsarClient
Posted by Enrico Olivelli <eo...@gmail.com>.
+1
Enrico
Il Lun 16 Gen 2023, 03:11 PengHui Li <pe...@apache.org> ha scritto:
> +1
>
> And It might be a typo when adding the table view APIs
> From the example:
>
>
> https://github.com/apache/pulsar/blob/246c2701e5c43e02e9783c82d4d107d06b019951/pulsar-client-api/src/main/java/org/apache/pulsar/client/api/PulsarClient.java#L232-L238
>
> And from the proposal, the method name is newTableView()
>
> https://github.com/apache/pulsar/issues/12356
>
> Thanks,
> Penghui
>
> On Sun, Jan 15, 2023 at 6:31 PM Ruguo Yu <ji...@163.com> wrote:
>
> > Hi Community,
> >
> > Currently, we can use PulsarClient to create `Producer`, `Consumer`,
> > `Reader` and `TableView`, releated method as below:
> >
> > ```
> >
> > ProducerBuilder<byte[]> newProducer();
> >
> > <T> ProducerBuilder<T> newProducer(Schema<T> schema);
> >
> > ConsumerBuilder<byte[]> newConsumer();
> >
> > <T> ConsumerBuilder<T> newConsumer(Schema<T> schema);
> >
> > ReaderBuilder<byte[]> newReader();
> >
> > <T> ReaderBuilder<T> newReader(Schema<T> schema);
> >
> > <T> TableViewBuilder<T> newTableViewBuilder(Schema<T> schema);
> >
> > ```
> >
> > However, it is obvious that the method of creating `TableView` is not
> > consistent with other methods, and no method with default scheme is
> > provided.
> >
> >
> >
> > ### Motivation
> >
> > Add unified `newTableView(Schema)` method and replace
> > `newTableViewBuilder(Schema)`(attach `@Deprecated` annotation to it) in
> > PulsarClient, which could consistent with `newProducer(Schema)`,
> > `newConsumer(Schema)`, `newReader(Schema)`.
> >
> > In addition, we will provide `newTableView()` method which has default
> > schema.
> >
> >
> >
> > ### Modifications
> >
> > 1. Add `newTableView(Schema)` method and replace
> > `newTableViewBuilder(Schema)`(attach `@Deprecated` annotation to it) in
> > PulsarClient
> >
> > 2. Add `newTableView()` method and Scheme default is `Schema.BYTES` in
> > PulsarClient
> >
> >
> >
> > Thanks
> >
> > Ruguo Yu
> >
> >
>
Re: [DISCUSS] Add unified newTableView method in PulsarClient
Posted by PengHui Li <pe...@apache.org>.
+1
And It might be a typo when adding the table view APIs
From the example:
https://github.com/apache/pulsar/blob/246c2701e5c43e02e9783c82d4d107d06b019951/pulsar-client-api/src/main/java/org/apache/pulsar/client/api/PulsarClient.java#L232-L238
And from the proposal, the method name is newTableView()
https://github.com/apache/pulsar/issues/12356
Thanks,
Penghui
On Sun, Jan 15, 2023 at 6:31 PM Ruguo Yu <ji...@163.com> wrote:
> Hi Community,
>
> Currently, we can use PulsarClient to create `Producer`, `Consumer`,
> `Reader` and `TableView`, releated method as below:
>
> ```
>
> ProducerBuilder<byte[]> newProducer();
>
> <T> ProducerBuilder<T> newProducer(Schema<T> schema);
>
> ConsumerBuilder<byte[]> newConsumer();
>
> <T> ConsumerBuilder<T> newConsumer(Schema<T> schema);
>
> ReaderBuilder<byte[]> newReader();
>
> <T> ReaderBuilder<T> newReader(Schema<T> schema);
>
> <T> TableViewBuilder<T> newTableViewBuilder(Schema<T> schema);
>
> ```
>
> However, it is obvious that the method of creating `TableView` is not
> consistent with other methods, and no method with default scheme is
> provided.
>
>
>
> ### Motivation
>
> Add unified `newTableView(Schema)` method and replace
> `newTableViewBuilder(Schema)`(attach `@Deprecated` annotation to it) in
> PulsarClient, which could consistent with `newProducer(Schema)`,
> `newConsumer(Schema)`, `newReader(Schema)`.
>
> In addition, we will provide `newTableView()` method which has default
> schema.
>
>
>
> ### Modifications
>
> 1. Add `newTableView(Schema)` method and replace
> `newTableViewBuilder(Schema)`(attach `@Deprecated` annotation to it) in
> PulsarClient
>
> 2. Add `newTableView()` method and Scheme default is `Schema.BYTES` in
> PulsarClient
>
>
>
> Thanks
>
> Ruguo Yu
>
>