When I implement Hadoop Mapper or Reducer in Kotlin, I get an interesting contradiction with the compiler. Each time you use a Context object, the compiler generates the error message โ4 type argumentsโ if you do not specify type arguments ( <KEYIN, VALUEIN, KEYOUT, VALUEOUT> ), and says โNo type argumentsโ if you use arguments type of suggestion, Any ideas what happens here?
Example:
// gives "4 type arguments expected" override fun setup(context: Context?) { super.setup(context) } // gives "No type arguments expected" override fun setup(context: Context<KeyIn, ValueIn, KeyOut, ValueOut>?) { super.setup(context) }
Setting Mapper<KeyIn, ValueIn, KeyOut, ValueOut>.Context does the compilation, but since Context is an internal Mapper class, you should not imply the type of Context when you specify the type of Mapper that you are using extends, as in Java?
source share