From 93b2c57d75ad23420e7f95e122215770295b16de Mon Sep 17 00:00:00 2001 From: stevie9868 <151791653+stevie9868@users.noreply.github.com> Date: Tue, 9 Jul 2024 12:35:57 -0400 Subject: [PATCH] improve nit (#603) Co-authored-by: Yingjian Wu --- .../metacat/main/api/v1/ParentChildRelController.java | 4 ++-- .../mysql/MySqlParentChildRelMetaDataService.java | 10 +++++----- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/metacat-main/src/main/java/com/netflix/metacat/main/api/v1/ParentChildRelController.java b/metacat-main/src/main/java/com/netflix/metacat/main/api/v1/ParentChildRelController.java index 6eff65f4..f7836d84 100644 --- a/metacat-main/src/main/java/com/netflix/metacat/main/api/v1/ParentChildRelController.java +++ b/metacat-main/src/main/java/com/netflix/metacat/main/api/v1/ParentChildRelController.java @@ -75,11 +75,11 @@ public Set getChildren( } /** - * Return the list of children for a given table. + * Return the list of parent for a given table. * @param catalogName catalogName * @param databaseName databaseName * @param tableName tableName - * @return list of childInfoDto + * @return list of parentInfoDto */ @RequestMapping(method = RequestMethod.GET, path = "/parents/catalog/{catalog-name}/database/{database-name}/table/{table-name}") diff --git a/metacat-metadata-mysql/src/main/java/com/netflix/metacat/metadata/mysql/MySqlParentChildRelMetaDataService.java b/metacat-metadata-mysql/src/main/java/com/netflix/metacat/metadata/mysql/MySqlParentChildRelMetaDataService.java index 742d1503..d5226244 100644 --- a/metacat-metadata-mysql/src/main/java/com/netflix/metacat/metadata/mysql/MySqlParentChildRelMetaDataService.java +++ b/metacat-metadata-mysql/src/main/java/com/netflix/metacat/metadata/mysql/MySqlParentChildRelMetaDataService.java @@ -117,7 +117,7 @@ private void validateMaxAllow(final QualifiedName parentName, true ); - // Then check if the parent have configured max allowed on the db config + // Then check if the parent has a configured max allowed setting on the db config if (maxAllow == null) { maxAllow = getMaxAllowedFromNestedMap( parentName, @@ -127,7 +127,7 @@ private void validateMaxAllow(final QualifiedName parentName, ); } - // If not specified in maxAllowPerDBPerRelType,check the default max Allow based on relationType + // If not specified in maxAllowPerDBPerRelType,check the default maxAllow based on relationType if (maxAllow == null) { final Integer count = props.getDefaultMaxAllowPerRelType().get(type); if (count != null) { @@ -140,7 +140,7 @@ private void validateMaxAllow(final QualifiedName parentName, maxAllow = props.getMaxAllow(); } - // if maxAllow < 0, this means we can create as many child table under the parent + // if maxAllow < 0, this means we can create unlimited child tables under the parent if (maxAllow < 0) { return; } @@ -164,7 +164,7 @@ private void validateCreate(final QualifiedName parentName, if (!childParents.isEmpty()) { throw new ParentChildRelServiceException("Cannot have a child table having more than one parent " + "- Child Table: " + childName - + " already have a parent Table=" + childParents.stream().findFirst().get()); + + " already have a parent Table=" + childParents.stream().findFirst().get().getName()); } // Validation to prevent creating a child table as a parent of another child table @@ -172,7 +172,7 @@ private void validateCreate(final QualifiedName parentName, if (!parentParents.isEmpty()) { throw new ParentChildRelServiceException("Cannot create a child table as parent " + "- parent table: " + parentName - + " already have a parent table = " + parentParents.stream().findFirst().get()); + + " already have a parent table = " + parentParents.stream().findFirst().get().getName()); } // Validation to prevent creating a parent on top of a table that have children