You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@iotdb.apache.org by Jiajun Liu <li...@gmail.com> on 2021/07/08 04:45:42 UTC

A cleaner way to construct Session and SessionPool in Java Native API

Hi all,

We have added new builder classes to construct Session and SessionPool in
Java Native API, providing a cleaner way to configure the various
parameters. Feel free to try it out and give your feedback!

*Old way:*
Session(String host, int rpcPort)
Session(String host, String rpcPort, String username, String password)
Session(String host, int rpcPort, String username, String password)

*New way:*
    session =
        new Session.Builder()
            .host(String host)
            .port(int port)
            .fetchSize(int fetchSize)
            .username(String username)
            .password(String password)
            .thriftDefaultBufferSize(int thriftDefaultBufferSize)
            .thriftMaxFrameSize(int thriftMaxFrameSize)
            .enableCacheLeader(boolean enableCacheLeader)
            .build();

Docs:
https://iotdb.apache.org/UserGuide/Master/API/Programming-Java-Native-API.html#native-apis
JIRA: https://issues.apache.org/jira/browse/IOTDB-1463

<https://issues.apache.org/jira/browse/IOTDB-1463>
Regards,
Jiajun
School of Computing, National University of Singapore

Re: A cleaner way to construct Session and SessionPool in Java Native API

Posted by Jialin Qiao <qi...@apache.org>.
Hi, I like the new way!
—————————————————
Jialin Qiao
School of Software, Tsinghua University

乔嘉林
清华大学 软件学院


谭新宇 <10...@qq.com.invalid> 于2021年7月9日周五 上午8:57写道:

> Great Work JiaJun :)
> ———————
> Best,
> Xinyu Tan
>
> > 在 2021年7月8日,下午10:26,Xiangdong Huang <sa...@gmail.com> 写道:
> >
> > Ok. look forward.
> > (But do not remove stale APIs for compatibility).
> >
> > -----------------------------------
> > Xiangdong Huang
> > School of Software, Tsinghua University
> >
> > 黄向东
> > 清华大学 软件学院
> >
> > Xiangwei Wei <wx...@gmail.com> 于2021年7月8日周四 下午4:52写道:
> >>
> >> Hi Jiajun,
> >>
> >> Good job !
> >>
> >> Jiajun Liu <li...@gmail.com> 于2021年7月8日周四 下午12:45写道:
> >>
> >>> Hi all,
> >>>
> >>> We have added new builder classes to construct Session and SessionPool
> in
> >>> Java Native API, providing a cleaner way to configure the various
> >>> parameters. Feel free to try it out and give your feedback!
> >>>
> >>> *Old way:*
> >>> Session(String host, int rpcPort)
> >>> Session(String host, String rpcPort, String username, String password)
> >>> Session(String host, int rpcPort, String username, String password)
> >>>
> >>> *New way:*
> >>>    session =
> >>>        new Session.Builder()
> >>>            .host(String host)
> >>>            .port(int port)
> >>>            .fetchSize(int fetchSize)
> >>>            .username(String username)
> >>>            .password(String password)
> >>>            .thriftDefaultBufferSize(int thriftDefaultBufferSize)
> >>>            .thriftMaxFrameSize(int thriftMaxFrameSize)
> >>>            .enableCacheLeader(boolean enableCacheLeader)
> >>>            .build();
> >>>
> >>> Docs:
> >>>
> >>>
> https://iotdb.apache.org/UserGuide/Master/API/Programming-Java-Native-API.html#native-apis
> >>> JIRA: https://issues.apache.org/jira/browse/IOTDB-1463
> >>>
> >>> <https://issues.apache.org/jira/browse/IOTDB-1463>
> >>> Regards,
> >>> Jiajun
> >>> School of Computing, National University of Singapore
> >>>
> >>
> >>
> >> --
> >> Best,
> >> Xiangwei Wei
> >
>
>

Re: A cleaner way to construct Session and SessionPool in Java Native API

Posted by 谭新宇 <10...@qq.com.INVALID>.
Great Work JiaJun :)
———————
Best,
Xinyu Tan

