Commit 8c963d39 authored by unknown's avatar unknown
Browse files

Remove old and usused configuration locking code.

Some new code that does this job is being written against 5.1. This code is
largely removed from that work.


ndb/include/kernel/GlobalSignalNumbers.h:
  remove dead (never used) MGM_(UN)LOCK signal numbers
ndb/src/mgmsrv/Config.cpp:
  remove unused generation number code.
  
  remove unused Config::change
ndb/src/mgmsrv/Config.hpp:
  remove unused generation number prototypes.
ndb/src/mgmsrv/MgmtSrvr.cpp:
  remove unused getPrimaryNode
ndb/src/mgmsrv/MgmtSrvr.hpp:
  remove prototypes for config lock and commit/rollback.
ndb/src/mgmsrv/MgmtSrvrConfig.cpp:
  remove CONFIG (UN)LOCK signals, lockConf/unlockConf, commit/rollback and changeConfig.
  
  never used.
ndb/src/mgmsrv/Services.cpp:
  remove unused configuration locking code
ndb/src/mgmsrv/Services.hpp:
  remove usused configuration locking code
parent f1cc9494
Loading
Loading
Loading
Loading
+0 −8
Original line number Diff line number Diff line
@@ -834,14 +834,6 @@ extern const GlobalSignalNumber NO_OF_SIGNAL_NAMES;
/* Start Global Replication */
#define GSN_GREP_REQ                    656

/**
 * Management server
 */
#define GSN_MGM_LOCK_CONFIG_REQ		657
#define GSN_MGM_LOCK_CONFIG_REP		658
#define GSN_MGM_UNLOCK_CONFIG_REQ	659
#define GSN_MGM_UNLOCK_CONFIG_REP	660

#define GSN_UTIL_CREATE_LOCK_REQ        132
#define GSN_UTIL_CREATE_LOCK_REF        133
#define GSN_UTIL_CREATE_LOCK_CONF       188
+0 −87
Original line number Diff line number Diff line
@@ -179,90 +179,3 @@ void Config::printConfigFile(NdbOut &out) const {
  }
#endif
}

Uint32
Config::getGenerationNumber() const {
#if 0
  Uint32 ret;
  const Properties *prop = NULL;

  get("SYSTEM", &prop);

  if(prop != NULL)
    if(prop->get("ConfigGenerationNumber", &ret))
      return ret;
  
  return 0;
#else
  return 0;
#endif
}

int
Config::setGenerationNumber(Uint32 gen) {
#if 0
  Properties *prop = NULL;

  getCopy("SYSTEM", &prop);

  if(prop != NULL) {
    MGM_REQUIRE(prop->put("ConfigGenerationNumber", gen, true));
    MGM_REQUIRE(put("SYSTEM", prop, true));
    return 0;
  }
  return -1;
#else
  return -1;
#endif
}

bool
Config::change(const BaseString &section,
	       const BaseString &param,
	       const BaseString &value) {
#if 0
  const char *name;
  Properties::Iterator it(this);

  for(name = it.first(); name != NULL; name = it.next()) {
    Properties *prop = NULL;
    if(strcasecmp(section.c_str(), name) == 0) {
      getCopy(name, &prop);
      if(prop == NULL) /* doesn't exist */
	return false;
      if(value == "") {
	prop->remove(param.c_str());
	put(section.c_str(), prop, true);
      } else {
	PropertiesType t;
	if(!prop->getTypeOf(param.c_str(), &t)) /* doesn't exist */
	  return false;
	switch(t) {
	case PropertiesType_Uint32:
	  long val;
	  char *ep;
	  errno = 0;
	  val = strtol(value.c_str(), &ep, 0);
	  if(value.length() == 0 || *ep != '\0')  /* not a number */
	    return false;
	  if(errno == ERANGE)
	    return false;
	  prop->put(param.c_str(), (unsigned int)val, true);
	  put(section.c_str(), prop, true);
	  break;
	case PropertiesType_char:
	  prop->put(param.c_str(), value.c_str(), true);
	  put(section.c_str(), prop, true);
	  break;
	default:
	  return false;
	}
      }
      break;
    }
  }
  return true;
#else
  return false;
#endif
}
+0 −10
Original line number Diff line number Diff line
@@ -60,16 +60,6 @@ public:
    printConfigFile(ndb);
  }

  Uint32 getGenerationNumber() const;
  int setGenerationNumber(Uint32);

  /** Change configuration
   */
  bool change(const BaseString &section,
	      const BaseString &param,
	      const BaseString &value);


  /**
   * Info
   */
+0 −20
Original line number Diff line number Diff line
@@ -2086,26 +2086,6 @@ MgmtSrvr::repCommand(Uint32* repReqId, Uint32 request, bool waitCompleted)
  return 0;
}


NodeId
MgmtSrvr::getPrimaryNode() const {
#if 0
  Uint32 tmp;
  const Properties *prop = NULL;

  getConfig()->get("SYSTEM", &prop);
  if(prop == NULL)
    return 0;

  prop->get("PrimaryMGMNode", &tmp);
  
  return tmp;
#else
  return 0;
#endif
}


MgmtSrvr::Allocated_resources::Allocated_resources(MgmtSrvr &m)
  : m_mgmsrv(m)
{
+0 −36
Original line number Diff line number Diff line
@@ -214,27 +214,6 @@ public:
  // NO_CONTACT_WITH_PROCESS, PROCESS_NOT_CONFIGURED, WRONG_PROCESS_TYPE,
  // COULD_NOT_ALLOCATE_MEMORY, SEND_OR_RECEIVE_FAILED


  /**
   * Lock configuration
   */
  int lockConf();

  /**
   * Unlock configuration, and commit it if commit is true
   */
  int unlockConf(bool commit);

  /**
   * Commit new configuration
   */
  int commitConfig();

  /**
   * Rollback configuration
   */
  int rollbackConfig();

  /**
   * Save a configuration to permanent storage
   */
@@ -462,13 +441,6 @@ public:
   */
  const Config * getConfig() const;

  /**
   *   Change configuration paramter
   */
  bool changeConfig(const BaseString &section,
		    const BaseString &param,
		    const BaseString &value);

  /**
   * Returns the node count for the specified node type.
   *
@@ -477,11 +449,6 @@ public:
   */
  int getNodeCount(enum ndb_mgm_node_type type) const;

  /**
   * Returns the nodeId of the management master
   */
  NodeId getPrimaryNode() const;

  /**
   * Returns the port number.
   * @return port number.
@@ -572,9 +539,6 @@ private:
  // Returns: -
  //**************************************************************************

  void handle_MGM_LOCK_CONFIG_REQ(NdbApiSignal *signal);
  void handle_MGM_UNLOCK_CONFIG_REQ(NdbApiSignal *signal);

  //**************************************************************************
  // Specific signal handling data
  //**************************************************************************
Loading