1 /** 2 * Licensed to the Apache Software Foundation (ASF) under one 3 * or more contributor license agreements. See the NOTICE file 4 * distributed with this work for additional information 5 * regarding copyright ownership. The ASF licenses this file 6 * to you under the Apache License, Version 2.0 (the 7 * "License"); you may not use this file except in compliance 8 * with the License. You may obtain a copy of the License at 9 * 10 * http://www.apache.org/licenses/LICENSE-2.0 11 * 12 * Unless required by applicable law or agreed to in writing, software 13 * distributed under the License is distributed on an "AS IS" BASIS, 14 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 * See the License for the specific language governing permissions and 16 * limitations under the License. 17 */ 18 module deimos.zookeeper.zookeeper_jute; 19 20 import deimos.zookeeper.recordio; 21 //#ifndef __ZOOKEEPER_JUTE__ 22 //#define __ZOOKEEPER_JUTE__ 23 //#include "recordio.h" 24 // 25 //#ifdef __cplusplus 26 //extern "C" { 27 //#endif 28 // 29 extern(C): 30 @nogc: 31 nothrow: 32 33 struct Id { 34 char * scheme; 35 char * id; 36 }; 37 int serialize_Id( oarchive * out_, const char *tag, Id *v); 38 int deserialize_Id( iarchive * in_, const char *tag, Id*v); 39 void deallocate_Id( Id*); 40 struct ACL { 41 int32_t perms; 42 Id id; 43 }; 44 int serialize_ACL( oarchive *out__, const char *tag, ACL *v); 45 int deserialize_ACL( iarchive *in__, const char *tag, ACL*v); 46 void deallocate_ACL( ACL*); 47 struct Stat { 48 int64_t czxid; 49 int64_t mzxid; 50 int64_t ctime; 51 int64_t mtime; 52 int32_t version_; 53 int32_t cversion; 54 int32_t aversion; 55 int64_t ephemeralOwner; 56 int32_t dataLength; 57 int32_t numChildren; 58 int64_t pzxid; 59 }; 60 int serialize_Stat( oarchive *out__, const char *tag, Stat *v); 61 int deserialize_Stat( iarchive *in__, const char *tag, Stat*v); 62 void deallocate_Stat( Stat*); 63 struct StatPersisted { 64 int64_t czxid; 65 int64_t mzxid; 66 int64_t ctime; 67 int64_t mtime; 68 int32_t version_; 69 int32_t cversion; 70 int32_t aversion; 71 int64_t ephemeralOwner; 72 int64_t pzxid; 73 }; 74 int serialize_StatPersisted( oarchive *out__, const char *tag, StatPersisted *v); 75 int deserialize_StatPersisted( iarchive *in__, const char *tag, StatPersisted*v); 76 void deallocate_StatPersisted( StatPersisted*); 77 struct StatPersistedV1 { 78 int64_t czxid; 79 int64_t mzxid; 80 int64_t ctime; 81 int64_t mtime; 82 int32_t version_; 83 int32_t cversion; 84 int32_t aversion; 85 int64_t ephemeralOwner; 86 }; 87 int serialize_StatPersistedV1( oarchive *out__, const char *tag, StatPersistedV1 *v); 88 int deserialize_StatPersistedV1( iarchive *in__, const char *tag, StatPersistedV1*v); 89 void deallocate_StatPersistedV1( StatPersistedV1*); 90 91 92 struct ConnectRequest { 93 int32_t protocolVersion; 94 int64_t lastZxidSeen; 95 int32_t timeOut; 96 int64_t sessionId; 97 buffer passwd; 98 }; 99 int serialize_ConnectRequest( oarchive *out__, const char *tag, ConnectRequest *v); 100 int deserialize_ConnectRequest( iarchive *in__, const char *tag, ConnectRequest*v); 101 void deallocate_ConnectRequest( ConnectRequest*); 102 struct ConnectResponse { 103 int32_t protocolVersion; 104 int32_t timeOut; 105 int64_t sessionId; 106 buffer passwd; 107 }; 108 int serialize_ConnectResponse( oarchive *out__, const char *tag, ConnectResponse *v); 109 int deserialize_ConnectResponse( iarchive *in__, const char *tag, ConnectResponse*v); 110 void deallocate_ConnectResponse( ConnectResponse*); 111 112 113 114 struct String_vector { 115 int32_t count; 116 char * *data; 117 118 }; 119 int serialize_String_vector( oarchive *out__, const char *tag, String_vector *v); 120 int deserialize_String_vector( iarchive *in__, const char *tag, String_vector *v); 121 int allocate_String_vector( String_vector *v, int32_t len); 122 int deallocate_String_vector( String_vector *v); 123 124 125 126 struct SetWatches { 127 int64_t relativeZxid; 128 String_vector dataWatches; 129 String_vector existWatches; 130 String_vector childWatches; 131 }; 132 int serialize_SetWatches( oarchive *out__, const char *tag, SetWatches *v); 133 int deserialize_SetWatches( iarchive *in__, const char *tag, SetWatches*v); 134 void deallocate_SetWatches( SetWatches*); 135 136 137 struct RequestHeader { 138 int32_t xid; 139 int32_t type; 140 }; 141 int serialize_RequestHeader( oarchive *out__, const char *tag, RequestHeader *v); 142 int deserialize_RequestHeader( iarchive *in__, const char *tag, RequestHeader*v); 143 void deallocate_RequestHeader( RequestHeader*); 144 145 struct MultiHeader { 146 int32_t type; 147 int32_t done; 148 int32_t err; 149 }; 150 int serialize_MultiHeader( oarchive *out__, const char *tag, MultiHeader *v); 151 int deserialize_MultiHeader( iarchive *in__, const char *tag, MultiHeader*v); 152 void deallocate_MultiHeader( MultiHeader*); 153 struct AuthPacket { 154 int32_t type; 155 char * scheme; 156 buffer auth; 157 }; 158 int serialize_AuthPacket(oarchive *out_, const char *tag,AuthPacket *v); 159 int deserialize_AuthPacket(iarchive *in_, const char *tag,AuthPacket*v); 160 void deallocate_AuthPacket(AuthPacket*); 161 struct ReplyHeader { 162 int32_t xid; 163 int64_t zxid; 164 int32_t err; 165 }; 166 int serialize_ReplyHeader(oarchive *out_, const char *tag,ReplyHeader *v); 167 int deserialize_ReplyHeader(iarchive *in_, const char *tag,ReplyHeader*v); 168 void deallocate_ReplyHeader(ReplyHeader*); 169 struct GetDataRequest { 170 char * path; 171 int32_t watch; 172 }; 173 int serialize_GetDataRequest(oarchive *out_, const char *tag,GetDataRequest *v); 174 int deserialize_GetDataRequest(iarchive *in_, const char *tag,GetDataRequest*v); 175 void deallocate_GetDataRequest(GetDataRequest*); 176 struct SetDataRequest { 177 char * path; 178 buffer data; 179 int32_t version_; 180 }; 181 int serialize_SetDataRequest(oarchive *out_, const char *tag,SetDataRequest *v); 182 int deserialize_SetDataRequest(iarchive *in_, const char *tag,SetDataRequest*v); 183 void deallocate_SetDataRequest(SetDataRequest*); 184 struct SetDataResponse { 185 Stat stat; 186 }; 187 int serialize_SetDataResponse(oarchive *out_, const char *tag,SetDataResponse *v); 188 int deserialize_SetDataResponse(iarchive *in_, const char *tag,SetDataResponse*v); 189 void deallocate_SetDataResponse(SetDataResponse*); 190 struct GetSASLRequest { 191 buffer token; 192 }; 193 int serialize_GetSASLRequest(oarchive *out_, const char *tag,GetSASLRequest *v); 194 int deserialize_GetSASLRequest(iarchive *in_, const char *tag,GetSASLRequest*v); 195 void deallocate_GetSASLRequest(GetSASLRequest*); 196 struct SetSASLRequest { 197 buffer token; 198 }; 199 int serialize_SetSASLRequest(oarchive *out_, const char *tag,SetSASLRequest *v); 200 int deserialize_SetSASLRequest(iarchive *in_, const char *tag,SetSASLRequest*v); 201 void deallocate_SetSASLRequest(SetSASLRequest*); 202 struct SetSASLResponse { 203 buffer token; 204 }; 205 int serialize_SetSASLResponse(oarchive *out_, const char *tag,SetSASLResponse *v); 206 int deserialize_SetSASLResponse(iarchive *in_, const char *tag,SetSASLResponse*v); 207 void deallocate_SetSASLResponse(SetSASLResponse*); 208 struct ACL_vector { 209 int32_t count; 210 ACL *data; 211 212 }; 213 int serialize_ACL_vector(oarchive *out_, const char *tag,ACL_vector *v); 214 int deserialize_ACL_vector(iarchive *in_, const char *tag,ACL_vector *v); 215 int allocate_ACL_vector(ACL_vector *v, int32_t len); 216 int deallocate_ACL_vector(ACL_vector *v); 217 struct CreateRequest { 218 char * path; 219 buffer data; 220 ACL_vector acl; 221 int32_t flags; 222 }; 223 int serialize_CreateRequest(oarchive *out_, const char *tag,CreateRequest *v); 224 int deserialize_CreateRequest(iarchive *in_, const char *tag,CreateRequest*v); 225 void deallocate_CreateRequest(CreateRequest*); 226 struct DeleteRequest { 227 char * path; 228 int32_t version_; 229 }; 230 int serialize_DeleteRequest(oarchive *out_, const char *tag,DeleteRequest *v); 231 int deserialize_DeleteRequest(iarchive *in_, const char *tag,DeleteRequest*v); 232 void deallocate_DeleteRequest(DeleteRequest*); 233 struct GetChildrenRequest { 234 char * path; 235 int32_t watch; 236 }; 237 int serialize_GetChildrenRequest(oarchive *out_, const char *tag,GetChildrenRequest *v); 238 int deserialize_GetChildrenRequest(iarchive *in_, const char *tag,GetChildrenRequest*v); 239 void deallocate_GetChildrenRequest(GetChildrenRequest*); 240 struct GetChildren2Request { 241 char * path; 242 int32_t watch; 243 }; 244 int serialize_GetChildren2Request(oarchive *out_, const char *tag,GetChildren2Request *v); 245 int deserialize_GetChildren2Request(iarchive *in_, const char *tag,GetChildren2Request*v); 246 void deallocate_GetChildren2Request(GetChildren2Request*); 247 struct CheckVersionRequest { 248 char * path; 249 int32_t version_; 250 }; 251 int serialize_CheckVersionRequest(oarchive *out_, const char *tag,CheckVersionRequest *v); 252 int deserialize_CheckVersionRequest(iarchive *in_, const char *tag,CheckVersionRequest*v); 253 void deallocate_CheckVersionRequest(CheckVersionRequest*); 254 struct GetMaxChildrenRequest { 255 char * path; 256 }; 257 int serialize_GetMaxChildrenRequest(oarchive *out_, const char *tag,GetMaxChildrenRequest *v); 258 int deserialize_GetMaxChildrenRequest(iarchive *in_, const char *tag,GetMaxChildrenRequest*v); 259 void deallocate_GetMaxChildrenRequest(GetMaxChildrenRequest*); 260 struct GetMaxChildrenResponse { 261 int32_t max; 262 }; 263 int serialize_GetMaxChildrenResponse(oarchive *out_, const char *tag,GetMaxChildrenResponse *v); 264 int deserialize_GetMaxChildrenResponse(iarchive *in_, const char *tag,GetMaxChildrenResponse*v); 265 void deallocate_GetMaxChildrenResponse(GetMaxChildrenResponse*); 266 struct SetMaxChildrenRequest { 267 char * path; 268 int32_t max; 269 }; 270 int serialize_SetMaxChildrenRequest(oarchive *out_, const char *tag,SetMaxChildrenRequest *v); 271 int deserialize_SetMaxChildrenRequest(iarchive *in_, const char *tag,SetMaxChildrenRequest*v); 272 void deallocate_SetMaxChildrenRequest(SetMaxChildrenRequest*); 273 struct SyncRequest { 274 char * path; 275 }; 276 int serialize_SyncRequest(oarchive *out_, const char *tag,SyncRequest *v); 277 int deserialize_SyncRequest(iarchive *in_, const char *tag,SyncRequest*v); 278 void deallocate_SyncRequest(SyncRequest*); 279 struct SyncResponse { 280 char * path; 281 }; 282 int serialize_SyncResponse(oarchive *out_, const char *tag,SyncResponse *v); 283 int deserialize_SyncResponse(iarchive *in_, const char *tag,SyncResponse*v); 284 void deallocate_SyncResponse(SyncResponse*); 285 struct GetACLRequest { 286 char * path; 287 }; 288 int serialize_GetACLRequest(oarchive *out_, const char *tag,GetACLRequest *v); 289 int deserialize_GetACLRequest(iarchive *in_, const char *tag,GetACLRequest*v); 290 void deallocate_GetACLRequest(GetACLRequest*); 291 struct SetACLRequest { 292 char * path; 293 ACL_vector acl; 294 int32_t version_; 295 }; 296 int serialize_SetACLRequest(oarchive *out_, const char *tag,SetACLRequest *v); 297 int deserialize_SetACLRequest(iarchive *in_, const char *tag,SetACLRequest*v); 298 void deallocate_SetACLRequest(SetACLRequest*); 299 struct SetACLResponse { 300 Stat stat; 301 }; 302 int serialize_SetACLResponse(oarchive *out_, const char *tag,SetACLResponse *v); 303 int deserialize_SetACLResponse(iarchive *in_, const char *tag,SetACLResponse*v); 304 void deallocate_SetACLResponse(SetACLResponse*); 305 struct WatcherEvent { 306 int32_t type; 307 int32_t state; 308 char * path; 309 }; 310 int serialize_WatcherEvent(oarchive *out_, const char *tag,WatcherEvent *v); 311 int deserialize_WatcherEvent(iarchive *in_, const char *tag,WatcherEvent*v); 312 void deallocate_WatcherEvent(WatcherEvent*); 313 struct ErrorResponse { 314 int32_t err; 315 }; 316 int serialize_ErrorResponse(oarchive *out_, const char *tag,ErrorResponse *v); 317 int deserialize_ErrorResponse(iarchive *in_, const char *tag,ErrorResponse*v); 318 void deallocate_ErrorResponse(ErrorResponse*); 319 struct CreateResponse { 320 char * path; 321 }; 322 int serialize_CreateResponse(oarchive *out_, const char *tag,CreateResponse *v); 323 int deserialize_CreateResponse(iarchive *in_, const char *tag,CreateResponse*v); 324 void deallocate_CreateResponse(CreateResponse*); 325 struct ExistsRequest { 326 char * path; 327 int32_t watch; 328 }; 329 int serialize_ExistsRequest(oarchive *out_, const char *tag,ExistsRequest *v); 330 int deserialize_ExistsRequest(iarchive *in_, const char *tag,ExistsRequest*v); 331 void deallocate_ExistsRequest(ExistsRequest*); 332 struct ExistsResponse { 333 Stat stat; 334 }; 335 int serialize_ExistsResponse(oarchive *out_, const char *tag,ExistsResponse *v); 336 int deserialize_ExistsResponse(iarchive *in_, const char *tag,ExistsResponse*v); 337 void deallocate_ExistsResponse(ExistsResponse*); 338 struct GetDataResponse { 339 buffer data; 340 Stat stat; 341 }; 342 int serialize_GetDataResponse(oarchive *out_, const char *tag,GetDataResponse *v); 343 int deserialize_GetDataResponse(iarchive *in_, const char *tag,GetDataResponse*v); 344 void deallocate_GetDataResponse(GetDataResponse*); 345 struct GetChildrenResponse { 346 String_vector children; 347 }; 348 int serialize_GetChildrenResponse(oarchive *out_, const char *tag,GetChildrenResponse *v); 349 int deserialize_GetChildrenResponse(iarchive *in_, const char *tag,GetChildrenResponse*v); 350 void deallocate_GetChildrenResponse(GetChildrenResponse*); 351 struct GetChildren2Response { 352 String_vector children; 353 Stat stat; 354 }; 355 int serialize_GetChildren2Response(oarchive *out_, const char *tag,GetChildren2Response *v); 356 int deserialize_GetChildren2Response(iarchive *in_, const char *tag,GetChildren2Response*v); 357 void deallocate_GetChildren2Response(GetChildren2Response*); 358 struct GetACLResponse { 359 ACL_vector acl; 360 Stat stat; 361 }; 362 int serialize_GetACLResponse(oarchive *out_, const char *tag,GetACLResponse *v); 363 int deserialize_GetACLResponse(iarchive *in_, const char *tag,GetACLResponse*v); 364 void deallocate_GetACLResponse(GetACLResponse*); 365 struct LearnerInfo { 366 int64_t serverid; 367 int32_t protocolVersion; 368 }; 369 int serialize_LearnerInfo(oarchive *out_, const char *tag,LearnerInfo *v); 370 int deserialize_LearnerInfo(iarchive *in_, const char *tag,LearnerInfo*v); 371 void deallocate_LearnerInfo(LearnerInfo*); 372 struct Id_vector { 373 int32_t count; 374 Id *data; 375 376 }; 377 int serialize_Id_vector(oarchive *out_, const char *tag,Id_vector *v); 378 int deserialize_Id_vector(iarchive *in_, const char *tag,Id_vector *v); 379 int allocate_Id_vector(Id_vector *v, int32_t len); 380 int deallocate_Id_vector(Id_vector *v); 381 struct QuorumPacket { 382 int32_t type; 383 int64_t zxid; 384 buffer data; 385 Id_vector authinfo; 386 }; 387 int serialize_QuorumPacket(oarchive *out_, const char *tag,QuorumPacket *v); 388 int deserialize_QuorumPacket(iarchive *in_, const char *tag,QuorumPacket*v); 389 void deallocate_QuorumPacket(QuorumPacket*); 390 struct FileHeader { 391 int32_t magic; 392 int32_t version_; 393 int64_t dbid; 394 }; 395 int serialize_FileHeader(oarchive *out_, const char *tag,FileHeader *v); 396 int deserialize_FileHeader(iarchive *in_, const char *tag,FileHeader*v); 397 void deallocate_FileHeader(FileHeader*); 398 struct TxnHeader { 399 int64_t clientId; 400 int32_t cxid; 401 int64_t zxid; 402 int64_t time; 403 int32_t type; 404 }; 405 int serialize_TxnHeader(oarchive *out_, const char *tag,TxnHeader *v); 406 int deserialize_TxnHeader(iarchive *in_, const char *tag,TxnHeader*v); 407 void deallocate_TxnHeader(TxnHeader*); 408 struct CreateTxnV0 { 409 char * path; 410 buffer data; 411 ACL_vector acl; 412 int32_t ephemeral; 413 }; 414 int serialize_CreateTxnV0(oarchive *out_, const char *tag,CreateTxnV0 *v); 415 int deserialize_CreateTxnV0(iarchive *in_, const char *tag,CreateTxnV0*v); 416 void deallocate_CreateTxnV0(CreateTxnV0*); 417 struct CreateTxn { 418 char * path; 419 buffer data; 420 ACL_vector acl; 421 int32_t ephemeral; 422 int32_t parentCVersion; 423 }; 424 int serialize_CreateTxn(oarchive *out_, const char *tag,CreateTxn *v); 425 int deserialize_CreateTxn(iarchive *in_, const char *tag,CreateTxn*v); 426 void deallocate_CreateTxn(CreateTxn*); 427 struct DeleteTxn { 428 char * path; 429 }; 430 int serialize_DeleteTxn(oarchive *out_, const char *tag,DeleteTxn *v); 431 int deserialize_DeleteTxn(iarchive *in_, const char *tag,DeleteTxn*v); 432 void deallocate_DeleteTxn(DeleteTxn*); 433 struct SetDataTxn { 434 char * path; 435 buffer data; 436 int32_t version_; 437 }; 438 int serialize_SetDataTxn(oarchive *out_, const char *tag,SetDataTxn *v); 439 int deserialize_SetDataTxn(iarchive *in_, const char *tag,SetDataTxn*v); 440 void deallocate_SetDataTxn(SetDataTxn*); 441 struct CheckVersionTxn { 442 char * path; 443 int32_t version_; 444 }; 445 int serialize_CheckVersionTxn(oarchive *out_, const char *tag,CheckVersionTxn *v); 446 int deserialize_CheckVersionTxn(iarchive *in_, const char *tag,CheckVersionTxn*v); 447 void deallocate_CheckVersionTxn(CheckVersionTxn*); 448 struct SetACLTxn { 449 char * path; 450 ACL_vector acl; 451 int32_t version_; 452 }; 453 int serialize_SetACLTxn(oarchive *out_, const char *tag,SetACLTxn *v); 454 int deserialize_SetACLTxn(iarchive *in_, const char *tag,SetACLTxn*v); 455 void deallocate_SetACLTxn(SetACLTxn*); 456 struct SetMaxChildrenTxn { 457 char * path; 458 int32_t max; 459 }; 460 int serialize_SetMaxChildrenTxn(oarchive *out_, const char *tag,SetMaxChildrenTxn *v); 461 int deserialize_SetMaxChildrenTxn(iarchive *in_, const char *tag,SetMaxChildrenTxn*v); 462 void deallocate_SetMaxChildrenTxn(SetMaxChildrenTxn*); 463 struct CreateSessionTxn { 464 int32_t timeOut; 465 }; 466 int serialize_CreateSessionTxn(oarchive *out_, const char *tag,CreateSessionTxn *v); 467 int deserialize_CreateSessionTxn(iarchive *in_, const char *tag,CreateSessionTxn*v); 468 void deallocate_CreateSessionTxn(CreateSessionTxn*); 469 struct ErrorTxn { 470 int32_t err; 471 }; 472 int serialize_ErrorTxn(oarchive *out_, const char *tag,ErrorTxn *v); 473 int deserialize_ErrorTxn(iarchive *in_, const char *tag,ErrorTxn*v); 474 void deallocate_ErrorTxn(ErrorTxn*); 475 struct Txn { 476 int32_t type; 477 buffer data; 478 }; 479 int serialize_Txn(oarchive *out_, const char *tag,Txn *v); 480 int deserialize_Txn(iarchive *in_, const char *tag,Txn*v); 481 void deallocate_Txn(Txn*); 482 struct Txn_vector { 483 int32_t count; 484 Txn *data; 485 486 }; 487 int serialize_Txn_vector(oarchive *out_, const char *tag,Txn_vector *v); 488 int deserialize_Txn_vector(iarchive *in_, const char *tag,Txn_vector *v); 489 int allocate_Txn_vector(Txn_vector *v, int32_t len); 490 int deallocate_Txn_vector(Txn_vector *v); 491 struct MultiTxn { 492 Txn_vector txns; 493 }; 494 int serialize_MultiTxn(oarchive *out_, const char *tag,MultiTxn *v); 495 int deserialize_MultiTxn(iarchive *in_, const char *tag,MultiTxn*v); 496 void deallocate_MultiTxn(MultiTxn*);