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

TestRMEmbeddedElector fails because of ambiguous LOG reference

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 2.7.0
    • Fix Version/s: 2.8.0, 3.0.0-alpha1
    • Component/s: test
    • Labels:
      None
    • Hadoop Flags:
      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

          Activity

            People

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

              Dates

              • Created:
                Updated:
                Resolved: