]> git.proxmox.com Git - ceph.git/blob - ceph/src/rocksdb/java/src/main/java/org/rocksdb/ConcurrentTaskLimiter.java
update ceph source to reef 18.1.2
[ceph.git] / ceph / src / rocksdb / java / src / main / java / org / rocksdb / ConcurrentTaskLimiter.java
1 // Copyright (c) Meta Platforms, Inc. and affiliates.
2 //
3 // This source code is licensed under both the GPLv2 (found in the
4 // COPYING file in the root directory) and Apache 2.0 License
5 // (found in the LICENSE.Apache file in the root directory).
6
7 package org.rocksdb;
8
9 public abstract class ConcurrentTaskLimiter extends RocksObject {
10 protected ConcurrentTaskLimiter(final long nativeHandle) {
11 super(nativeHandle);
12 }
13
14 /**
15 * Returns a name that identifies this concurrent task limiter.
16 *
17 * @return Concurrent task limiter name.
18 */
19 public abstract String name();
20
21 /**
22 * Set max concurrent tasks.<br>
23 * limit = 0 means no new task allowed.<br>
24 * limit &lt; 0 means no limitation.
25 *
26 * @param maxOutstandinsTask max concurrent tasks.
27 * @return the reference to the current instance of ConcurrentTaskLimiter.
28 */
29 public abstract ConcurrentTaskLimiter setMaxOutstandingTask(final int maxOutstandinsTask);
30
31 /**
32 * Reset to unlimited max concurrent task.
33 *
34 * @return the reference to the current instance of ConcurrentTaskLimiter.
35 */
36 public abstract ConcurrentTaskLimiter resetMaxOutstandingTask();
37
38 /**
39 * Returns current outstanding task count.
40 *
41 * @return current outstanding task count.
42 */
43 public abstract int outstandingTask();
44 }