Skip to content

需要支持匹配插入的配置 #30

@ljz0721cx

Description

@ljz0721cx

目前执行时候需要手动组装list,需要用户来组装,期望可以让用户无感知.

public CompletableFuture<Void> writeBatch(String database, List<Point> points) {
        String writeUrl = getWriteUrl(database);
        StringJoiner sj = new StringJoiner("\n");
        points.forEach(point -> sj.add(point.toString()));
        RequestBody requestBody = RequestBody.create(JSON, sj.toString());
        return httpExcute(writeUrl, Void.class, UrlConst.POST, requestBody);
    }

批量执行在sdk中封装,将sdk执行批量的线程可以配置到外部配置中

  // 开启批处理配置,像这样配置执行后,可以让用户无感知执行批量,并且可以增加系统的吞吐量
      influxDB.enableBatch(
              BatchOptions.DEFAULTS
                      .threadFactory(runnable -> {
                          Thread thread = new Thread(runnable);
                          thread.setDaemon(true);
                          return thread;
                      })
      );
  

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions