From 608ee9797f888aeac701a8d0501aa166bf8d4cc6 Mon Sep 17 00:00:00 2001 From: jikunshang Date: Mon, 22 Mar 2021 08:52:41 +0800 Subject: [PATCH] add plasma java client metrics api (#7) --- .../java/org/apache/arrow/plasma/ObjectStoreLink.java | 5 +++++ .../java/org/apache/arrow/plasma/PlasmaClient.java | 10 ++++++++++ 2 files changed, 15 insertions(+) diff --git a/java/plasma/src/main/java/org/apache/arrow/plasma/ObjectStoreLink.java b/java/plasma/src/main/java/org/apache/arrow/plasma/ObjectStoreLink.java index 93a2d483c4891..81d210d0d83f5 100644 --- a/java/plasma/src/main/java/org/apache/arrow/plasma/ObjectStoreLink.java +++ b/java/plasma/src/main/java/org/apache/arrow/plasma/ObjectStoreLink.java @@ -128,4 +128,9 @@ default byte[] get(byte[] objectId, int timeoutMs, boolean isMetadata) { * List all objects in the PlasmaStore. */ List list(); + + /** + * Get metrics in the PlasmaStore. + */ + int metrics(long[] metrics); } diff --git a/java/plasma/src/main/java/org/apache/arrow/plasma/PlasmaClient.java b/java/plasma/src/main/java/org/apache/arrow/plasma/PlasmaClient.java index fdd7114f17503..1d860eea3d3f3 100644 --- a/java/plasma/src/main/java/org/apache/arrow/plasma/PlasmaClient.java +++ b/java/plasma/src/main/java/org/apache/arrow/plasma/PlasmaClient.java @@ -181,4 +181,14 @@ public void delete(byte[] objectId) { public boolean contains(byte[] objectId) { return PlasmaClientJNI.contains(conn, objectId); } + + /** + * Get metrics in the PlasmaStore. + * + * @param metrics used to return metrics, array size is 4, elements are: total memory size, + * used memory size, total external size, used external size. + */ + public int metrics(long[] metrics) { + return PlasmaClientJNI.metrics(conn, metrics); + } }