Skip to content

Commit 93b2c57

Browse files
yingjianwu98Yingjian Wu
andauthored
improve nit (#603)
Co-authored-by: Yingjian Wu <[email protected]>
1 parent b585cda commit 93b2c57

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

metacat-main/src/main/java/com/netflix/metacat/main/api/v1/ParentChildRelController.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,11 +75,11 @@ public Set<ChildInfoDto> getChildren(
7575
}
7676

7777
/**
78-
* Return the list of children for a given table.
78+
* Return the list of parent for a given table.
7979
* @param catalogName catalogName
8080
* @param databaseName databaseName
8181
* @param tableName tableName
82-
* @return list of childInfoDto
82+
* @return list of parentInfoDto
8383
*/
8484
@RequestMapping(method = RequestMethod.GET,
8585
path = "/parents/catalog/{catalog-name}/database/{database-name}/table/{table-name}")

metacat-metadata-mysql/src/main/java/com/netflix/metacat/metadata/mysql/MySqlParentChildRelMetaDataService.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ private void validateMaxAllow(final QualifiedName parentName,
117117
true
118118
);
119119

120-
// Then check if the parent have configured max allowed on the db config
120+
// Then check if the parent has a configured max allowed setting on the db config
121121
if (maxAllow == null) {
122122
maxAllow = getMaxAllowedFromNestedMap(
123123
parentName,
@@ -127,7 +127,7 @@ private void validateMaxAllow(final QualifiedName parentName,
127127
);
128128
}
129129

130-
// If not specified in maxAllowPerDBPerRelType,check the default max Allow based on relationType
130+
// If not specified in maxAllowPerDBPerRelType,check the default maxAllow based on relationType
131131
if (maxAllow == null) {
132132
final Integer count = props.getDefaultMaxAllowPerRelType().get(type);
133133
if (count != null) {
@@ -140,7 +140,7 @@ private void validateMaxAllow(final QualifiedName parentName,
140140
maxAllow = props.getMaxAllow();
141141
}
142142

143-
// if maxAllow < 0, this means we can create as many child table under the parent
143+
// if maxAllow < 0, this means we can create unlimited child tables under the parent
144144
if (maxAllow < 0) {
145145
return;
146146
}
@@ -164,15 +164,15 @@ private void validateCreate(final QualifiedName parentName,
164164
if (!childParents.isEmpty()) {
165165
throw new ParentChildRelServiceException("Cannot have a child table having more than one parent "
166166
+ "- Child Table: " + childName
167-
+ " already have a parent Table=" + childParents.stream().findFirst().get());
167+
+ " already have a parent Table=" + childParents.stream().findFirst().get().getName());
168168
}
169169

170170
// Validation to prevent creating a child table as a parent of another child table
171171
final Set<ParentInfo> parentParents = getParents(parentName);
172172
if (!parentParents.isEmpty()) {
173173
throw new ParentChildRelServiceException("Cannot create a child table as parent "
174174
+ "- parent table: " + parentName
175-
+ " already have a parent table = " + parentParents.stream().findFirst().get());
175+
+ " already have a parent table = " + parentParents.stream().findFirst().get().getName());
176176
}
177177

178178
// Validation to prevent creating a parent on top of a table that have children

0 commit comments

Comments
 (0)