IT training MySQL cluster API developer guide

502 252 0
IT training MySQL cluster API developer guide

Đang tải... (xem toàn văn)

Tài liệu hạn chế xem trước, để xem đầy đủ mời bạn chọn Tải xuống

Thông tin tài liệu

The MySQL Cluster API Developer Guide Version 3.0 (2010-10-03) The MySQL Cluster API Developer Guide: Version 3.0 (2010-10-03) The MySQL Cluster API Developer Guide Document generated on: 2010-10-01 (revision: 22948) This guide provides information for developers wishing to develop applications against MySQL Cluster These include: • The low-level C++-language NDB API for the MySQL NDBCLUSTER storage engine • the C-language MGM API for communicating with and controlling MySQL Cluster management servers • The MySQL Cluster Connector for Java, which is a a collection of Java APIs introduced in MySQL Cluster NDB 7.1 for writing applications against MySQL Cluster, including JDBC, JPA, and ClusterJ This Guide includes concepts, terminology, class and function references, practical examples, common problems, and tips for using these APIs in applications It also contains information about NDB internals that may be of interest to developers working with NDBCLUSTER, such as communication protocols employed between nodes, filesystems used by data nodes, and error messages The information presented in this guide is current for recent MySQL Cluster NDB 6.2, NDB 6.3, NDB 7.0, and NDB 7.1 releases You should be aware that there have been significant changes in the NDB API, MGM API, and other particulars in MySQL Cluster versions since MySQL 5.1.12 Copyright © 2003, 2010, Oracle and/or its affiliates All rights reserved This software and related documentation are provided under a license agreement containing restrictions on use and disclosure and are protected by intellectual property laws Except as expressly permitted in your license agreement or allowed by law, you may not use, copy, reproduce, translate, broadcast, modify, license, transmit, distribute, exhibit, perform, publish, or display any part, in any form, or by any means Reverse engineering, disassembly, or decompilation of this software, unless required by law for interoperability, is prohibited The information contained herein is subject to change without notice and is not warranted to be error-free If you find any errors, please report them to us in writing If this software or related documentation is delivered to the U.S Government or anyone licensing it on behalf of the U.S Government, the following notice is applicable: U.S GOVERNMENT RIGHTS Programs, software, databases, and related documentation and technical data delivered to U.S Government customers are "commercial computer software" or "commercial technical data" pursuant to the applicable Federal Acquisition Regulation and agencyspecific supplemental regulations As such, the use, duplication, disclosure, modification, and adaptation shall be subject to the restrictions and license terms set forth in the applicable Government contract, and, to the extent applicable by the terms of the Government contract, the additional rights set forth in FAR 52.227-19, Commercial Computer Software License (December 2007) Oracle USA, Inc., 500 Oracle Parkway, Redwood City, CA 94065 This software is developed for general use in a variety of information management applications It is not developed or intended for use in any inherently dangerous applications, including applications which may create a risk of personal injury If you use this software in dangerous applications, then you shall be responsible to take all appropriate fail-safe, backup, redundancy, and other measures to ensure the safe use of this software Oracle Corporation and its affiliates disclaim any liability for any damages caused by use of this software in dangerous applications Oracle is a registered trademark of Oracle Corporation and/or its affiliates MySQL is a trademark of Oracle Corporation and/or its affiliates, and shall not be used without Oracle's express written authorization Other names may be trademarks of their respective owners This software and documentation may provide access to or information on content, products, and services from third parties Oracle Corporation and its affiliates are not responsible for and expressly disclaim all warranties of any kind with respect to third-party content, products, and services Oracle Corporation and its affiliates will not be responsible for any loss, costs, or damages incurred due to your access to or use of third-party content, products, or services This document in any form, software or printed matter, contains proprietary information that is the exclusive property of Oracle Your access to and use of this material is subject to the terms and conditions of your Oracle Software License and Service Agreement, which has been executed and with which you agree to comply This document and information contained herein may not be disclosed, copied, reproduced, or distributed to anyone outside Oracle without prior written consent of Oracle or as specifically provided below This document is not part of your license agreement nor can it be incorporated into any contractual agreement with Oracle or its subsidiaries or affiliates This documentation is NOT distributed under a GPL license Use of this documentation is subject to the following terms: You may create a printed copy of this documentation solely for your own personal use Conversion to other formats is allowed as long as the actual content is not altered or edited in any way You shall not publish or distribute this documentation in any form or on any media, except if you distribute the documentation in a manner similar to how Oracle disseminates it (that is, electronically for download on a Web site with the software) or on a CD-ROM or similar medium, provided however that the documentation is disseminated together with the software on the same medium Any other use, such as any dissemination of printed copies or use of this documentation, in whole or in part, in another publication, requires the prior written consent from an authorized representative of Oracle Oracle and/or its affiliates reserve any and all rights to this documentation not expressly granted above For more information on the terms of this license, for details on how the MySQL documentation is built and produced, or if you are interested in doing a translation, please visit http://www.mysql.com/company/contact/ If you want help with using MySQL, please visit either the MySQL Forums or MySQL Mailing Lists where you can discuss your issues with other MySQL users For additional documentation on MySQL products, including translations of the documentation into other languages, and downloadable versions in variety of formats, including HTML and PDF formats, see the MySQL Documentation Library Table of Contents Overview and Concepts 1.1 Introduction .1 1.1.1 The NDB API 1.1.2 The MGM API 1.2 Terminology 1.3 The NDBCLUSTER Transaction and Scanning API 1.3.1 Core NDB API Classes .3 1.3.2 Application Program Basics 1.3.3 Review of MySQL Cluster Concepts .9 1.3.4 The Adaptive Send Algorithm 10 The NDB API 12 2.1 Getting Started with the NDB API 12 2.1.1 Compiling and Linking NDB API Programs 12 2.1.2 Connecting to the Cluster 14 2.1.3 Mapping MySQL Database Object Names and Types to NDB 15 2.2 The NDB API Object Hierarachy 16 2.3 NDB API Classes, Interfaces, and Structures 17 2.3.1 The Column Class 18 2.3.2 The Datafile Class 32 2.3.3 The Dictionary Class 38 2.3.4 The Event Class 49 2.3.5 The Index Class 58 2.3.6 The LogfileGroup Class 64 2.3.7 The List Class 68 2.3.8 The Ndb Class 68 2.3.9 The NdbBlob Class 77 2.3.10 The NdbDictionary Class 86 2.3.11 The NdbEventOperation Class 88 2.3.12 The NdbIndexOperation Class 95 2.3.13 The NdbIndexScanOperation Class 97 2.3.14 The NdbInterpretedCode Class 102 2.3.15 The NdbOperation Class 122 2.3.16 The NdbRecAttr Class 134 2.3.17 The NdbScanFilter Class 140 2.3.18 The NdbScanOperation Class .149 2.3.19 The NdbTransaction Class 155 2.3.20 The Object Class .170 2.3.21 The Table Class 173 2.3.22 The Tablespace Class 192 2.3.23 The Undofile Class 196 2.3.24 The Ndb_cluster_connection Class 201 2.3.25 The NdbRecord Interface 207 2.3.26 The AutoGrowSpecification Structure 207 2.3.27 The Element Structure 208 2.3.28 The GetValueSpec Structure 209 2.3.29 The IndexBound Structure 209 2.3.30 The Key_part_ptr Structure 210 2.3.31 The NdbError Structure .210 2.3.32 The OperationOptions Structure 213 2.3.33 The PartitionSpec Structure 215 2.3.34 The RecordSpecification Structure 217 2.3.35 The ScanOptions Structure 217 2.3.36 The SetValueSpec Structure 219 2.4 NDB API Examples 220 2.4.1 Using Synchronous Transactions 220 2.4.2 Using Synchronous Transactions and Multiple Clusters 223 2.4.3 Handling Errors and Retrying Transactions 226 2.4.4 Basic Scanning Example 230 2.4.5 Using Secondary Indexes in Scans .239 2.4.6 Using NdbRecord with Hash Indexes 242 2.4.7 Comparing RecAttr and NdbRecord .246 2.4.8 NDB API Event Handling Example .279 2.4.9 Basic BLOB Handling Example 282 2.4.10 Handling BLOBs Using NdbRecord 288 v The MySQL Cluster API Developer Guide The MGM API 295 3.1 General Concepts .295 3.1.1 Working with Log Events 295 3.1.2 Structured Log Events .295 3.2 MGM C API Function Listing 296 3.2.1 Log Event Functions .296 3.2.2 MGM API Error Handling Functions 298 3.2.3 Management Server Handle Functions 299 3.2.4 Management Server Connection Functions .301 3.2.5 Cluster Status Functions 305 3.2.6 Functions for Starting & Stopping Nodes .306 3.2.7 Cluster Log Functions .311 3.2.8 Backup Functions 313 3.2.9 Single-User Mode Functions 314 3.3 MGM Data Types .315 3.3.1 The ndb_mgm_node_type Type .315 3.3.2 The ndb_mgm_node_status Type 315 3.3.3 The ndb_mgm_error Type .315 3.3.4 The Ndb_logevent_type Type .315 3.3.5 The ndb_mgm_event_severity Type 318 3.3.6 The ndb_logevent_handle_error Type .319 3.3.7 The ndb_mgm_event_category Type 319 3.4 MGM Structures 319 3.4.1 The ndb_logevent Structure 319 3.4.2 The ndb_mgm_node_state Structure .324 3.4.3 The ndb_mgm_cluster_state Structure 325 3.4.4 The ndb_mgm_reply Structure 325 3.5 MGM API Examples 325 3.5.1 Basic MGM API Event Logging Example 325 3.5.2 MGM API Event Handling with Multiple Clusters 327 MySQL Cluster Connector for Java 331 4.1 MySQL Cluster Connector for Java: Overview 331 4.1.1 MySQL Cluster Connector for Java Architecture 331 4.1.2 Java and MySQL Cluster 331 4.1.3 The ClusterJ API and Data Object Model .333 4.2 Using MySQL Cluster Connector for Java 335 4.2.1 Getting, Installing, and Setting Up MySQL Cluster Connector for Java 335 4.2.2 Using ClusterJ 336 4.2.3 Using JPA with MySQL Cluster 342 4.2.4 Using Connector/J with MySQL Cluster 343 4.3 ClusterJ API Reference 343 4.3.1 Package com.mysql.clusterj .343 4.3.2 Package com.mysql.clusterj.annotation 371 4.3.3 Package com.mysql.clusterj.query .381 4.4 MySQL Cluster Connector for Java: Limitations and Known Issues 387 MySQL Cluster API Errors 388 5.1 MGM API Errors .388 5.1.1 Request Errors 388 5.1.2 Node ID Allocation Errors 388 5.1.3 Service Errors .388 5.1.4 Backup Errors .389 5.1.5 Single User Mode Errors 389 5.1.6 General Usage Errors 389 5.2 NDB API Errors and Error Handling 389 5.2.1 Handling NDB API Errors 389 5.2.2 NDB Error Codes and Messages 392 5.2.3 NDB Error Classifications 411 5.3 ndbd Error Messages 412 5.3.1 ndbd Error Codes 412 5.3.2 ndbd Error Classifications 417 5.4 NDB Transporter Errors 417 MySQL Cluster Internals 419 6.1 MySQL Cluster File Systems .419 6.1.1 Cluster Data Node File System 419 6.1.2 Cluster Management Node File System 421 6.2 DUMP Commands .421 6.2.1 DUMP Codes to 999 422 6.2.2 DUMP Codes 1000 to 1999 429 6.2.3 DUMP Codes 2000 to 2999 431 6.2.4 DUMP Codes 3000 to 3999 446 vi The MySQL Cluster API Developer Guide 6.2.5 DUMP Codes 4000 to 4999 446 6.2.6 DUMP Codes 5000 to 5999 446 6.2.7 DUMP Codes 6000 to 6999 446 6.2.8 DUMP Codes 7000 to 7999 446 6.2.9 DUMP Codes 8000 to 8999 452 6.2.10 DUMP Codes 9000 to 9999 .453 6.2.11 DUMP Codes 10000 to 10999 455 6.2.12 DUMP Codes 11000 to 11999 455 6.2.13 DUMP Codes 12000 to 12999 455 6.3 The NDB Protocol 456 6.3.1 NDB Protocol Overview 456 6.3.2 Message Naming Conventions and Structure 457 6.3.3 Operations and Signals 457 6.4 NDB Kernel Blocks 466 6.4.1 The BACKUP Block 466 6.4.2 The CMVMI Block 467 6.4.3 The DBACC Block 467 6.4.4 The DBDICT Block 467 6.4.5 The DBDIH Block 468 6.4.6 DBLQH Block .468 6.4.7 The DBTC Block 469 6.4.8 The DBTUP Block 470 6.4.9 DBTUX Block .471 6.4.10 The DBUTIL Block .472 6.4.11 The LGMAN Block 472 6.4.12 The NDBCNTR Block .472 6.4.13 The NDBFS Block 473 6.4.14 The PGMAN Block 473 6.4.15 The QMGR Block 474 6.4.16 The RESTORE Block .474 6.4.17 The SUMA Block 474 6.4.18 The TSMAN Block 474 6.4.19 The TRIX Block 474 6.5 MySQL Cluster Start Phases 475 6.5.1 Initialization Phase (Phase -1) 475 6.5.2 Configuration Read Phase (STTOR Phase -1) 475 6.5.3 STTOR Phase .476 6.5.4 STTOR Phase .477 6.5.5 STTOR Phase .479 6.5.6 NDB_STTOR Phase 479 6.5.7 STTOR Phase .479 6.5.8 NDB_STTOR Phase 479 6.5.9 STTOR Phase .479 6.5.10 NDB_STTOR Phase .480 6.5.11 STTOR Phase 480 6.5.12 NDB_STTOR Phase .480 6.5.13 NDB_STTOR Phase .480 6.5.14 NDB_STTOR Phase .481 6.5.15 STTOR Phase 481 6.5.16 STTOR Phase 482 6.5.17 STTOR Phase 482 6.5.18 NDB_STTOR Phase .482 6.5.19 STTOR Phase 482 6.5.20 STTOR Phase 101 482 6.5.21 System Restart Handling in Phase 482 6.5.22 START_MEREQ Handling .483 6.6 NDB Internals Glossary 483 Index 485 vii Chapter Overview and Concepts This chapter provides a general overview of essential MySQL Cluster, NDB API, and MGM API concepts, terminology, and programming constructs For an overview of Java APIs that can be used with MySQL Cluster, see Section 4.1, “MySQL Cluster Connector for Java: Overview” 1.1 Introduction This section introduces the NDB Transaction and Scanning APIs as well as the NDB Management (MGM) API for use in building applications to run on MySQL Cluster It also discusses the general theory and principles involved in developing such applications 1.1.1 The NDB API The NDB API is an object-oriented application programming interface for MySQL Cluster that implements indexes, scans, transactions, and event handling NDB transactions are ACID-compliant in that they provide a means to group operations in such a way that they succeed (commit) or fail as a unit (rollback) It is also possible to perform operations in a "no-commit" or deferred mode, to be committed at a later time NDB scans are conceptually rather similar to the SQL cursors implemented in MySQL 5.0 and other common enterprise-level database management systems These provide high-speed row processing for record retrieval purposes (MySQL Cluster naturally supports set processing just as does MySQL in its non-Cluster distributions This can be accomplished through the usual MySQL APIs discussed in the MySQL Manual and elsewhere.) The NDB API supports both table scans and row scans; the latter can be performed using either unique or ordered indexes Event detection and handling is discussed in Section 2.3.11, “The NdbEventOperation Class”, as well as Section 2.4.8, “NDB API Event Handling Example” In addition, the NDB API provides object-oriented error-handling facilities in order to provide a means of recovering gracefully from failed operations and other problems See Section 2.4.3, “Handling Errors and Retrying Transactions”, for a detailed example The NDB API provides a number of classes implementing the functionality described above The most important of these include the Ndb, Ndb_cluster_connection, NdbTransaction, and NdbOperation classes These model (respectively) database connections, cluster connections, transactions, and operations These classes and their subclasses are listed in Section 2.3, “NDB API Classes, Interfaces, and Structures” Error conditions in the NDB API are handled using NdbError, a structure which is described in Section 2.3.31, “The NdbError Structure” 1.1.2 The MGM API The MySQL Cluster Management API, also known as the MGM API, is a C-language programming interface intended to provide administrative services for the cluster These include starting and stopping Cluster nodes, handling Cluster logging, backups, and restoration from backups, as well as various other management tasks A conceptual overview of MGM and its uses can be found in Chapter 3, The MGM API The MGM API's principal structures model the states of individual modes (ndb_mgm_node_state), the state of the Cluster as a whole (ndb_mgm_cluster_state), and management server response messages (ndb_mgm_reply) See Section 3.4, “MGM Structures”, for detailed descriptions of these 1.2 Terminology Provides a glossary of terms which are unique to the NDB and MGM APIs, or have a specialized meaning when applied therein The terms in the following list are useful to an understanding of MySQL Cluster, the NDB API, or have a specialized meaning when used in one of these contexts See also MySQL Cluster Overview, in the MySQL Manual • Backup: A complete copy of all cluster data, transactions and logs, saved to disk • Restore: Returning the cluster to a previous state as stored in a backup • Checkpoint: Generally speaking, when data is saved to disk, it is said that a checkpoint has been reached When working with the NDB storage engine, there are two sorts of checkpoints which work together in order to ensure that a consistent view of the cluster's data is maintained: • Local Checkpoint (LCP): This is a checkpoint that is specific to a single node; however, LCPs take place for all nodes in the cluster more or less concurrently An LCP involves saving all of a node's data to disk, and so usually occurs every few minutes, depending upon the amount of data stored by the node Overview and Concepts More detailed information about LCPs and their behavior can be found in the MySQL Manual, in the sections Defining MySQL Cluster Data Nodes, and Configuring MySQL Cluster Parameters for Local Checkpoints • Global Checkpoint (GCP): A GCP occurs every few seconds, when transactions for all nodes are synchronized and the REDO log is flushed to disk A related term is GCI, which stands for “Global Checkpoint ID” This marks the point in the REDO log where a GCP took place • Node: A component of MySQL Cluster node types are supported: • Management (MGM) node: This is an instance of ndb_mgmd, the cluster management server daemon • Data node (sometimes also referred to as a “storage nodes”, although this usage is now discouraged): This is an instance of ndbd, and stores cluster data • API node: This is an application that accesses cluster data SQL node refers to a mysqld process that is connected to the cluster as an API node For more information about these node types, please refer to Section 1.3.3, “Review of MySQL Cluster Concepts”, or to MySQL Cluster Programs, in the MySQL Manual • Node Failure: MySQL Cluster is not solely dependent upon the functioning of any single node making up the cluster, which can continue to run even when one node fails • Node Restart: The process of restarting a cluster node which has stopped on its own or been stopped deliberately This can be done for several different reasons, including the following: • Restarting a node which has shut down on its own (when this has occurred, it is known as forced shutdown or node failure; the other cases dicussed here involve manually shutting down the node and restarting it) • To update the node's configuration • As part of a software or hardware upgrade • In order to defragment the node's DataMemory • Initial Node Restart: The process of starting a cluster node with its file system removed This is sometimes used in the course of software upgrades and in other special circumstances • System Crash (or System Failure): This can occur when so many cluster nodes have failed that the cluster's state can no longer be guaranteed • System Restart: The process of restarting the cluster and reinitialising its state from disk logs and checkpoints This is required after either a planned or an unplanned shutdown of the cluster • Fragment: Contains a portion of a database table; in other words, in the NDB storage engine, a table is broken up into and stored as a number of subsets, usually referred to as fragments A fragment is sometimes also called a partition • Replica: Under the NDB storage engine, each table fragment has number of replicas in order to provide redundancy • Transporter: A protocol providing data transfer across a network The NDB API supports different types of transporter connections: TCP/IP (local), TCP/IP (remote), SCI, and SHM TCP/IP is, of course, the familiar network protocol that underlies HTTP, FTP, and so forth, on the Internet SCI (Scalable Coherent Interface) is a high-speed protocol used in building multiprocessor systems and parallel-processing applications SHM stands for Unix-style shared memory segments For an informal introduction to SCI, see this essay at dolphinics.com • NDB: This originally stood for “Network Database” It now refers to the storage engine used by MySQL AB to enable its MySQL Cluster distributed database • ACC: Access Manager Handles hash indexes of primary keys providing speedy access to the records • TUP: Tuple Manager This handles storage of tuples (records) and contains the filtering engine used to filter out records and attributes when performing reads or updates • TC: Transaction Coordinator Handles co-ordination of transactions and timeouts; serves as the interface to the NDB API for indexes and scan operations 1.3 The NDBCLUSTER Transaction and Scanning API Overview and Concepts This section defines and discusses the high-level architecture of the NDB API, and introduces the NDB classes which are of greatest use and interest to the developer It also covers most important NDB API concepts, including a review of MySQL Cluster Concepts 1.3.1 Core NDB API Classes The NDB API is a MySQL Cluster application interface that implements transactions It consists of the following fundamental classes: • Ndb_cluster_connection represents a connection to a cluster See Section 2.3.24, “The Ndb_cluster_connection Class” • Ndb is the main class, and represents a connection to a database See Section 2.3.8, “The Ndb Class” • NdbDictionary provides meta-information about tables and attributes See Section 2.3.10, “The NdbDictionary Class” • NdbTransaction represents a transaction See Section 2.3.19, “The NdbTransaction Class” • NdbOperation represents an operation using a primary key See Section 2.3.15, “The NdbOperation Class” • NdbScanOperation represents an operation performing a full table scan See Section 2.3.18, “The NdbScanOperation Class” • NdbIndexOperation represents an operation using a unique hash index See Section 2.3.12, “The NdbIndexOperation Class” • NdbIndexScanOperation represents an operation performing a scan using an ordered index See Section 2.3.13, “The NdbIndexScanOperation Class” • NdbRecAttr represents an attribute value See Section 2.3.16, “The NdbRecAttr Class” In addition, the NDB API defines an NdbError structure, which contains the specification for an error It is also possible to receive events triggered when data in the database is changed This is accomplished through the NdbEventOperation class Important The NDB event notification API is not supported prior to MySQL 5.1 (Bug#19719) For more information about these classes as well as some additional auxiliary classes not listed here, see Section 2.3, “NDB API Classes, Interfaces, and Structures” 1.3.2 Application Program Basics The main structure of an application program is as follows: Connect to a cluster using the Ndb_cluster_connection object Initiate a database connection by constructing and initialising one or more Ndb objects Identify the tables, columns, and indexes on which you wish to operate, using NdbDictionary and one or more of its subclasses MySQL Cluster Internals Part of this protocol consists of Steps - during the system restart phase as described below This means that restoration of all the fragments, preparation for execution of the redo log, execution of the redo log, and finally reporting back to DBDIH when the execution of the redo log is completed, are all part of this process After preparations are complete, copy phase for each fragment in the node must be performed The process of copying a fragment involves the following steps: The DBLQH kernel block in the starting node is informed that the copy process is about to begin by sending it a PREPARE_COPY_FRAGREQ signal When DBLQH acknowledges this request a CREATE_FRAGREQ signal is sent to all nodes notify them of the preparation being made to copy data to this replica for this table fragment After all nodes have acknowledged this, a COPY_FRAGREQ signal is sent to the node from which the data is to be copied to the new node This is always the primary replica of the fragment The node indicated copies all the data over to the starting node in response to this message After copying has been completed, and a COPY_FRAGCONF message is sent, all nodes are notified of the completion through an UPDATE_TOREQ signal After all nodes have updated to reflect the new state of the fragment, the DBLQH kernel block of the starting node is informed of the fact that the copy has been completed, and that the replica is now up-to-date and any failures should now be treated as real failures The new replica is transformed into a primary replica if this is the role it had when the table was created After completing this change another round of CREATE_FRAGREQ messages is sent to all nodes informing them that the takeover of the fragment is now committed After this, process is repeated with the next fragment if another one exists When there are no more fragments for takeover by the node, all nodes are informed of this by sending an UPDATE_TOREQ signal sent to all of them 10 Wait for the next complete local checkpoint to occur, running from start to finish 11 The node states are updated, using a complete global checkpoint As with the local checkpoint in the previous step, the global checkpoint must be permitted to start and then to finish 12 When the global checkpoint has completed, it will communicate the successful local checkpoint of this node restart by sending an END_TOREQ signal to all nodes 13 A START_COPYCONF is sent back to the starting node informing it that the node restart has been completed 14 Receiving the START_COPYCONF signal ends NDB_STTOR phase This provides another synchronization point for system restarts, designated as WAITPOINT_5_2 Note The copy process in this phase can in theory be performed in parallel by several nodes However, all messages from the master to all nodes are currently sent to single node at a time, but can be made completely parallel This is likely to be done in the not too distant future In an initial and an initial node restart, the SUMA block requests the subscriptions from the SUMA master node NDBCNTR executes NDB_STTOR phase No other NDBCNTR activity takes place 6.5.14 NDB_STTOR Phase In this NDB_STTOR phase, both DBLQH and DBDICT clear their internal representing the current restart type The DBACC block resets the system restart flag; DBACC and DBTUP start a periodic signal for checking memory usage once per second DBTC sets an internal variable indicating that the system restart has been completed 6.5.15 STTOR Phase The NDBCNTR block defines the cluster's node groups, and the DBUTIL block initializes a number of data structures to facilitate the sending keyed operations can be to the system tables DBUTIL also sets up a single connection to the DBTC kernel block 481 MySQL Cluster Internals 6.5.16 STTOR Phase In QMGR the president starts an arbitrator (unless this feature has been disabled by setting the value of the ArbitrationRank configuration parameter to for all nodes—see Defining a MySQL Cluster Management Server, and Defining SQL and Other API Nodes in a MySQL Cluster, for more information; note that this currently can be done only when using MySQL Cluster Carrier Grade Edition) In addition, checking of API nodes through heartbeats is activated Also during this phase, the BACKUP block sets the disk write speed to the value used following the completion of the restart The master node during initial start also inserts the record keeping track of which backup ID is to be used next The SUMA and DBTUX blocks set variables indicating start phase has been completed, and that requests to DBTUX that occurs when running the redo log should no longer be ignored 6.5.17 STTOR Phase NDB_STTOR executes NDB_STTOR phase 7; no other NDBCNTR activity takes place 6.5.18 NDB_STTOR Phase If this is a system restart, the master node initiates a rebuild of all indexes from DBDICT during this phase The CMVMI kernel block opens communication channels to the API nodes (including MySQL servers acting as SQL nodes) Indicate in globalData that the node is started 6.5.19 STTOR Phase NDBCNTR resets some start variables 6.5.20 STTOR Phase 101 This is the SUMA handover phase, during which a GCP is negotiated and used as a point of reference for changing the source of event and replication subscriptions from existing nodes only to include a newly started node 6.5.21 System Restart Handling in Phase This consists of the following steps: The master sets the latest GCI as the restart GCI, and then synchronizes its system file to all other nodes involved in the system restart The next step is to synchronize the schema of all the nodes in the system restart This is performed in 15 passes The problem we are trying to solve here occurs when a schema object has been created while the node was up but was dropped while the node was down, and possibly a new object was even created with the same schema ID while that node was unavailable In order to handle this situation, it is necessary first to re-create all objects that are supposed to exist from the viewpoint of the starting node After this, any objects that were dropped by other nodes in the cluster while this node was “dead” are dropped; this also applies to any tables that were dropped during the outage Finally, any tables that have been created by other nodes while the starting node was unavailable are re-created on the starting node All these operations are local to the starting node As part of this process, is it also necessary to ensure that all tables that need to be re-created have been created locally and that the proper data structures have been set up for them in all kernel blocks After performing the procedure described previously for the master node the new schema file is sent to all other participants in the system restart, and they perform the same synchronization All fragments involved in the restart must have proper parameters as derived from DBDIH This causes a number of START_FRAGREQ signals to be sent from DBDIH to DBLQH This also starts the restoration of the fragments, which are restored one by one and one record at a time in the course of reading the restore data from disk and applying in parallel the restore data read from disk into main memory This restores only the main memory parts of the tables Once all fragments have been restored, a START_RECREQ message is sent to all nodes in the starting cluster, and then all undo logs for any Disk Data parts of the tables are applied After applying the undo logs in LGMAN, it is necessary to perform some restore work in TSMAN that requires scanning the extent headers of the tablespaces Next, it is necessary to prepare for execution of the redo log, which log can be performed in up to four phases For each fragment, execution of redo logs from several different nodes may be required This is handled by executing the redo logs in different phases for a specific fragment, as decided in DBDIH when sending the START_FRAGREQ signal An EXEC_FRAGREQ signal is sent for each phase and fragment that requires execution in this phase After these signals are sent, an EXEC_SRREQ 482 MySQL Cluster Internals signal is sent to all nodes to tell them that they can start executing the redo log Note Before starting execution of the first redo log, it is necessary to make sure that the setup which was started earlier (in Phase 4) by DBLQH has finished, or to wait until it does before continuing Prior to executing the redo log, it is necessary to calculate where to start reading and where the end of the REDO log should have been reached The end of the REDO log should be found when the last GCI to restore has been reached After completing the execution of the redo logs, all redo log pages that have been written beyond the last GCI to be restore are invalidated Given the cyclic nature of the redo logs, this could carry the invalidation into new redo log files past the last one executed After the completion of the previous step, DBLQH report this back to DBDIH using a START_RECCONF message 10 When the master has received this message back from all starting nodes, it sends a NDB_STARTCONF signal back to NDBCNTR 11 The NDB_STARTCONF message signals the end of STTOR phase to NDBCNTR, which is the only block involved to any significant degree in this phase 6.5.22 START_MEREQ Handling The first step in handling START_MEREQ is to ensure that no local checkpoint is currently taking place; otherwise, it is necessary to wait until it is completed The next step is to copy all distribution information from the master DBDIH to the starting DBDIH After this, all metadata is synchronized in DBDICT (see Section 6.5.21, “System Restart Handling in Phase 4”) After blocking local checkpoints, and then synchronizing distribution information and metadata information, global checkpoints are blocked The next step is to integrate the starting node in the global checkpoint protocol, local checkpoint protocol, and all other distributed protocols As part of this the node status is also updated After completing this step the global checkpoint protocol is permitted to start again, the START_MECONF signal is sent to indicate to the starting node that the next phase may proceed 6.6 NDB Internals Glossary This section contains terms and abbreviations that are found in or useful to understanding the NDB source code • ACC ACCelerator or ACCess manager Handles hash indexes of primary keys, providing fast access to records See Section 6.4.3, “The DBACC Block” • API node In NDB terms, this is any application that accesses cluster data using the NDB API, including mysqld when functioning as an API node (MySQL servers acting in this capacity are also referred to as “SQL nodes”) Often abbreviated to “API” • CMVMI Stands for Cluster Manager Virtual Machine Interface An NDB kernel handling nonsignal requests to the operating system, as well as configuration management, interaction with the cluster management server, and interaction between various kernel blocks and the NDB virtual machine See Section 6.4.2, “The CMVMI Block”, for more information • CNTR Stands for restart CoordiNaToR See Section 6.4.12, “The NDBCNTR Block”, for more information • DBTC The transaction coordinator (also sometimes written simply as TC) See Section 6.4.7, “The DBTC Block”, for more information • DICT The NDB data DICTionary kernel block Also DBDICT See Section 6.4.4, “The DBDICT Block” • DIH DIstribution Handler An NDB kernel block See Section 6.4.5, “The DBDIH Block” • LGMAN The Log Group MANager NDB kernel block, used for MySQL Cluster Disk Data tables See Section 6.4.11, “The LGMAN Block” • LQH Local Query Handler NDB kernel block, discussed in Section 6.4.6, “DBLQH Block” • MGM ManaGeMent node (or management server) Implemented as the ndb_mgmd server daemon Responsible for passing cluster configuration information to data nodes and performing functions such as starting and stopping nodes Accessed by the 483 MySQL Cluster Internals user by means of the cluster management client (ndb_mgm) A discussion of management nodes can be found in ndb_mgmd • QMGR The cluster management block in the NDB kernel It responsibilities include monitoring heartbeats from data and API nodes See Section 6.4.15, “The QMGR Block”, for more information • RBR Row-Based Replication MySQL Cluster Replication is row-based replication See MySQL Cluster Replication • STTOR STart Or Restart • SUMA The cluster SUbscription MAnager See Section 6.4.17, “The SUMA Block” • TC TC Transaction Coordinator See Section 6.4.7, “The DBTC Block” • TRIX Stands for TRansactions and IndeXes, which are managed by the NDB kernel block having this name See Section 6.4.19, “The TRIX Block” • TSMAN Table space manager Handles tablespaces for MySQL Cluster Disk Data See Section 6.4.18, “The TSMAN Block”, for more information • TUP TUPle Unit of data storage Also used (along with DBTUP) to refer to the NDB kernel's tuple management block, which is discussed in Section 6.4.8, “The DBTUP Block” 484 ndex A AbortOption (NdbOperation data type), 126 AbortOption (NdbTransaction data type), 157 ACC and NDB Kernel, defined, Access Manager defined, ActiveHook (NdbBlob data type), 80 addColumn() (method of Index), 63 addColumn() (method of Table), 186 addColumnName() (method of Index), 63 addColumnNames() (method of Index), 63 addEventColumn() (method of Event), 57 addEventColumns() (method of Event), 57 addTableEvent() (method of Event), 56 add_reg() (method of NdbInterepretedCode), 108 add_val() (method of NdbInterepretedCode), 119 aggregate() (method of Table), 191 allowsNull (ClusterJ), 371 and (ClusterJ), 382 Annotations (ClusterJ) Column, 371 Columns, 372 Extension, 372 Extensions, 373 Index, 374 Indices, 375 Lob, 375 NotPersistent, 376 PartitionKey, 377 PersistenceCapable, 378 Persistent, 379 PrimaryKey, 380 API node defined, application-level partitioning, 201 applications structure, aRef() (method of NdbRecAttr), 140 ArrayType (Column data type), 20 AutoGrowSpecification structure, 207 B backup defined, begin (ClusterJ), 370 begin() (method of NdbScanFilter), 144 between (ClusterJ), 383 BinaryCondition (NdbScanFilter data type), 143 BLOB handling example, 282 example (using NdbRecord), 288 blobsFirstBlob() (method of NdbBlob), 85 blobsNextBlob() (method of NdbBlob), 85 BoundType (NdbIndexScanOperation data type), 98 branch_col_and_mask_eq_mask() (method of NdbInterpretedCode), 116 branch_col_and_mask_eq_zero() (method of NdbInterpretedCode), 117 branch_col_and_mask_ne_mask() (method of NdbInterpretedCode), 117 branch_col_and_mask_ne_zero() (method of NdbInterpretedCode), 118 branch_col_eq() (method of NdbInterepretedCode), 112 branch_col_eq_null() (method of NdbInterepretedCode), 114 branch_col_ge() (method of NdbInterepretedCode), 114 branch_col_gt() (method of NdbInterepretedCode), 114 branch_col_le() (method of NdbInterepretedCode), 113 branch_col_like() (method of NdbInterepretedCode), 115 branch_col_lt() (method of NdbInterepretedCode), 113 branch_col_ne() (method of NdbInterepretedCode), 113 branch_col_ne_null() (method of NdbInterepretedCode), 115 branch_col_notlike() (method of NdbInterepretedCode), 116 branch_eq() (method of NdbInterepretedCode), 111 branch_eq_null() (method of NdbInterepretedCode), 111 branch_ge() (method of NdbInterepretedCode), 109 branch_gt() (method of NdbInterepretedCode), 110 branch_label() (method of NdbInterepretedCode), 109 branch_le() (method of NdbInterepretedCode), 110 branch_lt() (method of NdbInterepretedCode), 110 branch_ne() (method of NdbInterepretedCode), 111 branch_ne_null() (method of NdbInterepretedCode), 111 C call_sub() (method of NdbInterepretedCode), 120 char_value() (method of NdbRecAttr), 137 checkpoint defined, Classes (ClusterJ) ClusterJHelper, 350 LockMode, 357 NullValue, 376 PersistenceModifier, 378 Classification (NdbError data type), 212 clone() (method of NdbRecAttr), 140 close (ClusterJ), 363, 368 close() (method of NdbScanOperation), 152 close() (method of NdbTransaction), 161 closeTransaction() (method of Ndb), 74 ClusterJ defined, 331 ClusterJDatastoreException (ClusterJ), 345 ClusterJException (ClusterJ), 346 ClusterJFatalException (ClusterJ), 347 ClusterJFatalInternalException (ClusterJ), 348 ClusterJFatalUserException (ClusterJ), 349 ClusterJHelper (ClusterJ), 350 ClusterJPA defined, 331 ClusterJUserException (ClusterJ), 353 cmp() (method of NdbScanFilter), 144 coding examples MGM API, 325 NDB API, 220 Column (ClusterJ), 371 column (ClusterJ), 377, 380, 381 Column class, 18 Column::ArrayType, 20 Column::ColumnType, 21 Column::equal(), 24 Column::getArrayType(), 27 Column::getCharset(), 25 Column::getColumnNo(), 24 Column::getDefaultValue(), 32 Column::getInlineSize(), 26 Column::getLength(), 25 Column::getName(), 23 Column::getNullable(), 23 Column::getPartitionKey(), 27 Column::getPartSize(), 26 Column::getPrecision(), 24 Column::getPrimaryKey(), 23 Column::getStorageType(), 27 485 Index Column::getStripeSize(), 26 Column::getType(), 24 Column::setArrayType(), 31 Column::setCharset(), 30 Column::setDefaultValue(), 32 Column::setLength(), 29 Column::setName(), 28 Column::setNullable(), 28 Column::setPartitionKey(), 31 Column::setPartSize(), 30 Column::setPrecision(), 29 Column::setPrimaryKey(), 28 Column::setScale(), 29 Column::setStorageType(), 32 Column::setStripeSize(), 31 Column::setType(), 28 Column::StorageType, 21 Columns (ClusterJ), 372 columns (ClusterJ), 374, 377, 381 ColumnType (Column data type), 21 Commit defined, commit (ClusterJ), 370 commitStatus() (method of NdbTransaction), 162 CommitStatusType (NdbTransaction data type), 158 computeHash() (method of Ndb), 74 concurrency control, 10 connect() (method of Ndb_cluster_connection), 203 connecting to multiple clusters example, 223, 327 Connector/J known issues, 387 Constants (ClusterJ), 354 createDatafile() (method of Dictionary), 44 createEvent() (method of Dictionary), 43 createIndex() (method of Dictionary), 43 createLogfileGroup() (method of Dictionary), 44 createQuery (ClusterJ), 363 createQueryDefinition (ClusterJ), 385 createRecord() (method of Dictionary), 44 createTable() (method of Dictionary), 43 createTablespace() (method of Dictionary), 44 createUndofile() (method of Dictionary), 45 currentTransaction (ClusterJ), 363 D data node defined, database (ClusterJ), 378 Datafile class, 32 Datafile::getFileNo(), 36 Datafile::getFree(), 35 Datafile::getNode(), 36 Datafile::getObjectId(), 36 Datafile::getObjectStatus(), 36 Datafile::getObjectVersion(), 36 Datafile::getPath(), 34 Datafile::getSize(), 35 Datafile::getTablespace(), 35 Datafile::getTablespaceId(), 35 Datafile::setNode(), 37 Datafile::setPath(), 37 Datafile::setSize(), 37 Datafile::setTablespace(), 37 defaultValue (ClusterJ), 371 DEFAULT_PROPERTY_CLUSTER_CONNECT_DELAY (ClusterJ), 355 DEFAULT_PROPERTY_CLUSTER_CONNECT_RETRIES (ClusterJ), 355 DEFAULT_PROPERTY_CLUSTER_CONNECT_TIMEOUT_AFTER (ClusterJ), 355 DEFAULT_PROPERTY_CLUSTER_CONNECT_TIMEOUT_BEFORE (ClusterJ), 355 DEFAULT_PROPERTY_CLUSTER_CONNECT_VERBOSE (ClusterJ), 355 DEFAULT_PROPERTY_CLUSTER_DATABASE (ClusterJ), 355 DEFAULT_PROPERTY_CLUSTER_MAX_TRANSACTIONS (ClusterJ), 355 def_label() (method of NdbInterepretedCode), 109 def_sub() (method of NdbInterepretedCode), 120 deleteCurrentTuple() (method of NdbScanOperation), 154 deletePersistent (ClusterJ), 363, 363 deletePersistentAll (ClusterJ), 364, 364 deleteTuple() (method of NdbIndexOperation), 97 deleteTuple() (method of NdbOperation), 134 deleteTuple() (method of NdbTransaction), 167 Dictionary class, 38 Dictionary::createDatafile(), 44 Dictionary::createEvent(), 43 Dictionary::createIndex(), 43 Dictionary::createLogfileGroup(), 44 Dictionary::createRecord(), 44 Dictionary::createTable(), 43 Dictionary::createTablespace(), 44 Dictionary::createUndofile(), 45 Dictionary::dropDatafile(), 46 Dictionary::dropEvent(), 46 Dictionary::dropIndex(), 45 Dictionary::dropLogfileGroup(), 46 Dictionary::dropTable(), 45 Dictionary::dropTablespace(), 46 Dictionary::dropUndofile(), 47 Dictionary::Element structure, 208 Dictionary::getDatafile(), 42 Dictionary::getEvent(), 41 Dictionary::getIndex(), 41 Dictionary::getLogfileGroup(), 42 Dictionary::getNdbError(), 43 Dictionary::getTable(), 41 Dictionary::getTablespace(), 42 Dictionary::getUndofile(), 42 Dictionary::invalidateTable(), 47 Dictionary::listIndexes(), 48 Dictionary::listObjects(), 47 Dictionary::releaseRecord(), 49 Dictionary::removeCachedIndex(), 49 Dictionary::removeCachedTable(), 49 double_value() (method of NdbRecAttr), 139 dropDatafile() (method of Dictionary), 46 dropEvent() (method of Dictionary), 46 dropEventOperation() (method of Ndb), 75 dropIndex() (method of Dictionary), 45 dropLogfileGroup() (method of Dictionary), 46 dropTable() (method of Dictionary), 45 dropTablespace() (method of Dictionary), 46 dropUndofile() (method of Dictionary), 47 E Element (Dictionary structure), 208 Elements (ClusterJ) allowsNull, 371 column, 377, 380, 381 columns, 374, 377, 381 database, 378 defaultValue, 371 extensions, 380 486 Index key, 373 name, 371, 375, 381 nullValue, 380 primaryKey, 380 schema, 378 table, 378 unique, 375 value, 372, 373, 374, 375 vendorName, 373 end() (method of NdbScanFilter), 144 end_of_bound() (method of NdbIndexScanOperation), 101 eq() (method of NdbScanFilter), 145 equal (ClusterJ), 383 equal() (method of Column), 24 equal() (method of NdbOperation), 130 equal() (method of Table), 180 error classification (defined), 210 error classifications, 411 error code (defined), 210 Error code types, 392 Error codes, 392 error detail message (defined), 211 error handling example, 226 overview, error message (defined), 211 Error status, 210 error types in applications, 227 errors classifying, 411 ER_DDL, 56 Event class, 49 event reporting DDL, 56 Event::addEventColumn(), 57 Event::addEventColumns(), 57 Event::addTableEvent(), 56 Event::EventDurability, 52 Event::EventReport, 52 Event::getDurability(), 54 Event::getEventColumn(), 55 Event::getName(), 53 Event::getNoOfEventColumns(), 54 Event::getObjectId(), 55 Event::getObjectStatus(), 55 Event::getObjectVersion(), 55 Event::getReport(), 54 Event::getTable(), 53 Event::getTableEvent(), 54 Event::getTableName(), 53 Event::mergeEvents(), 58 Event::setDurability(), 56 Event::setName(), 55 Event::setReport(), 56 Event::setTable(), 56 Event::TableEvent, 51 EventDurability (Event data type), 52 EventReport (Event data type), 52 events example, 327 handling example, 279 Exceptions (ClusterJ) ClusterJDatastoreException, 345 ClusterJException, 346 ClusterJFatalException, 347 ClusterJFatalInternalException, 348 ClusterJFatalUserException, 349 ClusterJUserException, 353 ExecType (NdbTransaction data type), 158 execute (ClusterJ), 359, 359, 360 execute() (method of NdbEventOperation), 95 execute() (method of NdbTransaction), 159 explain (ClusterJ), 360 Extension (ClusterJ), 372 Extensions (ClusterJ), 373 extensions (ClusterJ), 380 F Fields (ClusterJ) DEFAULT_PROPERTY_CLUSTER_CONNECT_DELAY, 355 DEFAULT_PROPERTY_CLUSTER_CONNECT_RETRIES, 355 DEFAULT_PROPERTY_CLUSTER_CONNECT_TIMEOUT_AFTE R, 355 DEFAULT_PROPERTY_CLUSTER_CONNECT_TIMEOUT_BEFO RE, 355 DEFAULT_PROPERTY_CLUSTER_CONNECT_VERBOSE, 355 DEFAULT_PROPERTY_CLUSTER_DATABASE, 355 DEFAULT_PROPERTY_CLUSTER_MAX_TRANSACTIONS, 355 INDEX_USED, 359 PROPERTY_CLUSTER_CONNECTION_SERVICE, 356 PROPERTY_CLUSTER_CONNECTSTRING, 356 PROPERTY_CLUSTER_CONNECT_DELAY, 355 PROPERTY_CLUSTER_CONNECT_RETRIES, 355 PROPERTY_CLUSTER_CONNECT_TIMEOUT_AFTER, 355 PROPERTY_CLUSTER_CONNECT_TIMEOUT_BEFORE, 356 PROPERTY_CLUSTER_CONNECT_VERBOSE, 356 PROPERTY_CLUSTER_DATABASE, 356 PROPERTY_CLUSTER_MAX_TRANSACTIONS, 356 PROPERTY_DEFER_CHANGES, 356 PROPERTY_JDBC_DRIVER_NAME, 356 PROPERTY_JDBC_PASSWORD, 356 PROPERTY_JDBC_URL, 356 PROPERTY_JDBC_USERNAME, 357 SCAN_TYPE, 359 SCAN_TYPE_INDEX_SCAN, 359 SCAN_TYPE_PRIMARY_KEY, 359 SCAN_TYPE_TABLE_SCAN, 359 SCAN_TYPE_UNIQUE_KEY, 359 SESSION_FACTORY_SERVICE_CLASS_NAME, 357 SESSION_FACTORY_SERVICE_FILE_NAME, 357 finalise() (method of NdbInterepretedCode), 121 find (ClusterJ), 364 float_value() (method of NdbRecAttr), 139 flush (ClusterJ), 364 fragment defined, FragmentType (Object data type), 171 G GCP (Global Checkpoint) defined, ge() (method of NdbScanFilter), 147 get (ClusterJ), 387 getArrayType() (method of Column), 27 getAutoGrowSpecification() (method of LogfileGroup), 66 getAutoGrowSpecification() (method of Tablespace), 194 getBlobEventName() (method of NdbBlob), 85 getBlobHandle() (method of NdbEventOperation), 92 getBlobHandle() (method of NdbOperation), 128 getBlobTableName() (method of NdbBlob), 86 getCharset() (method of Column), 25 getColumn() (method of Index), 61 getColumn() (method of NdbBlob), 84 487 Index getColumn() (method of NdbRecAttr), 136 getColumn() (method of Table), 178 getColumnNo() (method of Column), 24 getDatabaseName() (method of Ndb), 71 getDatabaseSchemaName() (method of Ndb), 72 getDatafile() (method of Dictionary), 42 getDefaultLogfileGroup() (method of Tablespace), 194 getDefaultLogfileGroupId() (method of Tablespace), 194 getDefaultNoPartitionsFlag() (method of Table), 184 getDefaultValue() (method of Column), 32 getDescending() (method of NdbIndexScanOperation), 99 getDictionary() (method of Ndb), 71 getDurability() (method of Event), 54 getEvent() (method of Dictionary), 41 getEventColumn() (method of Event), 55 getEventType() (method of NdbEventOperation), 91 getExtentSize() (method of Tablespace), 194 getFileNo() (method of Datafile), 36 getFileNo() (method of Undofile), 199 getFragmentCount() (method of Table), 182 getFragmentData() (method of Table), 180 getFragmentDataLen() (method of Table), 181 getFragmentNodes() (method of Table), 182 getFragmentType() (method of Table), 178 getFree() (method of Datafile), 35 getFrmData() (method of Table), 180 getFrmLength() (method of Table), 180 getGCI() (method of NdbEventOperation), 93 getGCI() (method of NdbTransaction), 161 getIndex() (method of Dictionary), 41 getIndex() (method of NdbIndexOperation), 96 getInlineSize() (method of Column), 26 getKValue() (method of Table), 179 getLatestGCI() (method of NdbEventOperation), 93 getLength() (method of Column), 25 getLength() (method of NdbBlob), 83 getLinearFlag() (method of Table), 182 getLockMode() (method of NdbOperation), 129 getLogfileGroup() (method of Dictionary), 42 getLogfileGroup() (method of Undofile), 198 getLogfileGroupId() (method of Undofile), 198 getLogging() (method of Index), 61 getLogging() (method of Table), 178 getMaxLoadFactor() (method of Table), 179 getMaxRows() (method of Table), 184 getMinLoadFactor() (method of Table), 179 getName() (method of Column), 23 getName() (method of Event), 53 getName() (method of Index), 60 getName() (method of LogfileGroup), 66 getName() (method of Tablespace), 193 getNdbError() (method of Dictionary), 43 getNdbError() (method of Ndb), 76 getNdbError() (method of NdbBlob), 85 getNdbError() (method of NdbEventOperation), 93 getNdbError() (method of NdbInterepretedCode), 121 getNdbError() (method of NdbOperation), 129 getNdbError() (method of NdbScanFilter), 148 getNdbError() (method of NdbTransaction), 162 getNdbErrorDetail() (method of Ndb), 76 getNdbErrorLine() (method of NdbOperation), 129 getNdbErrorLine() (method of NdbTransaction), 162 getNdbErrorOperation() (method of NdbTransaction), 162 getNdbIndexOperation() (method of NdbTransaction), 159 getNdbIndexScanOperation() (method of NdbTransaction), 159 getNdbOperation() (method of NdbBlob), 86 getNdbOperation() (method of NdbScanFilter), 148 getNdbOperation() (method of NdbTransaction), 158 getNdbScanOperation() (method of NdbTransaction), 158 getNdbTransaction() (method of NdbOperation), 130 getNdbTransaction() (method of NdbScanOperation), 154 getNextCompletedOperation() (method of NdbTransaction), 163 getNode() (method of Datafile), 36 getNode() (method of Undofile), 199 getNoOfColumns() (method of Index), 61 getNoOfCOlumns() (method of Table), 179 getNoOfEventColumns() (method of Event), 54 getNoOfPrimaryKeys() (method of Table), 179 getNull() (method of NdbBlob), 82 getNullable() (method of Column), 23 getObjectId() (method of Datafile), 36 getObjectId() (method of Event), 55 getObjectId() (method of Index), 62 getObjectId() (method of LogfileGroup), 67 getObjectId() (method of Object), 173 getObjectId() (method of Table), 184 getObjectId() (method of Tablespace), 195 getObjectId() (method of Undofile), 200 getObjectStatus() (method of Datafile), 36 getObjectStatus() (method of Event), 55 getObjectStatus() (method of Index), 62 getObjectStatus() (method of LogfileGroup), 67 getObjectStatus() (method of Object), 173 getObjectStatus() (method of Table), 183 getObjectStatus() (method of Tablespace), 195 getObjectStatus() (method of Undofile), 199 getObjectType() (method of Table), 183 getObjectVersion() (method of Datafile), 36 getObjectVersion() (method of Event), 55 getObjectVersion() (method of Index), 62 getObjectVersion() (method of LogfileGroup), 67 getObjectVersion() (method of Object), 173 getObjectVersion() (method of Table), 184 getObjectVersion() (method of Tablespace), 195 getObjectVersion() (method of Undofile), 199 getPartitionKey() (method of Column), 27 getPartSize() (method of Column), 26 getPath() (method of Datafile), 34 getPath() (method of Undofile), 198 getPos() (method of NdbBlob), 83 getPreBlobHandle() (method of NdbEventOperation), 92 getPrecision() (method of Column), 24 getPreValue() (method of NdbEventOperation), 92 getPrimaryKey() (method of Column), 23 getPrimaryKey() (method of Table), 180 getPruned() (method of NdbScanOperation), 155 getQueryBuilder (ClusterJ), 364 getRangeListData() (method of Table), 181 getRangeListDataLen() (method of Table), 181 getReport() (method of Event), 54 getResultList (ClusterJ), 360 getRollbackOnly (ClusterJ), 370 getRowChecksumIndicator() (method of Table), 185 getRowGCIIndicator() (method of Table), 185 getServiceInstance (ClusterJ), 351, 351, 351 getServiceInstances (ClusterJ), 352 getSession (ClusterJ), 368, 368 getSessionFactory (ClusterJ), 352, 352, 369 getSize() (method of Datafile), 35 getSize() (method of Undofile), 198 getSorted() (method of NdbIndexScanOperation), 99 getState() (method of NdbBlob), 81 getState() (method of NdbEventOperation), 91 getStorageType() (method of Column), 27 getStripeSize() (method of Column), 26 getTable() (method of Dictionary), 41 getTable() (method of Event), 53 getTable() (method of Index), 60 getTable() (method of NdbInterepretedCode), 121 getTable() (method of NdbOperation), 128 488 Index getTableEvent() (method of Event), 54 getTableId() (method of Table), 178 getTableName() (method of Event), 53 getTableName() (method of NdbOperation), 128 getTablespace() (method of Datafile), 35 getTablespace() (method of Dictionary), 42 getTablespace() (method of Table), 183 getTablespaceData() (method of Table), 181 getTablespaceDataLen() (method of Table), 181 getTablespaceId() (method of Datafile), 35 getTablespaceNames() (method of Table), 184 getTablespaceNamesLen() (method of Table), 185 getTransactionId() (method of NdbTransaction), 161 getType (ClusterJ), 387 getType() (method of Column), 24 getType() (method of Index), 61 getType() (method of NdbOperation), 129 getType() (method of NdbRecAttr), 136 getUndoBufferSize() (method of LogfileGroup), 66 getUndofile() (method of Dictionary), 42 getUndoFreeWords() (method of LogfileGroup), 66 getValue() (method of NdbBlob), 81 getValue() (method of NdbEventOperation), 91 getValue() (method of NdbOperation), 127 getVersion() (method of NdbBlob), 82 getWordsUsed() (method of NdbInterepretedCode), 122 get_auto_reconnect() (method of Ndb_cluster_connection), 206 get_latest_error() (method of Ndb_cluster_connection), 206 get_latest_error_msg() (method of Ndb_cluster_connection), 206 get_next_ndb_object() (method of ndb_cluster_connection), 204 get_range_no() (method of NdbIndexScanOperation), 98 get_size_in_bytes() (method of NdbRecAttr), 136 greaterEqual (ClusterJ), 383 greaterThan (ClusterJ), 384 Group (NdbScanFilter data type), 143 gt() (method of NdbScanFilter), 147 H hasDefaultValues() (method of Table), 191 I in (ClusterJ), 384 Index (ClusterJ), 374 Index class, 58 Index::addColumn(), 63 Index::addColumnName(), 63 Index::addColumnNames(), 63 Index::getColumn(), 61 Index::getLogging(), 61 Index::getName(), 60 Index::getNoOfColumns(), 61 Index::getObjectId(), 62 Index::getObjectStatus(), 62 Index::getObjectVersion(), 62 Index::getTable(), 60 Index::getType(), 61 Index::setName(), 62 Index::setTable(), 63 Index::setType(), 64 Index::Type, 60 INDEX_USED (ClusterJ), 359 Indices (ClusterJ), 375 init() (method of Ndb), 71 initial node restart defined, insertTuple() (method of NdbOperation), 133 insertTuple() (method of NdbTransaction), 164 int32_value() (method of NdbRecAttr), 137 int64_value() (method of NdbRecAttr), 137 int8_value() (method of NdbRecAttr), 138 integer comparison methods (of NdbScanFilter class), 145 Interfaces (ClusterJ) Constants, 354 Predicate, 381 PredicateOperand, 382 Query, 358 QueryBuilder, 384 QueryDefinition, 385 QueryDomainType, 386 Results, 361 Session, 361 SessionFactory, 368 SessionFactoryService, 369 Transaction, 369 interpret_exit_last_row() (method of NdbInterepretedCode), 119 interpret_exit_nok() (method of NdbInterepretedCode), 118 interpret_exit_ok() (method of NdbInterepretedCode), 118 invalidateTable() (method of Dictionary), 47 isActive (ClusterJ), 370 isClosed (ClusterJ), 365 isConsistent() (method of NdbEventOperation), 93 isfalse() (method of NdbScanFilter), 144 isnotnull() (method of NdbScanFilter), 148 isNULL() (method of NdbRecAttr), 136 isnull() (method of NdbScanFilter), 148 istrue() (method of NdbScanFilter), 144 iteration Ndb objects, 204 iterator (ClusterJ), 361 J Java, 331 JDBC known issues, 387 K key (ClusterJ), 373 Key_part_ptr (Ndb structure), 210 L LCP (Local Checkpoint) defined, le() (method of NdbScanFilter), 147 lessEqual (ClusterJ), 384 lessThan (ClusterJ), 384 List class, 68 listIndexes() (method of Dictionary), 48 listObjects() (method of Dictionary), 47 load_const_null() (method of NdbInterepretedCode), 105 load_const_u16() (method of NdbInterepretedCode), 105 load_const_u32() (method of NdbInterepretedCode), 106 load_const_u64() (method of NdbInterepretedCode), 106 Lob (ClusterJ), 375 lock handling and scan operations, lockCurrentTuple() (method of NdbScanOperation), 152 LockMode (ClusterJ), 357 LockMode (NdbOperation data type), 126 LogfileGroup class, 64 LogfileGroup::getAutoGrowSpecification(), 66 LogfileGroup::getName(), 66 LogfileGroup::getObjectId(), 67 LogfileGroup::getObjectStatus(), 67 LogfileGroup::getObjectVersion(), 67 LogfileGroup::getUndoBufferSize(), 66 LogfileGroup::getUndoFreeWords(), 66 LogfileGroup::setAutoGrowSpecification(), 68 489 Index LogfileGroup::setName(), 67 LogfileGroup::setUndoBufferSize(), 67 lt() (method of NdbScanFilter), 146 M makePersistent (ClusterJ), 365 makePersistentAll (ClusterJ), 365 management (MGM) node defined, markModified (ClusterJ), 365 medium_value() (method of NdbRecAttr), 137 mergeEvents() (method of Event), 58 mergeEvents() (method of NdbEventOperation), 95 Methods (ClusterJ) and, 382 begin, 370 between, 383 close, 363, 368 commit, 370 createQuery, 363 createQueryDefinition, 385 currentTransaction, 363 deletePersistent, 363, 363 deletePersistentAll, 364, 364 equal, 383 execute, 359, 359, 360 explain, 360 find, 364 flush, 364 get, 387 getQueryBuilder, 364 getResultList, 360 getRollbackOnly, 370 getServiceInstance, 351, 351, 351 getServiceInstances, 352 getSession, 368, 368 getSessionFactory, 352, 352, 369 getType, 387 greaterEqual, 383 greaterThan, 384 in, 384 isActive, 370 isClosed, 365 iterator, 361 lessEqual, 384 lessThan, 384 makePersistent, 365 makePersistentAll, 365 markModified, 365 newInstance, 366, 366 not, 382, 385 or, 382 param, 386 persist, 366 remove, 366 rollback, 370 savePersistent, 366 savePersistentAll, 367 setLockMode, 367 setParameter, 361 setPartitionKey, 367 setRollbackOnly, 370 updatePersistent, 367 updatePersistentAll, 368 where, 386 MGM API coding examples, 325 multiple clusters, 201 multiple clusters, connecting to example, 223, 327 MySQL Cluster Connector for Java, 331 and foreign keys, 387 and joins, 387 and views, 387 known issues, 387 N name (ClusterJ), 371, 375, 381 NDB defined, record structure, 10 NDB API coding examples, 220 defined, NDB API classes overview, Ndb class, 68 Ndb::closeTransaction(), 74 Ndb::computeHash(), 74 Ndb::dropEventOperation(), 75 Ndb::getDatabaseName(), 71 Ndb::getDatabaseSchemaName(), 72 Ndb::getDictionary(), 71 Ndb::getNdbError(), 76 Ndb::getNdbErrorDetail(), 76 Ndb::init(), 71 Ndb::Key_part_ptr structure, 210 Ndb::nextEvent(), 76 Ndb::PartitionSpec structure, 215 Ndb::pollEvents(), 75 Ndb::setDatabaseName(), 72 Ndb::setDatabaseSchemaName(), 72 Ndb::startTransaction(), 72 NdbBlob class, 77 NdbBlob::ActiveHook type, 80 NdbBlob::blobsFirstBlob(), 85 NdbBlob::blobsNextBlob(), 85 NdbBlob::getBlobEventName(), 85 NdbBlob::getBlobTableName(), 86 NdbBlob::getColumn(), 84 NdbBlob::getLength(), 83 NdbBlob::getNdbError(), 85 NdbBlob::getNdbOperation(), 86 NdbBlob::getNull(), 82 NdbBlob::getPos(), 83 NdbBlob::getState(), 81 NdbBlob::getValue(), 81 NdbBlob::getVersion(), 82 NdbBlob::readData(), 84 NdbBlob::setActiveHook(), 82 NdbBlob::setNull(), 83 NdbBlob::setPos(), 84 NdbBlob::setValue(), 81 NdbBlob::State type, 81 NdbBlob::truncate(), 83 NdbBlob::writeData(), 84 NdbDictionary class, 86 NdbError structure, 210 NdbError::Classification type, 212 NdbError::Status type, 212 NdbEventOperation class, 88 NdbEventOperation::execute(), 95 NdbEventOperation::getBlobHandle(), 92 NdbEventOperation::getEventType(), 91 NdbEventOperation::getGCI(), 93 NdbEventOperation::getLatestGCI(), 93 NdbEventOperation::getNdbError(), 93 NdbEventOperation::getPreBlobHandle(), 92 490 Index NdbEventOperation::getPreValue(), 92 NdbEventOperation::getState(), 91 NdbEventOperation::getValue(), 91 NdbEventOperation::isConsistent(), 93 NdbEventOperation::mergeEvents(), 95 NdbEventOperation::State, 90 NdbEventOperation::tableFragmentationChanged(), 94 NdbEventOperation::tableFrmChanged(), 94 NdbEventOperation::tableNameChanged(), 94 NdbIndexOperation class, 95 example, NdbIndexOperation::deleteTuple(), 97 NdbIndexOperation::getIndex(), 96 NdbIndexOperation::readTuple(), 96 NdbIndexOperation::updateTuple(), 97 NdbIndexScanOperation class, 97 NdbIndexScanOperation::BoundType, 98 NdbIndexScanOperation::end_of_bound(), 101 NdbIndexScanOperation::getDescending(), 99 NdbIndexScanOperation::getSorted(), 99 NdbIndexScanOperation::get_range_no(), 98 NdbIndexScanOperation::readTuples(), 99 NdbIndexScanOperation::reset_bounds(), 101 NdbInterpretedCode register-loading methods, 105 NdbInterpretedCode() (constructor), 104 NdbInterpretedCode::add_reg(), 108 NdbInterpretedCode::add_val(), 119 NdbInterpretedCode::branch_col_and_mask_eq_mask(), 116 NdbInterpretedCode::branch_col_and_mask_eq_zero(), 117 NdbInterpretedCode::branch_col_and_mask_ne_mask(), 117 NdbInterpretedCode::branch_col_and_mask_ne_zero(), 118 NdbInterpretedCode::branch_col_eq(), 112 NdbInterpretedCode::branch_col_eq_null(), 114 NdbInterpretedCode::branch_col_ge(), 114 NdbInterpretedCode::branch_col_gt(), 114 NdbInterpretedCode::branch_col_le(), 113 NdbInterpretedCode::branch_col_like(), 115 NdbInterpretedCode::branch_col_lt(), 113 NdbInterpretedCode::branch_col_ne(), 113 NdbInterpretedCode::branch_col_ne_null(), 115 NdbInterpretedCode::branch_col_notlike(), 116 NdbInterpretedCode::branch_eq(), 111 NdbInterpretedCode::branch_eq_null(), 111 NdbInterpretedCode::branch_ge(), 109 NdbInterpretedCode::branch_gt(), 110 NdbInterpretedCode::branch_label(), 109 NdbInterpretedCode::branch_le(), 110 NdbInterpretedCode::branch_lt(), 110 NdbInterpretedCode::branch_ne(), 111 NdbInterpretedCode::branch_ne_null(), 111 NdbInterpretedCode::call_sub(), 120 NdbInterpretedCode::def_label(), 109 NdbInterpretedCode::def_sub(), 120 NdbInterpretedCode::finalise(), 121 NdbInterpretedCode::getNdbError(), 121 NdbInterpretedCode::getTable(), 121 NdbInterpretedCode::getWordsUsed(), 122 NdbInterpretedCode::interpret_exit_last_row(), 119 NdbInterpretedCode::interpret_exit_nok(), 118 NdbInterpretedCode::interpret_exit_ok(), 118 NdbInterpretedCode::load_const_null(), 105 NdbInterpretedCode::load_const_u16(), 105 NdbInterpretedCode::load_const_u32(), 106 NdbInterpretedCode::load_const_u64(), 106 NdbInterpretedCode::read_attr(), 106 NdbInterpretedCode::ret_sub(), 121 NdbInterpretedCode::sub_reg(), 108 NdbInterpretedCode::sub_val(), 120 NdbInterpretedCode::write_attr(), 107 NdbMgmHandle, 295, 299, 300, 300 NdbOperation class, 122 example, NdbOperation::AbortOption, 126 NdbOperation::deleteTuple(), 134 NdbOperation::equal(), 130 NdbOperation::getBlobHandle(), 128 NdbOperation::getLockMode(), 129 NdbOperation::getNdbError(), 129 NdbOperation::getNdbErrorLine(), 129 NdbOperation::getNdbTransaction(), 130 NdbOperation::getTable(), 128 NdbOperation::getTableName(), 128 NdbOperation::getType(), 129 NdbOperation::getValue(), 127 NdbOperation::insertTuple(), 133 NdbOperation::LockMode, 126 NdbOperation::readTuple(), 133 NdbOperation::setValue(), 131 NdbOperation::Type, 126 NdbOperation::updateTuple(), 133 NdbOperation::writeTuple(), 133 NdbRecAttr class, 134 NdbRecAttr::aRef(), 140 NdbRecAttr::char_value(), 137 NdbRecAttr::clone(), 140 NdbRecAttr::double_value(), 139 NdbRecAttr::float_value(), 139 NdbRecAttr::getColumn(), 136 NdbRecAttr::getType(), 136 NdbRecAttr::get_size_in_bytes(), 136 NdbRecAttr::int32_value(), 137 NdbRecAttr::int64_value(), 137 NdbRecAttr::int8_value(), 138 NdbRecAttr::isNULL(), 136 NdbRecAttr::medium_value(), 137 NdbRecAttr::short_value(), 137 NdbRecAttr::u_32_value(), 138 NdbRecAttr::u_64_value(), 138 NdbRecAttr::u_8_value(), 139 NdbRecAttr::u_char_value(), 139 NdbRecAttr::u_medium_value(), 138 NdbRecAttr::u_short_value(), 139 NdbRecord example, 242, 288 NdbScanFilter class, 140 integer comparison methods, 145 NdbScanFilter::begin(), 144 NdbScanFilter::BinaryCondition, 143 NdbScanFilter::cmp(), 144 NdbScanFilter::end(), 144 NdbScanFilter::eq(), 145 NdbScanFilter::ge(), 147 NdbScanFilter::getNdbError(), 148 NdbScanFilter::getNdbOperation(), 148 NdbScanFilter::Group, 143 NdbScanFilter::gt(), 147 NdbScanFilter::isfalse(), 144 NdbScanFilter::isnotnull(), 148 NdbScanFilter::isnull(), 148 NdbScanFilter::istrue(), 144 NdbScanFilter::le(), 147 NdbScanFilter::lt(), 146 NdbScanFilter::ne(), 146 NdbScanOperation class, 149 NdbScanOperation::close(), 152 NdbScanOperation::deleteCurrentTuple(), 154 NdbScanOperation::getNdbTransaction(), 154 NdbScanOperation::getPruned(), 155 NdbScanOperation::lockCurrentTuple(), 152 NdbScanOperation::nextResult(), 151 491 Index NdbScanOperation::readTuples(), 150 NdbScanOperation::restart(), 154 NdbScanOperation::ScanFlag, 150 NdbScanOperation::updateCurrentTuple(), 153 NdbTransaction class, 155 NdbTransaction class methods using, NdbTransaction::AbortOption (OBSOLETE), 126, 157 NdbTransaction::close(), 161 NdbTransaction::commitStatus(), 162 NdbTransaction::CommitStatusType, 158 NdbTransaction::deleteTuple(), 167 NdbTransaction::ExecType, 158 NdbTransaction::execute(), 159 NdbTransaction::getGCI(), 161 NdbTransaction::getNdbError(), 162 NdbTransaction::getNdbErrorLine(), 162 NdbTransaction::getNdbErrorOperation(), 162 NdbTransaction::getNdbIndexOperation(), 159 NdbTransaction::getNdbIndexScanOperation(), 159 NdbTransaction::getNdbOperation(), 158 NdbTransaction::getNdbScanOperation(), 158 NdbTransaction::getNextCompletedOperation(), 163 NdbTransaction::getTransactionId(), 161 NdbTransaction::insertTuple(), 164 NdbTransaction::readTuple(), 163 NdbTransaction::refresh(), 160 NdbTransaction::scanIndex(), 169 NdbTransaction::scanTable(), 168 NdbTransaction::updateTuple(), 165 NdbTransaction::writeTuple(), 166 ndb_cluster_connection get_next_ndb_object() method, 204 Ndb_cluster_connection class, 201 Ndb_cluster_connection::connect(), 203 Ndb_cluster_connection::get_auto_reconnect(), 206 Ndb_cluster_connection::get_latest_error(), 206 Ndb_cluster_connection::get_latest_error_msg(), 206 Ndb_cluster_connection::set_auto_reconnect(), 205 Ndb_cluster_connection::set_name(), 203 Ndb_cluster_connection::set_optimized_node_selection(), 204 Ndb_cluster_connection::set_timeout(), 203 Ndb_cluster_connection::wait_until_ready(), 204 ndb_logevent structure (MGM API), 319 ndb_logevent_get_fd() function (MGM API), 297 ndb_logevent_get_latest_error() function (MGM API), 298 ndb_logevent_get_latest_error_msg() function (MGM API), 298 ndb_logevent_get_next() function (MGM API), 297 ndb_logevent_handle_error type (MGM API), 319 Ndb_logevent_type type (MGM API), 315 ndb_mgm_abort_backup() function (MGM API), 314 ndb_mgm_check_connection() function (MGM API), 302 ndb_mgm_cluster_state structure (MGM API), 325 ndb_mgm_connect() function (MGM API), 305 ndb_mgm_create_handle() function (MGM API), 299 ndb_mgm_create_logevent_handle() function (MGM API), 296, 296 ndb_mgm_destroy_handle() function (MGM API), 300 ndb_mgm_destroy_logevent_handle() function (MGM API), 297 ndb_mgm_disconnect() function (MGM API), 305 ndb_mgm_dump_state() function (MGM API), 306 ndb_mgm_enter_single_user() function (MGM API), 314 ndb_mgm_error type (MGM API), 315 ndb_mgm_event_category type (MGM API), 319 ndb_mgm_event_severity type (MGM API), 318 ndb_mgm_exit_single_user() function (MGM API), 314 ndb_mgm_get_clusterlog_loglevel() function (MGM API), 312 ndb_mgm_get_clusterlog_severity_filter() function (MGM API), 311 ndb_mgm_get_configuration_nodeid() function (MGM API), 301 ndb_mgm_get_connected_host() function (MGM API), 302 ndb_mgm_get_connected_port() function (MGM API), 301 ndb_mgm_get_connectstring() function (MGM API), 301 ndb_mgm_get_latest_error() function (MGM API), 298 ndb_mgm_get_latest_error_desc() function (MGM API), 299 ndb_mgm_get_latest_error_msg() function (MGM API), 299 ndb_mgm_get_loglevel_clusterlog() function (MGM API) - DEPRECATED, 312 ndb_mgm_get_status() function (MGM API), 305 ndb_mgm_get_version() function (MGM API), 302 ndb_mgm_is_connected() function (MGM API), 302 ndb_mgm_listen_event() function (MGM API), 296 ndb_mgm_node_state structure (MGM API), 324 ndb_mgm_node_status type (MGM API), 315 ndb_mgm_node_type type (MGM API), 315 ndb_mgm_number_of_mgmd_in_connect_string() function (MGM API), 303 ndb_mgm_reply structure (MGM API), 325 ndb_mgm_restart() function (MGM API), 309 ndb_mgm_restart2() function (MGM API), 309 ndb_mgm_restart3() function (MGM API), 310 ndb_mgm_restart4() function (MGM API), 310 ndb_mgm_set_bindaddress() function (MGM API), 303 ndb_mgm_set_clusterlog_loglevel() function (MGM API), 313 ndb_mgm_set_clusterlog_severity_filter() function (MGM API), 312 ndb_mgm_set_configuration_nodeid() function (MGM API), 304 ndb_mgm_set_connectstring() function (MGM API), 303 ndb_mgm_set_error_stream() function (MGM API), 299 ndb_mgm_set_ignore_sigpipe() function (MGM API), 300 ndb_mgm_set_name() function (MGM API), 300 ndb_mgm_set_timeout() function (MGM API), 304 ndb_mgm_start() function (MGM API), 307 ndb_mgm_start_backup() function (MGM API), 313 ndb_mgm_stop() function (MGM API), 307 ndb_mgm_stop2() function (MGM API), 307 ndb_mgm_stop3() function (MGM API), 308 ndb_mgm_stop4() function (MGM API), 308 ne() (method of NdbScanFilter), 146 newInstance (ClusterJ), 366, 366 nextEvent() (method of Ndb), 76 nextResult() (method of NdbScanOperation), 151 NoCommit defined, node defined, node failure defined, node restart defined, not (ClusterJ), 382, 385 NotPersistent (ClusterJ), 376 NullValue (ClusterJ), 376 nullValue (ClusterJ), 380 O Object class, 170 Object::FragmentType, 171 Object::getObjectId(), 173 Object::getObjectStatus(), 173 Object::getObjectVersion(), 173 Object::State, 171 Object::Status, 171 Object::Store, 172 Object::Type, 172 operations defined, scanning, single-row, transactions and, or (ClusterJ), 382 492 Index P param (ClusterJ), 386 PartitionKey (ClusterJ), 377 PartitionSpec (Ndb structure), 215 persist (ClusterJ), 366 PersistenceCapable (ClusterJ), 378 PersistenceModifier (ClusterJ), 378 Persistent (ClusterJ), 379 pollEvents() (method of Ndb), 75 Predicate (ClusterJ), 381 PredicateOperand (ClusterJ), 382 primaryKey (ClusterJ), 380 PrimaryKey (ClusterJ), 380 PROPERTY_CLUSTER_CONNECTION_SERVICE (ClusterJ), 356 PROPERTY_CLUSTER_CONNECTSTRING (ClusterJ), 356 PROPERTY_CLUSTER_CONNECT_DELAY (ClusterJ), 355 PROPERTY_CLUSTER_CONNECT_RETRIES (ClusterJ), 355 PROPERTY_CLUSTER_CONNECT_TIMEOUT_AFTER (ClusterJ), 355 PROPERTY_CLUSTER_CONNECT_TIMEOUT_BEFORE (ClusterJ), 356 PROPERTY_CLUSTER_CONNECT_VERBOSE (ClusterJ), 356 PROPERTY_CLUSTER_DATABASE (ClusterJ), 356 PROPERTY_CLUSTER_MAX_TRANSACTIONS (ClusterJ), 356 PROPERTY_DEFER_CHANGES (ClusterJ), 356 PROPERTY_JDBC_DRIVER_NAME (ClusterJ), 356 PROPERTY_JDBC_PASSWORD (ClusterJ), 356 PROPERTY_JDBC_URL (ClusterJ), 356 PROPERTY_JDBC_USERNAME (ClusterJ), 357 Q Query (ClusterJ), 358 QueryBuilder (ClusterJ), 384 QueryDefinition (ClusterJ), 385 QueryDomainType (ClusterJ), 386 R readData() (method of NdbBlob), 84 readTuple() (method of NdbIndexOperation), 96 readTuple() (method of NdbOperation), 133 readTuple() (method of NdbTransaction), 163 readTuples() (method of NdbIndexScanOperation), 99 readTuples() (method of NdbScanOperation), 150 read_attr() (method of NdbInterepretedCode), 106 record structure NDB, 10 refresh() (method of NdbTransaction), 160 Register-loading methods (NdbInterepretedCode), 105 releaseRecord() (method of Dictionary), 49 remove (ClusterJ), 366 removeCachedIndex() (method of Dictionary), 49 removeCachedTable() (method of Dictionary), 49 replica defined, reset_bounds() (method of NdbIndexScanOperation), 101 restart() (method of NdbScanOperation), 154 restore defined, Results (ClusterJ), 361 ret_sub() (method of NdbInterepretedCode), 121 rollback (ClusterJ), 370 S savePersistent (ClusterJ), 366 savePersistentAll (ClusterJ), 367 scan operations, characteristics, used for updates or deletes, with lock handling, ScanFlag (NdbScanOperation data type), 150 scanIndex() (method of NdbTransaction), 169 scans performing with NdbScanFilter and NdbScanOperation, 230 types supported, using secondary indexes example, 239 example (using NdbRecord), 242 scanTable() (method of NdbTransaction), 168 SCAN_TYPE (ClusterJ), 359 SCAN_TYPE_INDEX_SCAN (ClusterJ), 359 SCAN_TYPE_PRIMARY_KEY (ClusterJ), 359 SCAN_TYPE_TABLE_SCAN (ClusterJ), 359 SCAN_TYPE_UNIQUE_KEY (ClusterJ), 359 schema (ClusterJ), 378 Session (ClusterJ), 361 SessionFactory (ClusterJ), 368 SessionFactoryService (ClusterJ), 369 SESSION_FACTORY_SERVICE_CLASS_NAME (ClusterJ), 357 SESSION_FACTORY_SERVICE_FILE_NAME (ClusterJ), 357 setActiveHook() (method of NdbBlob), 82 setArrayType() (method of Column), 31 setAutoGrowSpecification() (method of LogfileGroup), 68 setAutoGrowSpecification() (method of Tablespace), 196 setCharset() (method of Column), 30 setDatabaseName() (method of Ndb), 72 setDatabaseSchemaName() (method of Ndb), 72 setDefaultLogfileGroup() (method of Tablespace), 196 setDefaultNoPartitionsFlag() (method of Table), 188 setDefaultValue() (method of Column), 32 setDurability() (method of Event), 56 setExtentSize() (method of Tablespace), 195 setFragmentCount() (method of Table), 186 setFragmentData() (method of Table), 188 setFragmentType() (method of Table), 186 setFrm() (method of Table), 188 setKValue() (method of Table), 187 setLength() (method of Column), 29 setLinearFlag() (method of Table), 186 setLockMode (ClusterJ), 367 setLogfileGroup() (method of Undofile), 200 setLogging() (method of Table), 186 setMaxLoadFactor() (method of Table), 187 setMaxRows() (method of Table), 188 setMinLoadFactor() (method of Table), 187 setName() (method of Column), 28 setName() (method of Event), 55 setName() (method of Index), 62 setName() (method of LogfileGroup), 67 setName() (method of Table), 185 setName() (method of Tablespace), 195 setNode() (method of Datafile), 37 setNode() (method of Undofile), 200 setNull() (method of NdbBlob), 83 setNullable() (method of Column), 28 setObjectType() (method of Table), 190 setParameter (ClusterJ), 361 setPartitionKey (ClusterJ), 367 setPartitionKey() (method of Column), 31 setPartSize() (method of Column), 30 setPath() (method of Datafile), 37 setPath() (method of Undofile), 200 setPos() (method of NdbBlob), 84 setPrecision() (method of Column), 29 setPrimaryKey() (method of Column), 28 setRangeListData() (method of Table), 189 setReport() (method of Event), 56 setRollbackOnly (ClusterJ), 370 493 Index setRowChecksumIndicator() (method of Table), 190 setRowGCIIndicator() (method of Table), 190 setScale() (method of Column), 29 setSize() (method of Datafile), 37 setSize() (method of Undofile), 200 setStatusInvalid() (method of Table), 190 setStorageType() (method of Column), 32 setStripeSize() (method of Column), 31 setTable() (method of Event), 56 setTable() (method of Index), 63 setTablespace() (method of Datafile), 37 setTablespace() (method of Table), 187 setTablespaceData() (method of Table), 189 setTablespaceNames() (method of Table), 189 setType() (method of Column), 28 setType() (method of Index), 64 setUndoBufferSize() (method of LogfileGroup), 67 setValue() (method of NdbBlob), 81 setValue() (method of NdbOperation), 131 set_auto_reconnect() (method of Ndb_cluster_connection), 205 set_name() (method of Ndb_cluster_connection), 203 set_optimized_node_selection() (method of Ndb_cluster_connection), 204 set_timeout() (method of Ndb_cluster_connection), 203 short_value() (method of NdbRecAttr), 137 SingleUserMode (Table data type), 177 SQL node defined, startTransaction() (method of Ndb), 72 State (NdbBlob data type), 81 State (NdbEventOperation data type), 90 State (Object data type), 171 Status (NdbError data type), 212 Status (Object data type), 171 StorageType (Column data type), 21 Store (Object data type), 172 sub_reg() (method of NdbInterepretedCode), 108 sub_val() (method of NdbInterepretedCode), 120 system crash defined, system restart defined, T table (ClusterJ), 378 Table class, 173 Table::addColumn(), 186 Table::aggregate(), 191 Table::equal(), 180 Table::getColumn(), 178 Table::getDefaultNoPartitionsFlag(), 184 Table::getFragmentCount(), 182 Table::getFragmentData(), 180 Table::getFragmentDataLen(), 181 Table::getFragmentNodes(), 182 Table::getFragmentType(), 178 Table::getFrmData(), 180 Table::getFrmLength(), 180 Table::getKValue(), 179 Table::getLinearFlag(), 182 Table::getLogging(), 178 Table::getMaxLoadFactor(), 179 Table::getMaxRows(), 184 Table::getMinLoadFactor(), 179 Table::getNoOfCOlumns(), 179 Table::getNoOfPrimaryKeys(), 179 Table::getObjectId(), 184 Table::getObjectStatus(), 183 Table::getObjectType(), 183 Table::getObjectVersion(), 184 Table::getPrimaryKey(), 180 Table::getRangeListData(), 181 Table::getRangeListDataLen(), 181 Table::getRowChecksumIndicator(), 185 Table::getRowGCIIndicator(), 185 Table::getTableId(), 178 Table::getTablespace(), 183 Table::getTablespaceData(), 181 Table::getTablespaceDataLen(), 181 Table::getTablespaceNames(), 184 Table::getTablespaceNamesLen(), 185 Table::hasDefaultValues(), 191 Table::setDefaultNoPartitionsFlag(), 188 Table::setFragmentCount(), 186 Table::setFragmentData(), 188 Table::setFragmentType(), 186 Table::setFrm(), 188 Table::setKValue(), 187 Table::setLinearFlag(), 186 Table::setLogging(), 186 Table::setMaxLoadFactor(), 187 Table::setMaxRows(), 188 Table::setMinLoadFactor(), 187 Table::setName(), 185 Table::setObjectType(), 190 Table::setRangeListData(), 189 Table::setRowChecksumIndicator(), 190 Table::setRowGCIIndicator(), 190 Table::setStatusInvalid(), 190 Table::setTablespace(), 187 Table::setTablespaceData(), 189 Table::setTablespaceNames(), 189 Table::SingleUserMode, 177 Table::validate(), 191 TableEvent (Event data type), 51 tableFragmentationChanged() (method of NdbEventOperation), 94 tableFrmChanged() (method of NdbEventOperation), 94 tableNameChanged() (method of NdbEventOperation), 94 Tablespace class, 192 Tablespace::getAutoGrowSpecification(), 194 Tablespace::getDefaultLogfileGroup(), 194 Tablespace::getDefaultLogfileGroupId(), 194 Tablespace::getExtentSize(), 194 Tablespace::getName(), 193 Tablespace::getObjectId(), 195 Tablespace::getObjectStatus(), 195 Tablespace::getObjectVersion(), 195 Tablespace::setAutoGrowSpecification(), 196 Tablespace::setDefaultLogfileGroup(), 196 Tablespace::setExtentSize(), 195 Tablespace::setName(), 195 TC and NDB Kernel, defined, selecting, threading, 10 Transaction (ClusterJ), 369 Transaction Coordinator defined, transactions concurrency, 10 example, 223 handling and transmission, 10 performance, 10 synchronous, example of use, 220 using, transporter defined, 494 Index truncate() (method of NdbBlob), 83 TUP and NDB Kernel, defined, Tuple Manager defined, Type (Index data type), 60 Type (NdbOperation data type), 126 Type (Object data type), 172 U Undofile class, 196 Undofile::getFileNo(), 199 Undofile::getLogfileGroup(), 198 Undofile::getLogfileGroupId(), 198 Undofile::getNode(), 199 Undofile::getObjectId(), 200 Undofile::getObjectStatus(), 199 Undofile::getObjectVersion(), 199 Undofile::getPath(), 198 Undofile::getSize(), 198 Undofile::setLogfileGroup(), 200 Undofile::setNode(), 200 Undofile::setPath(), 200 Undofile::setSize(), 200 unique (ClusterJ), 375 updateCurrentTuple() (method of NdbScanOperation), 153 updatePersistent (ClusterJ), 367 updatePersistentAll (ClusterJ), 368 updateTuple() (method of NdbIndexOperation), 97 updateTuple() (method of NdbOperation), 133 updateTuple() (method of NdbTransaction), 165 u_32_value() (method of NdbRecAttr), 138 u_64_value() (method of NdbRecAttr), 138 u_8_value() (method of NdbRecAttr), 139 u_char_value() (method of NdbRecAttr), 139 u_medium_value() (method of NdbRecAttr), 138 u_short_value() (method of NdbRecAttr), 139 V validate() (method of Table), 191 value (ClusterJ), 372, 373, 374, 375 vendorName (ClusterJ), 373 version information in MGM API, 302 W wait_until_ready() (method of Ndb_cluster_connection), 204 where (ClusterJ), 386 writeData() (method of NdbBlob), 84 writeTuple() (method of NdbOperation), 133 writeTuple() (method of NdbTransaction), 166 write_attr() (method of NdbInterepretedCode), 107 495 ...The MySQL Cluster API Developer Guide: Version 3.0 (2010-10-03) The MySQL Cluster API Developer Guide Document generated on: 2010-10-01 (revision: 22948) This guide provides information for developers... $withval then MYSQL_ CONFIG=$withval elif test -x $withval/bin /mysql_ config -a -f $withval/bin /mysql_ config then MYSQL_ CONFIG=$withval/bin /mysql_ config fi ], [ if test -x /usr/local /mysql/ bin /mysql_ config... AC_DEFUN([WITH _MYSQL] , [ AC_MSG_CHECKING(for mysql_ config executable) AC_ARG_WITH (mysql, [ with -mysql= PATH path to mysql_ config binary or mysql prefix dir], [ 13 The NDB API if test -x $withval

