vinothchandar commented on code in PR #10607:
URL: https://github.com/apache/hudi/pull/10607#discussion_r1480709431
##########
hudi-io/src/main/java/org/apache/hudi/storage/HoodieLocation.java:
##########
@@ -186,6 +186,51 @@ public URI toUri() {
return uri;
}
+ /**
+ * Returns a qualified location object.
+ *
+ * @param defaultUri if this location is missing the scheme or authority
+ * components, borrow them from this URI.
+ * @return this location if it contains a scheme and authority, or
+ * a new path that includes a path and authority and is fully qualified.
+ */
+ @PublicAPIMethod(maturity = ApiMaturityLevel.EVOLVING)
+ public HoodieLocation makeQualified(URI defaultUri) {
Review Comment:
this ought to be a static method? I think we should instead make this a new
constructor in `HoodieLocation`?
##########
hudi-io/src/main/java/org/apache/hudi/storage/HoodieLocation.java:
##########
@@ -186,6 +186,51 @@ public URI toUri() {
return uri;
}
+ /**
+ * Returns a qualified location object.
+ *
+ * @param defaultUri if this location is missing the scheme or authority
+ * components, borrow them from this URI.
+ * @return this location if it contains a scheme and authority, or
+ * a new path that includes a path and authority and is fully qualified.
+ */
+ @PublicAPIMethod(maturity = ApiMaturityLevel.EVOLVING)
+ public HoodieLocation makeQualified(URI defaultUri) {
+ if (!isAbsolute()) {
+ throw new IllegalStateException("Only an absolute path can be made
qualified");
+ }
+ HoodieLocation location = this;
Review Comment:
found this a bit weird. the assignment from `this`. is that needed?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]