> 在 2021年7月8日,下午10:26,Xiangdong Huang <sa...@gmail.com> 写道:
> 
> Ok. look forward.
> (But do not remove stale APIs for compatibility).
> 
> -----------------------------------
> Xiangdong Huang
> School of Software, Tsinghua University
> 
> 黄向东
> 清华大学 软件学院
> 
> Xiangwei Wei <wx...@gmail.com> 于2021年7月8日周四 下午4:52写道:
>> 
>> Hi Jiajun,
>> 
>> Good job !
>> 
>> Jiajun Liu <li...@gmail.com> 于2021年7月8日周四 下午12:45写道:
>> 
>>> Hi all,
>>> 
>>> We have added new builder classes to construct Session and SessionPool in
>>> Java Native API, providing a cleaner way to configure the various
>>> parameters. Feel free to try it out and give your feedback!
>>> 
>>> *Old way:*
>>> Session(String host, int rpcPort)
>>> Session(String host, String rpcPort, String username, String password)
>>> Session(String host, int rpcPort, String username, String password)
>>> 
>>> *New way:*
>>>    session =
>>>        new Session.Builder()
>>>            .host(String host)
>>>            .port(int port)
>>>            .fetchSize(int fetchSize)
>>>            .username(String username)
>>>            .password(String password)
>>>            .thriftDefaultBufferSize(int thriftDefaultBufferSize)
>>>            .thriftMaxFrameSize(int thriftMaxFrameSize)
>>>            .enableCacheLeader(boolean enableCacheLeader)
>>>            .build();
>>> 
>>> Docs:
>>> 
>>> https://iotdb.apache.org/UserGuide/Master/API/Programming-Java-Native-API.html#native-apis
>>> JIRA: https://issues.apache.org/jira/browse/IOTDB-1463
>>> 
>>> <https://issues.apache.org/jira/browse/IOTDB-1463>
>>> Regards,
>>> Jiajun
>>> School of Computing, National University of Singapore
>>> 
>> 
>> 
>> --
>> Best,
>> Xiangwei Wei
> 


Re: A cleaner way to construct Session and SessionPool in Java Native API

Posted by Xiangdong Huang <sa...@gmail.com>.
Ok. look forward.
(But do not remove stale APIs for compatibility).

-----------------------------------
Xiangdong Huang
School of Software, Tsinghua University

 黄向东
清华大学 软件学院

Xiangwei Wei <wx...@gmail.com> 于2021年7月8日周四 下午4:52写道:
>
> Hi Jiajun,
>
> Good job !
>
> Jiajun Liu <li...@gmail.com> 于2021年7月8日周四 下午12:45写道:
>
> > Hi all,
> >
> > We have added new builder classes to construct Session and SessionPool in
> > Java Native API, providing a cleaner way to configure the various
> > parameters. Feel free to try it out and give your feedback!
> >
> > *Old way:*
> > Session(String host, int rpcPort)
> > Session(String host, String rpcPort, String username, String password)
> > Session(String host, int rpcPort, String username, String password)
> >
> > *New way:*
> >     session =
> >         new Session.Builder()
> >             .host(String host)
> >             .port(int port)
> >             .fetchSize(int fetchSize)
> >             .username(String username)
> >             .password(String password)
> >             .thriftDefaultBufferSize(int thriftDefaultBufferSize)
> >             .thriftMaxFrameSize(int thriftMaxFrameSize)
> >             .enableCacheLeader(boolean enableCacheLeader)
> >             .build();
> >
> > Docs:
> >
> > https://iotdb.apache.org/UserGuide/Master/API/Programming-Java-Native-API.html#native-apis
> > JIRA: https://issues.apache.org/jira/browse/IOTDB-1463
> >
> > <https://issues.apache.org/jira/browse/IOTDB-1463>
> > Regards,
> > Jiajun
> > School of Computing, National University of Singapore
> >
>
>
> --
> Best,
> Xiangwei Wei

Re: A cleaner way to construct Session and SessionPool in Java Native API

Posted by Xiangwei Wei <wx...@gmail.com>.
Hi Jiajun,

Good job !

Jiajun Liu <li...@gmail.com> 于2021年7月8日周四 下午12:45写道:

> Hi all,
>
> We have added new builder classes to construct Session and SessionPool in
> Java Native API, providing a cleaner way to configure the various
> parameters. Feel free to try it out and give your feedback!
>
> *Old way:*
> Session(String host, int rpcPort)
> Session(String host, String rpcPort, String username, String password)
> Session(String host, int rpcPort, String username, String password)
>
> *New way:*
>     session =
>         new Session.Builder()
>             .host(String host)
>             .port(int port)
>             .fetchSize(int fetchSize)
>             .username(String username)
>             .password(String password)
>             .thriftDefaultBufferSize(int thriftDefaultBufferSize)
>             .thriftMaxFrameSize(int thriftMaxFrameSize)
>             .enableCacheLeader(boolean enableCacheLeader)
>             .build();
>
> Docs:
>
> https://iotdb.apache.org/UserGuide/Master/API/Programming-Java-Native-API.html#native-apis
> JIRA: https://issues.apache.org/jira/browse/IOTDB-1463
>
> <https://issues.apache.org/jira/browse/IOTDB-1463>
> Regards,
> Jiajun
> School of Computing, National University of Singapore
>


-- 
Best,
Xiangwei Wei