[ 
https://issues.apache.org/jira/browse/ARROW-1927?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16297699#comment-16297699
 ] 

ASF GitHub Bot commented on ARROW-1927:
---------------------------------------

robertnishihara commented on a change in pull request #1427: ARROW-1927: 
[Plasma] Add delete function
URL: https://github.com/apache/arrow/pull/1427#discussion_r157910600
 
 

 ##########
 File path: cpp/src/plasma/client.cc
 ##########
 @@ -501,9 +501,20 @@ Status PlasmaClient::Abort(const ObjectID& object_id) {
 }
 
 Status PlasmaClient::Delete(const ObjectID& object_id) {
-  // TODO(rkn): In the future, we can use this method to give hints to the
-  // eviction policy about when an object will no longer be needed.
-  return Status::NotImplemented("PlasmaClient::Delete is not implemented.");
+  RETURN_NOT_OK(FlushReleaseHistory());
+  // If the object is in used, client can't send the remove message.
+  if (objects_in_use_.count(object_id) > 0) {
+    return Status::UnknownError("PlasmaClient::Object is in used.");
+  } else {
+    // If we don't already have a reference to the object, we can try to 
remove the object
+    RETURN_NOT_OK(SendDeleteRequest(store_conn_, object_id));
+    std::vector<uint8_t> buffer;
+    RETURN_NOT_OK(PlasmaReceive(store_conn_, MessageType_PlasmaDeleteReply, 
&buffer));
 
 Review comment:
   What do you think about not having the plasma store reply to the client? The 
client could just continue on. If it really wants to know whether the object 
was deleted or not, it can call `Contains` to check.
   
   Are there use cases where you really want to know if the object was deleted 
or not?

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


> [Plasma] Implement delete function
> ----------------------------------
>
>                 Key: ARROW-1927
>                 URL: https://issues.apache.org/jira/browse/ARROW-1927
>             Project: Apache Arrow
>          Issue Type: Improvement
>          Components: Plasma (C++), Python
>            Reporter: Philipp Moritz
>              Labels: pull-request-available
>
> The function should check if the reference count of the object is zero and if 
> yes, delete it from the store. If no, it should raise an exception or return 
> a status value.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

Reply via email to