+
+ // If the dependent vertices are not empty, then with
+ // the current behaviour, it should remove the vertices implicitly
+ // We are updating the code to properly log which call
+ // is doing this so the SE can work with the clients making the call to
+ // tell them not to call this API and can hopefully deprecate this
+ // functionality in the future releases
+ if(!dependentVertexes.isEmpty()){
+
+ LoggingContext.responseDescription(IMPLICIT_DELETE);
+
+ // Find all the deletable vertices from the dependent vertices that should be deleted
+ // So for each of the following dependent vertices,
+ // we will use the edge properties and do the cascade delete
+ List<Vertex> impliedDeleteVertices = this.engine.getQueryEngine().findDeletable(dependentVertexes);
+ int impliedDeleteCount = impliedDeleteVertices.size();
+
+ LOGGER.warn(
+ "For the vertex with id {}, doing an implicit delete on update will delete total of {} vertexes",
+ v.id(),
+ impliedDeleteCount
+ );
+
+ String impliedDeleteLogEnabled = AAIConfig.get(AAIConstants.AAI_IMPLIED_DELETE_LOG_ENABLED, "true");
+
+ int impliedDeleteLogLimit = AAIConfig.getInt(AAIConstants.AAI_IMPLIED_DELETE_LOG_LIMIT, "-1");
+
+ if(impliedDeleteLogLimit == -1){
+ impliedDeleteLogLimit = Integer.MAX_VALUE;
+ }
+
+ // If the logging is enabled for implied delete
+ // then log the payload in the latest format
+ if("true".equals(impliedDeleteLogEnabled) &&
+ impliedDeleteCount <= impliedDeleteLogLimit){
+ for(Vertex vertex : impliedDeleteVertices){
+ Introspector introspector = null;
+ try {
+ introspector = getLatestVersionView(vertex);
+ if(LOGGER.isInfoEnabled()){
+ LOGGER.info("Implied delete object in json format {}", introspector.marshal(false));
+ }
+ } catch(Exception ex){
+ LOGGER.warn("Encountered an exception during retrieval of vertex properties with vertex-id {} -> {}", v.id(), LogFormatTools.getStackTop(ex));
+ }
+ }
+ }
+
+ // After all the appropriate logging, calling the delete to delete the affected vertices
+ this.delete(impliedDeleteVertices);
+ }