>From Ali Alsuliman <[email protected]>: Ali Alsuliman has submitted this change. ( https://asterix-gerrit.ics.uci.edu/c/asterixdb/+/18130 )
Change subject: [NO ISSUE][OTH] Add API to IO cloud mgr to put data in dir in bucket ...................................................................... [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]> --- M hyracks-fullstack/hyracks/hyracks-util/src/main/java/org/apache/hyracks/util/JSONUtil.java M asterixdb/asterix-cloud/src/main/java/org/apache/asterix/cloud/AbstractCloudIOManager.java 2 files changed, 33 insertions(+), 0 deletions(-) Approvals: Murtadha Hubail: Looks good to me, approved Ali Alsuliman: Looks good to me, but someone else must approve Jenkins: Verified Objections: Anon. E. Moose #1000171: Violations found 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 dc8bc68..f271f1d 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 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 191df1f..426b6f4 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 @@ 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); -- To view, visit https://asterix-gerrit.ics.uci.edu/c/asterixdb/+/18130 To unsubscribe, or for help writing mail filters, visit https://asterix-gerrit.ics.uci.edu/settings Gerrit-Project: asterixdb Gerrit-Branch: master Gerrit-Change-Id: Ic3c0f7440d96ca762deb2bb28dfce3c7a4af2aae Gerrit-Change-Number: 18130 Gerrit-PatchSet: 2 Gerrit-Owner: Ali Alsuliman <[email protected]> Gerrit-Reviewer: Ali Alsuliman <[email protected]> Gerrit-Reviewer: Anon. E. Moose #1000171 Gerrit-Reviewer: Jenkins <[email protected]> Gerrit-Reviewer: Michael Blow <[email protected]> Gerrit-Reviewer: Murtadha Hubail <[email protected]> Gerrit-Reviewer: Wail Alkowaileet <[email protected]> Gerrit-MessageType: merged