Ngày đăng: 05/11/2019, 15:40

Từ khóa liên quan

Mục lục

  • The MySQL Cluster API Developer Guide

  • Table of Contents

  • Chapter 1. Overview and Concepts

    • 1.1. Introduction

      • 1.1.1. The NDB API

      • 1.1.2. The MGM API

      • 1.2. Terminology

      • 1.3. The NDBCLUSTER Transaction and Scanning API

        • 1.3.1. Core NDB API Classes

        • 1.3.2. Application Program Basics

          • 1.3.2.1. Using Transactions

          • 1.3.2.2. Synchronous Transactions

          • 1.3.2.3. Operations

            • 1.3.2.3.1. Single-row operations

            • 1.3.2.3.2. Scan Operations

            • 1.3.2.3.3. Using Scans to Update or Delete Rows

            • 1.3.2.3.4. Lock Handling with Scans

            • 1.3.2.3.5. Error Handling

            • 1.3.3. Review of MySQL Cluster Concepts

              • 1.3.3.1. Selecting a Transaction Coordinator

              • 1.3.3.2. NDB Record Structure

              • 1.3.4. The Adaptive Send Algorithm

              • Chapter 2. The NDB API

                • 2.1. Getting Started with the NDB API

                  • 2.1.1. Compiling and Linking NDB API Programs

                    • 2.1.1.1. General Requirements

                    • 2.1.1.2. Compiler Options

                    • 2.1.1.3. Linker Options

                    • 2.1.1.4. Using Autotools

Tài liệu cùng người dùng

Tài liệu liên quan