edit-icon download-icon

Configure the HiTSDBConfig class

Last Updated: Mar 28, 2018

All HiTSDB-Client configurations are completed by HiTSDBConfig. You can use the config() method to build HiTSDBConfig objects. The following sample code demonstrates specific configurations.

Sample code

HiTSDBConfig config = HiTSDBConfig
    // In configuring an address, the first parameter can be HiTSDB's domain or IP. The second parameter represents the HiTSDB port.
    .address("example.hitsdb.com", 8242)

    // A read-only switch, which is False by default. If readonly is set to True, the asynchronous putting switch is turned off.

     // Size of the network connection pool, which is 64 by default.

    // HTTP waiting time (90 by default) in seconds.

    // Quantity of IO threads, which is 1 by default.

    // Asynchronous putting switch. The default setting is True. We recommend that you use asynchronous putting.

    // For asynchronous putting, the length of the buffer queue at the client. 10000 by default.

    // For asynchronous putting, the quantity of threads consumed by the buffer queue. 1 by default.

    // For asynchronous putting, the quantity of points submitted to the client in each batch. 500 by default.

    // For asynchronous putting, maximum time for each wait, in milliseconds. 300 by default.

    // For asynchronous putting, the quantity of write request queues. Equal to the quantity of connection pools by default. Can be configured by proportion of the input/output operations per second.

    // For asynchronous putting, the quantity of request queues is unlimited. Shutting it down can result in OOM, and is therefore not recommended.

    // For asynchronous putting, asynchronous batch Put callback interfaces.
    .listenBatchPut(new BatchPutCallback() { 
        @Override public void response(List<Point> input, Result output) {}

    // Traffic limit, specifying the maximum Points submitted per second.

    .config(); // Build HiTSDBConfig objects
Thank you! We've received your feedback.