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

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_r157917179
 
 

 ##########
 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:
   Can you describe the use case?
   
   If you view the command as more of a "hint" that doesn't necessarily do 
anything but simply gives the plasma store more information that it can make 
use of, then a non-blocking API is natural.

----------------------------------------------------------------
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:
us...@infra.apache.org


> [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