Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
ljz0721cx opened this issue May 8, 2024 · 0 comments
Open

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

ljz0721cx opened this issue May 8, 2024 · 0 comments

Comments

@ljz0721cx
Copy link

目前执行时候需要手动组装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;
                      })
      );
  
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant