Skip to content

Commit

Permalink
clean up comments
Browse files Browse the repository at this point in the history
  • Loading branch information
Amanda Bozigian committed Mar 26, 2024
1 parent 9a033f4 commit 5b65e65
Showing 1 changed file with 0 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,6 @@ public void deleteMetadata(final String userId, final List<HasMetadata> holders)
.filter(m -> m instanceof HasDataMetadata && ((HasDataMetadata) m).isDataExternal())
.map(m -> ((HasDataMetadata) m).getDataUri()).collect(Collectors.toList());
if (!uris.isEmpty()) {
// TODO amboz determine if its OK to delete data metadata when DM fails onDelete
_softDeleteDataMetadata(userId, uris);
}
}
Expand All @@ -249,10 +248,8 @@ private void _deleteDefinitionMetadata(
try {
// apply interceptor to validate the object node
this.metadataInterceptor.onDelete(this, name);
// add valid names to validNames
validNames.add(name);
} catch (Exception e) {
// if onDelete throws an exception, remove this name from aNames and log it
final String message = String.format(
"metadata onDelete for name %s encountered an exception", name
);
Expand All @@ -270,15 +267,13 @@ private void _deleteDefinitionMetadata(
.toArray(SqlParameterValue[]::new);
if (aNames.length > 0) {
final List<String> paramVariables = Arrays.stream(aNames).map(s -> "?").collect(Collectors.toList());
// At this point, only aNames that did not encounter an exception onDelete will be deleted
jdbcTemplate.update(
String.format(SQL.DELETE_DEFINITION_METADATA, Joiner.on(",").skipNulls().join(paramVariables)),
(Object[]) aNames);
}
if (aPartitionNames.length > 0) {
final List<String> paramVariables =
Arrays.stream(aPartitionNames).map(s -> "?").collect(Collectors.toList());
// At this point, only aPartitionNames that did not encounter an exception onDelete will be deleted
jdbcTemplate.update(
String.format(SQL.DELETE_PARTITION_DEFINITION_METADATA,
Joiner.on(",").skipNulls().join(paramVariables)), (Object[]) aPartitionNames);
Expand Down

0 comments on commit 5b65e65

Please sign in to comment.