-
Notifications
You must be signed in to change notification settings - Fork 117
FALCON-2229 BacklogEmitterMetricService fix for deleting entities' instances in case of removal of SLA or deletion of entity #335
Conversation
…stances in case of removal of SLA or deletion of entity
EntityManager entityManager = getEntityManager(); | ||
beginTransaction(entityManager); | ||
Query q = entityManager.createNamedQuery(PersistenceConstants.DELETE_ALL_BACKLOG_ENTITY_INSTANCES); | ||
q.setParameter("entityName", entityName); | ||
q.setParameter("entityType", entityType); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do we need to add clusterName also here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
no. In a colo on removal of an entity, its removed from all the clusters, which means deletion of the instances across the clusters per colo.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
but the query for the PersistenceConstants DELETE_ALL_BACKLOG_ENTITY_INSTANCES expects three variables.
query = delete from BacklogMetricBean a where a.entityName = :entityName and a.clusterName = :clusterName and a.entityType = :entityType"
Which means from there you need to remove clusterName.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for catching it. I had missed it. I will remove cluster from the named query.
q.executeUpdate(); | ||
} finally { | ||
commitAndCloseTransaction(entityManager); | ||
} | ||
} | ||
|
||
public void deleteEntityInstance(String entityName){ | ||
public void deleteEntityInstance(String entityName, String entityType) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can we change the method name to deleteEntityBackLogInstances?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ack. I will change it.
… instances irrespective of the cluster
+1 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
…stances in case of removal of SLA or deletion of entity Author: sandeep <sandysmdl@gmail.com> Reviewers: @PracheerAgarwal, @pallavi-rao Closes apache#335 from sandeepSamudrala/FALCON-2229 and squashes the following commits: 280a079 [sandeep] FALCON-2229 Removed cluster from the named query that deletes all the instances irrespective of the cluster 22a80b6 [sandeep] FALCON-2229 Incorporated review comments. Renamed the method 5cb25e8 [sandeep] FALCON-2229 BacklogEmitterMetricService fix for deleting entities' instances in case of removal of SLA or deletion of entity 3558af3 [sandeep] Merge branch 'master' of https://github.com/apache/falcon into FALCON-2229 cc28658 [sandeep] Merge branch 'master' of https://github.com/apache/falcon 089b10d [sandeep] Merge branch 'master' of https://github.com/apache/falcon 456d4ee [sandeep] Merge branch 'master' of https://github.com/apache/falcon 0cf9af6 [sandeep] Merge branch 'master' of https://github.com/apache/falcon 4a2e23e [sandeep] Merge branch 'master' of https://github.com/apache/falcon b1546ed [sandeep] Merge branch 'master' of https://github.com/apache/falcon 0a433fb [sandeep] Merge branch 'master' of https://github.com/apache/falcon 194f36a [sandeep] Merge branch 'master' of https://github.com/apache/falcon e0ad358 [sandeep] Merge branch 'master' of https://github.com/apache/falcon f96a084 [sandeep] Merge branch 'master' of https://github.com/apache/falcon 9cf36e9 [sandeep] Merge branch 'master' of https://github.com/apache/falcon bbca081 [sandeep] Merge branch 'master' of https://github.com/apache/falcon 48f6afa [sandeep] Merge branch 'master' of https://github.com/apache/falcon 250cc46 [sandeep] Merge branch 'master' of https://github.com/apache/falcon d0393e9 [sandeep] Merge branch 'master' of https://github.com/apache/falcon a178805 [sandeep] Merge branch 'master' of https://github.com/apache/falcon d6dc8bf [sandeep] Merge branch 'master' of https://github.com/apache/falcon 1bb8d3c [sandeep] Merge branch 'master' of https://github.com/apache/falcon c065566 [sandeep] reverting last line changes made 1a4dcd2 [sandeep] rebased and resolved the conflicts from master 271318b [sandeep] FALCON-2097. Adding UT to the new method for getting next instance time with Delay. a94d4fe [sandeep] rebasing from master 9e68a57 [sandeep] FALCON-298. Feed update with replication delay creates holes
No description provided.