ayushtkn commented on code in PR #4215:
URL: https://github.com/apache/hadoop/pull/4215#discussion_r1107967867
##########
hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/io/WritableName.java:
##########
@@ -79,20 +79,42 @@ public static synchronized String getName(Class<?>
writableClass) {
return writableClass.getName();
}
+ /**
+ * Return the class for a name. Requires the class for name to extend
Writable.
+ * See {@link #getClass(String, Configuration, boolean)} if class doesn't
extend Writable.
+ * Default is {@link Class#forName(String)}.
+ *
+ * @param name input name.
+ * @param conf input configuration.
+ * @return class for a name.
+ * @throws IOException raised on errors performing I/O.
+ */
+ public static synchronized Class<?> getClass(String name, Configuration conf)
+ throws IOException {
+ return getClass(name, conf, true);
+ }
+
/**
* Return the class for a name.
* Default is {@link Class#forName(String)}.
*
* @param name input name.
* @param conf input configuration.
+ * @param requireWritable if true, require the class for name to extend
Writable
* @return class for a name.
* @throws IOException raised on errors performing I/O.
*/
- public static synchronized Class<?> getClass(String name, Configuration conf
- ) throws IOException {
+ public static synchronized Class<?> getClass(String name, Configuration conf,
+ boolean requireWritable) throws IOException {
Review Comment:
Go ahead
--
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]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]