Commit 11a2a356 authored by unknown's avatar unknown
Browse files

ndb - removed deprecated Ndb constructor


ndb/include/ndbapi/Ndb.hpp:
  removed deprecated methods
ndb/src/ndbapi/NdbPool.cpp:
  removed deprecated methods
ndb/src/ndbapi/NdbPoolImpl.cpp:
  removed deprecated methods
ndb/src/ndbapi/NdbPoolImpl.hpp:
  removed deprecated methods
ndb/src/ndbapi/Ndbinit.cpp:
  removed deprecated methods
ndb/tools/delete_all.cpp:
  removed deprecated methods
ndb/tools/desc.cpp:
  removed deprecated methods
ndb/tools/drop_index.cpp:
  removed deprecated methods
ndb/tools/drop_tab.cpp:
  removed deprecated methods
ndb/tools/restore/consumer_restore.cpp:
  removed deprecated methods
ndb/tools/restore/consumer_restore.hpp:
  removed deprecated methods
ndb/tools/restore/restore_main.cpp:
  removed deprecated methods
ndb/tools/select_all.cpp:
  removed deprecated methods
ndb/tools/select_count.cpp:
  removed deprecated methods
parent a61ef102
Loading
Loading
Loading
Loading
+0 −10
Original line number Diff line number Diff line
@@ -1038,9 +1038,6 @@ public:
  Ndb(Ndb_cluster_connection *ndb_cluster_connection,
      const char* aCatalogName = "", const char* aSchemaName = "def");

#ifndef DOXYGEN_SHOULD_SKIP_DEPRECATED
  Ndb(const char* aCatalogName = "", const char* aSchemaName = "def");
#endif
  ~Ndb();

#ifndef DOXYGEN_SHOULD_SKIP_INTERNAL
@@ -1349,13 +1346,6 @@ public:
   */
  int getNodeId();

  /**
   * setConnectString
   *
   * @param connectString - see MySQL ref manual for format
   */
  static void setConnectString(const char * connectString);

  bool usingFullyQualifiedNames();

  /**
+4 −2
Original line number Diff line number Diff line
@@ -21,14 +21,16 @@
static NdbPool* m_pool = 0;

bool
create_instance(Uint32 max_ndb_objects,
create_instance(Ndb_cluster_connection* cc,
		Uint32 max_ndb_objects,
                Uint32 no_conn_obj,
                Uint32 init_no_ndb_objects)
{
  if (m_pool != NULL) {
    return false;
  }
  m_pool = NdbPool::create_instance(max_ndb_objects,
  m_pool = NdbPool::create_instance(cc, 
				    max_ndb_objects,
                                    no_conn_obj,
                                    init_no_ndb_objects);
  if (m_pool == NULL) {
+8 −5
Original line number Diff line number Diff line
@@ -20,7 +20,8 @@ NdbMutex *NdbPool::pool_mutex = NULL;
NdbPool *the_pool = NULL;

NdbPool*
NdbPool::create_instance(Uint32 max_ndb_obj,
NdbPool::create_instance(Ndb_cluster_connection* cc,
			 Uint32 max_ndb_obj,
                         Uint32 no_conn_obj,
                         Uint32 init_no_ndb_objects)
{
@@ -32,7 +33,7 @@ NdbPool::create_instance(Uint32 max_ndb_obj,
  if (the_pool != NULL) {
    a_pool = NULL;
  } else {
    the_pool = new NdbPool(max_ndb_obj, no_conn_obj);
    the_pool = new NdbPool(cc, max_ndb_obj, no_conn_obj);
    if (!the_pool->init(init_no_ndb_objects)) {
      delete the_pool;
      the_pool = NULL;
@@ -76,7 +77,8 @@ NdbPool::initPoolMutex()
  return ret_result;
}

NdbPool::NdbPool(Uint32 max_no_objects,
NdbPool::NdbPool(Ndb_cluster_connection* cc,
		 Uint32 max_no_objects,
                 Uint32 no_conn_objects)
{
  if (no_conn_objects > 1024) {
@@ -101,6 +103,7 @@ NdbPool::NdbPool(Uint32 max_no_objects,
  m_output_queue = 0;
  m_input_queue = 0;
  m_signal_count = 0;
  m_cluster_connection = cc;
}

NdbPool::~NdbPool()
@@ -294,9 +297,9 @@ NdbPool::allocate_ndb(Uint32 &id,
    return false;
  }
  if (a_schema_name) {
    a_ndb = new Ndb(a_schema_name, a_catalog_name);
    a_ndb = new Ndb(m_cluster_connection, a_schema_name, a_catalog_name);
  } else {
    a_ndb = new Ndb("");
    a_ndb = new Ndb(m_cluster_connection, "");
  }
  if (a_ndb == NULL) {
    return false;
+6 −2
Original line number Diff line number Diff line
@@ -92,7 +92,8 @@ class NdbPool {
    Uint16 prev_db_object;
  };
  public:
    static NdbPool* create_instance(Uint32 max_ndb_objects = 240,
    static NdbPool* create_instance(Ndb_cluster_connection*,
				    Uint32 max_ndb_objects = 240,
                                    Uint32 no_conn_obj = 4,
                                    Uint32 init_no_ndb_objects = 8);
    static void drop_instance();
@@ -104,7 +105,8 @@ class NdbPool {
    bool init(Uint32 initial_no_of_ndb_objects = 8);
    void release_all();
    static bool initPoolMutex();
    NdbPool(Uint32 max_no_of_ndb_objects, Uint32 no_conn_objects);
    NdbPool(Ndb_cluster_connection*, 
	    Uint32 max_no_of_ndb_objects, Uint32 no_conn_objects);
    ~NdbPool();
  /*
  We have three lists:
@@ -158,5 +160,7 @@ class NdbPool {
    Uint16      m_input_queue;
    Uint16      m_output_queue;
    Uint16      m_signal_count;

  Ndb_cluster_connection * m_cluster_connection;
};
#endif
+0 −59
Original line number Diff line number Diff line
@@ -34,48 +34,12 @@ class NdbGlobalEventBufferHandle;
NdbGlobalEventBufferHandle *NdbGlobalEventBuffer_init(int);
void NdbGlobalEventBuffer_drop(NdbGlobalEventBufferHandle *);

/**
 * Static object for NDB
 */

