~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to plugin/mysql_protocol/net_serv.h

This patch completes the first step in the splitting of
the XA resource manager API from the storage engine API,
as outlined in the specification here:

http://drizzle.org/wiki/XaStorageEngine

* Splits plugin::StorageEngine into a base StorageEngine
  class and two derived classes, TransactionalStorageEngine
  and XaStorageEngine.  XaStorageEngine derives from
  TransactionalStorageEngine and creates the XA Resource
  Manager API for storage engines.

  - The methods moved from StorageEngine to TransactionalStorageEngine
    include releaseTemporaryLatches(), startConsistentSnapshot(), 
    commit(), rollback(), setSavepoint(), releaseSavepoint(),
    rollbackToSavepoint() and hasTwoPhaseCommit()
  - The methods moved from StorageEngine to XaStorageEngine
    include recover(), commitXid(), rollbackXid(), and prepare()

* Places all static "EngineVector"s into their proper
  namespaces (typedefs belong in header files, not implementation files)
  and places all static methods corresponding
  to either only transactional engines or only XA engines
  into their respective files in /drizzled/plugin/

* Modifies the InnoDB "handler" files to extend plugin::XaStorageEngine
  and not plugin::StorageEngine

The next step, as outlined in the wiki spec page above, is to isolate
the XA Resource Manager API into its own plugin class and modify
plugin::XaStorageEngine to implement plugin::XaResourceManager via
composition.  This is necessary to enable building plugins which can
participate in an XA transaction *without having to have that plugin
implement the entire storage engine API*

Show diffs side-by-side

added added

removed removed

Lines of Context:
23
23
 
24
24
#include "vio.h"
25
25
 
 
26
#include <stdint.h>
 
27
 
26
28
#define LIBDRIZZLE_ERRMSG_SIZE 512
27
29
#define LIBDRIZZLE_SQLSTATE_LENGTH 5
28
30
 
29
 
namespace drizzle_plugin
30
 
{
 
31
#ifdef __cplusplus
 
32
extern "C" {
 
33
#endif
31
34
 
32
35
typedef struct st_net {
33
36
  Vio *vio;
66
69
  void *extension;
67
70
} NET;
68
71
 
69
 
bool drizzleclient_net_init(NET *net, Vio* vio, uint32_t buffer_length);
70
 
void drizzleclient_net_end(NET *net);
71
 
void drizzleclient_net_clear(NET *net, bool clear_buffer);
72
 
bool drizzleclient_net_flush(NET *net);
73
 
bool drizzleclient_net_write(NET *net,const unsigned char *packet, size_t len);
74
 
bool drizzleclient_net_write_command(NET *net,unsigned char command,
75
 
                                     const unsigned char *header, size_t head_len,
76
 
                                     const unsigned char *packet, size_t len);
77
 
uint32_t drizzleclient_net_read(NET *net);
78
 
void drizzleclient_net_close(NET *net);
79
 
bool drizzleclient_net_init_sock(NET * net, int sock, uint32_t buffer_length);
80
 
bool drizzleclient_net_peer_addr(NET *net, char *buf, uint16_t *port, size_t buflen);
81
 
void drizzleclient_net_keepalive(NET *net, bool flag);
82
 
int drizzleclient_net_get_sd(NET *net);
83
 
bool drizzleclient_net_more_data(NET *net);
84
 
 
85
 
void drizzleclient_net_set_write_timeout(NET *net, uint32_t timeout);
86
 
void drizzleclient_net_set_read_timeout(NET *net, uint32_t timeout);
87
 
void drizzleclient_drizzleclient_net_clear_error(NET *net);
88
 
 
89
 
} /* namespace drizzle_plugin */
 
72
  bool drizzleclient_net_init(NET *net, Vio* vio, uint32_t buffer_length);
 
73
  void drizzleclient_net_end(NET *net);
 
74
  void drizzleclient_net_clear(NET *net, bool clear_buffer);
 
75
  bool drizzleclient_net_flush(NET *net);
 
76
  bool drizzleclient_net_write(NET *net,const unsigned char *packet, size_t len);
 
77
  bool drizzleclient_net_write_command(NET *net,unsigned char command,
 
78
                         const unsigned char *header, size_t head_len,
 
79
                         const unsigned char *packet, size_t len);
 
80
  uint32_t drizzleclient_net_read(NET *net);
 
81
  void drizzleclient_net_close(NET *net);
 
82
  bool drizzleclient_net_init_sock(NET * net, int sock, int flags,
 
83
                                   uint32_t buffer_length);
 
84
  bool drizzleclient_net_peer_addr(NET *net, char *buf, uint16_t *port, size_t buflen);
 
85
  void drizzleclient_net_keepalive(NET *net, bool flag);
 
86
  int drizzleclient_net_get_sd(NET *net);
 
87
  bool drizzleclient_net_more_data(NET *net);
 
88
 
 
89
  void drizzleclient_net_set_write_timeout(NET *net, uint32_t timeout);
 
90
  void drizzleclient_net_set_read_timeout(NET *net, uint32_t timeout);
 
91
  void drizzleclient_drizzleclient_net_clear_error(NET *net);
 
92
 
 
93
#ifdef __cplusplus
 
94
}
 
95
#endif
90
96
 
91
97
#endif /* PLUGIN_MYSQL_PROTOCOL_NET_SERV_H */