This is an automated email from the ASF dual-hosted git repository.
alsuliman pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/asterixdb.git
The following commit(s) were added to refs/heads/master by this push:
new 4ff8fc4ff5 [NO ISSUE][OTH] Add API to IO cloud mgr to put data in dir
in bucket
4ff8fc4ff5 is described below
commit 4ff8fc4ff5cf8a71a4dd6871c3534cdd136b7db4
Author: Ali Alsuliman <[email protected]>
AuthorDate: Fri Jan 19 17:54:41 2024 -0800
[NO ISSUE][OTH] Add API to IO cloud mgr to put data in dir in bucket
- user model changes: no
- storage format changes: no
- interface changes: no
Details:
Change-Id: Ic3c0f7440d96ca762deb2bb28dfce3c7a4af2aae
Reviewed-on: https://asterix-gerrit.ics.uci.edu/c/asterixdb/+/18130
Tested-by: Jenkins <[email protected]>
Reviewed-by: Ali Alsuliman <[email protected]>
Reviewed-by: Murtadha Hubail <[email protected]>
---
.../java/org/apache/asterix/cloud/AbstractCloudIOManager.java | 11 +++++++++++
.../src/main/java/org/apache/hyracks/util/JSONUtil.java | 4 ++++
2 files changed, 15 insertions(+)
diff --git
a/asterixdb/asterix-cloud/src/main/java/org/apache/asterix/cloud/AbstractCloudIOManager.java
b/asterixdb/asterix-cloud/src/main/java/org/apache/asterix/cloud/AbstractCloudIOManager.java
index dc8bc6862a..f271f1d88b 100644
---
a/asterixdb/asterix-cloud/src/main/java/org/apache/asterix/cloud/AbstractCloudIOManager.java
+++
b/asterixdb/asterix-cloud/src/main/java/org/apache/asterix/cloud/AbstractCloudIOManager.java
@@ -279,4 +279,15 @@ public abstract class AbstractCloudIOManager extends
IOManager implements IParti
public final JsonNode listAsJson(ObjectMapper objectMapper) {
return cloudClient.listAsJson(objectMapper, bucket);
}
+
+ /**
+ * Writes the bytes to the specified key in the bucket
+ *
+ * @param key the key where the bytes will be written
+ * @param bytes the bytes to write
+ */
+ public final void put(String key, byte[] bytes) {
+ cloudClient.write(bucket, key, bytes);
+ }
+
}
diff --git
a/hyracks-fullstack/hyracks/hyracks-util/src/main/java/org/apache/hyracks/util/JSONUtil.java
b/hyracks-fullstack/hyracks/hyracks-util/src/main/java/org/apache/hyracks/util/JSONUtil.java
index 191df1f98c..426b6f46bb 100644
---
a/hyracks-fullstack/hyracks/hyracks-util/src/main/java/org/apache/hyracks/util/JSONUtil.java
+++
b/hyracks-fullstack/hyracks/hyracks-util/src/main/java/org/apache/hyracks/util/JSONUtil.java
@@ -58,6 +58,10 @@ public class JSONUtil {
return
SORTED_MAPPER.writeValueAsString(SORTED_MAPPER.treeToValue(node, Object.class));
}
+ public static byte[] asBytes(JsonNode node) throws JsonProcessingException
{
+ return OBJECT_MAPPER.writeValueAsBytes(node);
+ }
+
public static String convertNodeUnchecked(final JsonNode node) throws
UncheckedExecutionException {
try {
return convertNode(node);