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

James Taylor commented on PHOENIX-1889:
---------------------------------------

Thanks for the updated patch, [~rajeshbabu]. Maybe one minor nit that you can 
fix on commit (hard to see the full change in the context of the patch), but 
please make sure you calculate the server time only once, outside the if 
statement, in the function when based on 
EnvironmentEdgeManager.currentTimeMillis(). Then use that timestamp and that 
timestamp-1 throughout the rest of the function.
{code}
@@ -836,12 +837,19 @@ public class MetaDataEndpointImpl extends 
MetaDataProtocol implements Coprocesso
         }
         Cell[] functionKeyValues = new Cell[FUNCTION_KV_COLUMNS.size()];
         Cell[] functionArgKeyValues = new Cell[FUNCTION_ARG_KV_COLUMNS.size()];
-
         // Create PFunction based on KeyValues from scan
         Cell keyValue = results.get(0);
         byte[] keyBuffer = keyValue.getRowArray();
         int keyLength = keyValue.getRowLength();
         int keyOffset = keyValue.getRowOffset();
+        if(isReplace) {
+            long deleteTimeStamp =
+                    clientTimeStamp == HConstants.LATEST_TIMESTAMP ? 
EnvironmentEdgeManager
+                            .currentTimeMillis() - 1
+                            : (keyValue.getTimestamp() < clientTimeStamp ? 
clientTimeStamp - 1
+                                    : keyValue.getTimestamp());
+            deleteMutationsForReplace.add(new Delete(keyBuffer, keyOffset, 
keyLength, deleteTimeStamp));
+        }
{code}

> Support alter/replace and drop functions
> ----------------------------------------
>
>                 Key: PHOENIX-1889
>                 URL: https://issues.apache.org/jira/browse/PHOENIX-1889
>             Project: Phoenix
>          Issue Type: Sub-task
>            Reporter: Rajeshbabu Chintaguntla
>            Assignee: Rajeshbabu Chintaguntla
>             Fix For: 5.0.0, 4.5.0, 4.4.1
>
>         Attachments: PHOENIX-1889.patch, PHOENIX-1889_v2.patch
>
>




--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to