// only needed for backwards compatability, before ndb_cluster_connection
static char *ndbConnectString = 0;
static int theNoOfNdbObjects = 0;
static Ndb_cluster_connection *global_ndb_cluster_connection= 0;


/***************************************************************************
Ndb(const char* aDataBase);

Parameters:    aDataBase : Name of the database.
Remark:        Connect to the database.
***************************************************************************/
Ndb::Ndb( const char* aDataBase , const char* aSchema)
  : theImpl(NULL)
{
  DBUG_ENTER("Ndb::Ndb()");
  DBUG_PRINT("enter",("(old)Ndb::Ndb this=0x%x", this));
  if (theNoOfNdbObjects < 0)
    abort(); // old and new Ndb constructor used mixed
  theNoOfNdbObjects++;
  if (global_ndb_cluster_connection == 0) {
    global_ndb_cluster_connection= new Ndb_cluster_connection(ndbConnectString);
    global_ndb_cluster_connection->connect(12,5,1);
  }
  setup(global_ndb_cluster_connection, aDataBase, aSchema);
  DBUG_VOID_RETURN;
}

Ndb::Ndb( Ndb_cluster_connection *ndb_cluster_connection,
	  const char* aDataBase , const char* aSchema)
  : theImpl(NULL)
{
  DBUG_ENTER("Ndb::Ndb()");
  DBUG_PRINT("enter",("Ndb::Ndb this=0x%x", this));
  if (global_ndb_cluster_connection != 0 &&
      global_ndb_cluster_connection != ndb_cluster_connection)
    abort(); // old and new Ndb constructor used mixed
  theNoOfNdbObjects= -1;
  setup(ndb_cluster_connection, aDataBase, aSchema);
  DBUG_VOID_RETURN;
}
@@ -177,16 +141,6 @@ void Ndb::setup(Ndb_cluster_connection *ndb_cluster_connection,
}


void Ndb::setConnectString(const char * connectString)
{
  if (ndbConnectString != 0) {
    free(ndbConnectString);
    ndbConnectString = 0;
  }
  if (connectString)
    ndbConnectString = strdup(connectString);
}

/*****************************************************************************
 * ~Ndb();
 *
@@ -241,19 +195,6 @@ Ndb::~Ndb()

  delete theImpl;

  /**
   * This needs to be put after delete theImpl
   *  as TransporterFacade::instance is delete by global_ndb_cluster_connection
   *  and used by theImpl
   */
  if (global_ndb_cluster_connection != 0) {
    theNoOfNdbObjects--;
    if(theNoOfNdbObjects == 0){
      delete global_ndb_cluster_connection;
      global_ndb_cluster_connection= 0;
    }
  }//if

  /** 
   *  This sleep is to make sure that the transporter 
   *  send thread will come in and send any
Loading