Uploaded image for project: 'Apache Knox'
  1. Apache Knox
  2. KNOX-713

Knox Shell HDFS.get.Request is Package Private

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • 0.11.0
    • ClientDSL
    • None

    Description

      As raised on the user@ list by Chris Snow, the Knox ClientDSL classes for the HDFS Request are package private. This causes compilation errors when developing a program that leverages them in a different package namespace.

      Chris provided the following example:

      package net.christophersnow;
      
      import org.apache.hadoop.gateway.shell.Hadoop;
      import org.apache.hadoop.gateway.shell.hdfs.Hdfs;
      
      public class TestKnox {
          public static void main(String[] args) {
          	Hadoop session = Hadoop.login( "test", "test", "test" );
          	String text = Hdfs.get( session ).from( "test" ).now().getString();   	
          	session.shutdown();
          }
      }
      

      Which results in the following errors:

      :compileJava/home/travis/build/snowch/knox-java-example/src/main/java/net/christophersnow/TestKnox.java:12: error: from(String) in Request is defined in an inaccessible class or interface
          	String text = Hdfs.get( session ).from( "test" ).now().getString();
          	                                 ^
      /home/travis/build/snowch/knox-java-example/src/main/java/net/christophersnow/TestKnox.java:12: error: now() in AbstractRequest is defined in an inaccessible class or interface
          	String text = Hdfs.get( session ).from( "test" ).now().getString();
          	                                                ^
        where T is a type-variable:
          T extends Object declared in class AbstractRequest
      /home/travis/build/snowch/knox-java-example/src/main/java/net/christophersnow/TestKnox.java:12: error: getString() in BasicResponse is defined in an inaccessible class or interface
          	String text = Hdfs.get( session ).from( "test" ).now().getString();
          	                                                      ^
      3 errors
       FAILED
      

      The Request inner classes need to be made public across all of the service clientDSL code.

      Attachments

        Activity

          People

            lmccay Larry McCay
            lmccay Larry McCay
            Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: