22 #include "helpers.hpp"
26 #include "jtie_lib.hpp"
30 #include "CharsetMap.hpp"
33 #include "mysql_utils_jtie.hpp"
34 #include "mgmapi_jtie.hpp"
35 #include "ndbapi_jtie.hpp"
41 JTIE_INSTANTIATE_PEER_CLASS_MAPPING(c_m_n_m_CharsetMap,
42 "com/mysql/ndbjtie/mysql/CharsetMap")
46 JTIE_INSTANTIATE_PEER_CLASS_MAPPING(c_m_n_n_Ndb,
47 "com/mysql/ndbjtie/ndbapi/
Ndb")
48 JTIE_INSTANTIATE_PEER_CLASS_MAPPING(c_m_n_n_NdbBlob,
49 "com/mysql/ndbjtie/ndbapi/
NdbBlob")
50 JTIE_INSTANTIATE_PEER_CLASS_MAPPING(c_m_n_n_NdbDictionary,
52 JTIE_INSTANTIATE_PEER_CLASS_MAPPING(c_m_n_n_NdbDictionary_AutoGrowSpecification,
53 "com/mysql/ndbjtie/ndbapi/
NdbDictionary$AutoGrowSpecification")
54 JTIE_INSTANTIATE_PEER_CLASS_MAPPING(c_m_n_n_NdbDictionary_Column,
56 JTIE_INSTANTIATE_PEER_CLASS_MAPPING(c_m_n_n_NdbDictionary_Datafile,
58 JTIE_INSTANTIATE_PEER_CLASS_MAPPING(c_m_n_n_NdbDictionary_Dictionary,
60 JTIE_INSTANTIATE_PEER_CLASS_MAPPING(c_m_n_n_NdbDictionary_DictionaryConst_List,
61 "com/mysql/ndbjtie/ndbapi/
NdbDictionary$DictionaryConst$List")
62 JTIE_INSTANTIATE_PEER_CLASS_MAPPING(c_m_n_n_NdbDictionary_DictionaryConst_ListConst_Element,
63 "com/mysql/ndbjtie/ndbapi/
NdbDictionary$DictionaryConst$ListConst$Element")
64 JTIE_INSTANTIATE_PEER_CLASS_MAPPING(c_m_n_n_NdbDictionary_DictionaryConst_ListConst_ElementArray,
65 "com/mysql/ndbjtie/ndbapi/
NdbDictionary$DictionaryConst$ListConst$ElementArray")
66 JTIE_INSTANTIATE_PEER_CLASS_MAPPING(c_m_n_n_NdbDictionary_Event,
68 JTIE_INSTANTIATE_PEER_CLASS_MAPPING(c_m_n_n_NdbDictionary_Index,
70 JTIE_INSTANTIATE_PEER_CLASS_MAPPING(c_m_n_n_NdbDictionary_LogfileGroup,
72 JTIE_INSTANTIATE_PEER_CLASS_MAPPING(c_m_n_n_NdbDictionary_Object,
74 JTIE_INSTANTIATE_PEER_CLASS_MAPPING(c_m_n_n_NdbDictionary_ObjectId,
76 JTIE_INSTANTIATE_PEER_CLASS_MAPPING(c_m_n_n_NdbDictionary_OptimizeIndexHandle,
78 JTIE_INSTANTIATE_PEER_CLASS_MAPPING(c_m_n_n_NdbDictionary_OptimizeTableHandle,
80 JTIE_INSTANTIATE_PEER_CLASS_MAPPING(c_m_n_n_NdbDictionary_RecordSpecification,
82 JTIE_INSTANTIATE_PEER_CLASS_MAPPING(c_m_n_n_NdbDictionary_RecordSpecificationArray,
83 "com/mysql/ndbjtie/ndbapi/
NdbDictionary$RecordSpecificationArray")
84 JTIE_INSTANTIATE_PEER_CLASS_MAPPING(c_m_n_n_NdbDictionary_Table,
86 JTIE_INSTANTIATE_PEER_CLASS_MAPPING(c_m_n_n_NdbDictionary_Tablespace,
88 JTIE_INSTANTIATE_PEER_CLASS_MAPPING(c_m_n_n_NdbDictionary_Undofile,
90 JTIE_INSTANTIATE_PEER_CLASS_MAPPING(c_m_n_n_NdbError,
92 JTIE_INSTANTIATE_PEER_CLASS_MAPPING(c_m_n_n_NdbEventOperation,
94 JTIE_INSTANTIATE_PEER_CLASS_MAPPING(c_m_n_n_NdbIndexOperation,
96 JTIE_INSTANTIATE_PEER_CLASS_MAPPING(c_m_n_n_NdbIndexScanOperation,
98 JTIE_INSTANTIATE_PEER_CLASS_MAPPING(c_m_n_n_NdbIndexScanOperation_IndexBound,
100 JTIE_INSTANTIATE_PEER_CLASS_MAPPING(c_m_n_n_NdbInterpretedCode,
102 JTIE_INSTANTIATE_PEER_CLASS_MAPPING(c_m_n_n_NdbLockHandle,
104 JTIE_INSTANTIATE_PEER_CLASS_MAPPING(c_m_n_n_NdbOperation,
106 JTIE_INSTANTIATE_PEER_CLASS_MAPPING(c_m_n_n_NdbOperation_GetValueSpec,
108 JTIE_INSTANTIATE_PEER_CLASS_MAPPING(c_m_n_n_NdbOperation_GetValueSpecArray,
109 "com/mysql/ndbjtie/ndbapi/
NdbOperation$GetValueSpecArray")
110 JTIE_INSTANTIATE_PEER_CLASS_MAPPING(c_m_n_n_NdbOperation_OperationOptions,
111 "com/mysql/ndbjtie/ndbapi/
NdbOperation$OperationOptions")
112 JTIE_INSTANTIATE_PEER_CLASS_MAPPING(c_m_n_n_NdbOperation_SetValueSpec,
114 JTIE_INSTANTIATE_PEER_CLASS_MAPPING(c_m_n_n_NdbOperation_SetValueSpecArray,
115 "com/mysql/ndbjtie/ndbapi/
NdbOperation$SetValueSpecArray")
116 JTIE_INSTANTIATE_PEER_CLASS_MAPPING(c_m_n_n_NdbRecAttr,
118 JTIE_INSTANTIATE_PEER_CLASS_MAPPING(c_m_n_n_NdbRecord,
120 JTIE_INSTANTIATE_PEER_CLASS_MAPPING(c_m_n_n_NdbScanFilter,
122 JTIE_INSTANTIATE_PEER_CLASS_MAPPING(c_m_n_n_NdbScanOperation,
124 JTIE_INSTANTIATE_PEER_CLASS_MAPPING(c_m_n_n_NdbScanOperation_ScanOptions,
126 JTIE_INSTANTIATE_PEER_CLASS_MAPPING(c_m_n_n_NdbTransaction,
128 JTIE_INSTANTIATE_PEER_CLASS_MAPPING(c_m_n_n_Ndb_Key_part_ptr,
129 "com/mysql/ndbjtie/ndbapi/
Ndb$Key_part_ptr")
130 JTIE_INSTANTIATE_PEER_CLASS_MAPPING(c_m_n_n_Ndb_Key_part_ptrArray,
131 "com/mysql/ndbjtie/ndbapi/
Ndb$Key_part_ptrArray")
132 JTIE_INSTANTIATE_PEER_CLASS_MAPPING(c_m_n_n_Ndb_cluster_connection,
137 JTIE_INSTANTIATE_JINT_ENUM_TYPE_MAPPING(
NdbBlob::State)
138 JTIE_INSTANTIATE_JINT_ENUM_TYPE_MAPPING(
NdbDictionary::Object::Status)
139 JTIE_INSTANTIATE_JINT_ENUM_TYPE_MAPPING(
NdbDictionary::Object::Type)
140 JTIE_INSTANTIATE_JINT_ENUM_TYPE_MAPPING(
NdbDictionary::Object::State)
141 JTIE_INSTANTIATE_JINT_ENUM_TYPE_MAPPING(
NdbDictionary::Object::Store)
142 JTIE_INSTANTIATE_JINT_ENUM_TYPE_MAPPING(
NdbDictionary::Object::FragmentType)
143 JTIE_INSTANTIATE_JINT_ENUM_TYPE_MAPPING(
NdbDictionary::Column::Type)
144 JTIE_INSTANTIATE_JINT_ENUM_TYPE_MAPPING(
NdbDictionary::Column::ArrayType)
145 JTIE_INSTANTIATE_JINT_ENUM_TYPE_MAPPING(
NdbDictionary::Column::StorageType)
146 JTIE_INSTANTIATE_JINT_ENUM_TYPE_MAPPING(
NdbDictionary::Table::SingleUserMode)
147 JTIE_INSTANTIATE_JINT_ENUM_TYPE_MAPPING(
NdbDictionary::Index::Type)
148 JTIE_INSTANTIATE_JINT_ENUM_TYPE_MAPPING(
NdbDictionary::Event::TableEvent)
149 JTIE_INSTANTIATE_JINT_ENUM_TYPE_MAPPING(
NdbDictionary::Event::EventDurability)
151 JTIE_INSTANTIATE_JINT_ENUM_TYPE_MAPPING(
NdbDictionary::NdbRecordFlags)
152 JTIE_INSTANTIATE_JINT_ENUM_TYPE_MAPPING(
NdbDictionary::RecordType)
153 JTIE_INSTANTIATE_JINT_ENUM_TYPE_MAPPING(
NdbError::Status)
154 JTIE_INSTANTIATE_JINT_ENUM_TYPE_MAPPING(
NdbError::Classification)
157 JTIE_INSTANTIATE_JINT_ENUM_TYPE_MAPPING(
NdbOperation::Type)
158 JTIE_INSTANTIATE_JINT_ENUM_TYPE_MAPPING(
NdbOperation::LockMode)
159 JTIE_INSTANTIATE_JINT_ENUM_TYPE_MAPPING(
NdbOperation::AbortOption)
160 JTIE_INSTANTIATE_JINT_ENUM_TYPE_MAPPING(
NdbOperation::OperationOptions::Flags)
161 JTIE_INSTANTIATE_JINT_ENUM_TYPE_MAPPING(
NdbScanFilter::Group)
162 JTIE_INSTANTIATE_JINT_ENUM_TYPE_MAPPING(
NdbScanFilter::BinaryCondition)
163 JTIE_INSTANTIATE_JINT_ENUM_TYPE_MAPPING(
NdbScanFilter::Error)
165 JTIE_INSTANTIATE_JINT_ENUM_TYPE_MAPPING(
NdbScanOperation::ScanOptions::Type)
167 JTIE_INSTANTIATE_JINT_ENUM_TYPE_MAPPING(
NdbTransaction::CommitStatusType)
176 JNIEXPORT jint JNICALL
177 JNI_OnLoad(JavaVM * jvm,
void * reserved)
179 TRACE(
"jint JNI_OnLoad(JavaVM *, void *)");
180 VERBOSE(
"loading the NDB JTie library ...");
182 const jint required_jni_version = JTie_OnLoad(jvm, reserved);
183 if (required_jni_version == JNI_ERR) {
184 PRINT_ERROR(
"JTie_OnLoad() returned: JNI_ERR");
188 VERBOSE(
"initializing the NDBAPI resources ...");
189 int stat = ndb_init();
191 PRINT_ERROR_CODE(
"ndb_init() returned: ", stat);
194 VERBOSE(
"... initialized the NDBAPI resources");
196 VERBOSE(
"initializing the MySQL Utilities resources ...");
204 VERBOSE(
"... initialized the MySQL Utilities resources");
206 VERBOSE(
"... loaded the NDB JTie library");
207 return required_jni_version;
213 JNIEXPORT
void JNICALL
214 JNI_OnUnload(JavaVM * jvm,
void * reserved)
216 TRACE(
"void JNI_OnUnload(JavaVM *, void *)");
217 VERBOSE(
"unloading the NDB JTie library...");
219 VERBOSE(
"releasing the MySQL Utilities resources ...");
221 VERBOSE(
"... released the MySQL Utilities resources");
223 VERBOSE(
"releasing NDBAPI resources ...");
225 VERBOSE(
"... released NDBAPI resources");
227 JTie_OnUnload(jvm, reserved);
229 VERBOSE(
"... unloaded the NDB JTie library");