Uploaded image for project: 'Hadoop YARN'
  1. Hadoop YARN
  2. YARN-3794

TestRMEmbeddedElector fails because of ambiguous LOG reference

VotersWatch issueWatchersCreate sub-taskLinkCloneUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 2.7.0
    • 2.8.0, 3.0.0-alpha1
    • test
    • None
    • Reviewed

    Description

      After YARN-2921, MockRM has also a LOG field. Therefore LOG in the following code snippet is ambiguous.

          protected AdminService createAdminService() {
            return new AdminService(MockRMWithElector.this, getRMContext()) {
              @Override
              protected EmbeddedElectorService createEmbeddedElectorService() {
                return new EmbeddedElectorService(getRMContext()) {
                  @Override
                  public void becomeActive() throws
                      ServiceFailedException {
                    try {
                      callbackCalled.set(true);
                      LOG.info("Callback called. Sleeping now");
                      Thread.sleep(delayMs);
                      LOG.info("Sleep done");
                    } catch (InterruptedException e) {
                      e.printStackTrace();
                    }
                    super.becomeActive();
                  }
                };
              }
            };
          }
      

      Eclipse gives the following error:

      The field LOG is defined in an inherited type and an enclosing scope

      IMO, we should fix this as TestRMEmbeddedElector.LOG

      Attachments

        1. YARN-3794.01.patch
          1 kB
          Chengbing Liu

        Activity

          This comment will be Viewable by All Users Viewable by All Users
          Cancel

          People

            chengbing.liu Chengbing Liu
            chengbing.liu Chengbing Liu
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Issue deployment