Uploaded image for project: 'Cassandra'
  1. Cassandra
  2. CASSANDRA-3986

Cli shouldn't call FBU.getBroadcastAddress needlessly

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Fix Version/s: 1.0.9, 1.1.0
    • Component/s: None
    • Labels:
      None

      Description

      The cli is calling this, which causes yaml to be loaded, but the broadcast address isn't needed.

                  // adding default data center from SimpleSnitch
                  if (currentStrategyOptions == null || currentStrategyOptions.isEmpty())
                  {
                      SimpleSnitch snitch = new SimpleSnitch();
                      Map<String, String> options = new HashMap<String, String>();
                      options.put(snitch.getDatacenter(FBUtilities.getBroadcastAddress()), "1");
      
                      ksDef.setStrategy_options(options);
                  }
      

      because SimpleSnitch always returns 'datacenter1'

      1. 3986.txt
        0.7 kB
        Brandon Williams

        Activity

        Hide
        dbrosius@apache.org Dave Brosius added a comment - - edited

        +1

        Getting user reports that this is causing cli on windows to fail due to not being able to load the yaml for some reason (when creating keyspaces)

        Show
        dbrosius@apache.org Dave Brosius added a comment - - edited +1 Getting user reports that this is causing cli on windows to fail due to not being able to load the yaml for some reason (when creating keyspaces)
        Hide
        brandon.williams Brandon Williams added a comment -

        Committed. Probably only causes a problem on windows because the cli doesn't have the yaml in the classpath from the bat file.

        Show
        brandon.williams Brandon Williams added a comment - Committed. Probably only causes a problem on windows because the cli doesn't have the yaml in the classpath from the bat file.
        Hide
        leekh Emotion added a comment -

        how to solve the proublem???

        i don't know...
        ============================================================
        if (currentStrategyOptions == null || currentStrategyOptions.isEmpty())

        { SimpleSnitch snitch = new SimpleSnitch(); Map<String, String> options = new HashMap<String, String>(); options.put(snitch.getDatacenter(FBUtilities.getBroadcastAddress()), "1"); ksDef.setStrategy_options(options); }

        insert in cassandra-cli.bat??
        ============================================================
        please help me..

        Show
        leekh Emotion added a comment - how to solve the proublem??? i don't know... ============================================================ if (currentStrategyOptions == null || currentStrategyOptions.isEmpty()) { SimpleSnitch snitch = new SimpleSnitch(); Map<String, String> options = new HashMap<String, String>(); options.put(snitch.getDatacenter(FBUtilities.getBroadcastAddress()), "1"); ksDef.setStrategy_options(options); } insert in cassandra-cli.bat?? ============================================================ please help me..

          People

          • Assignee:
            brandon.williams Brandon Williams
            Reporter:
            brandon.williams Brandon Williams
            Reviewer:
            Dave Brosius
          • Votes:
            1 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development