You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

134 lines
5.7 KiB

  1. /* -*- mode: C++; c-basic-offset: 4; indent-tabs-mode: nil -*- */
  2. // vim: ft=cpp:expandtab:ts=8:sw=4:softtabstop=4:
  3. #ifndef TOKU_LOGGGER_H
  4. #define TOKU_LOGGGER_H
  5. #ident "$Id$"
  6. /*
  7. COPYING CONDITIONS NOTICE:
  8. This program is free software; you can redistribute it and/or modify
  9. it under the terms of version 2 of the GNU General Public License as
  10. published by the Free Software Foundation, and provided that the
  11. following conditions are met:
  12. * Redistributions of source code must retain this COPYING
  13. CONDITIONS NOTICE, the COPYRIGHT NOTICE (below), the
  14. DISCLAIMER (below), the UNIVERSITY PATENT NOTICE (below), the
  15. PATENT MARKING NOTICE (below), and the PATENT RIGHTS
  16. GRANT (below).
  17. * Redistributions in binary form must reproduce this COPYING
  18. CONDITIONS NOTICE, the COPYRIGHT NOTICE (below), the
  19. DISCLAIMER (below), the UNIVERSITY PATENT NOTICE (below), the
  20. PATENT MARKING NOTICE (below), and the PATENT RIGHTS
  21. GRANT (below) in the documentation and/or other materials
  22. provided with the distribution.
  23. You should have received a copy of the GNU General Public License
  24. along with this program; if not, write to the Free Software
  25. Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
  26. 02110-1301, USA.
  27. COPYRIGHT NOTICE:
  28. TokuDB, Tokutek Fractal Tree Indexing Library.
  29. Copyright (C) 2007-2013 Tokutek, Inc.
  30. DISCLAIMER:
  31. This program is distributed in the hope that it will be useful, but
  32. WITHOUT ANY WARRANTY; without even the implied warranty of
  33. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  34. General Public License for more details.
  35. UNIVERSITY PATENT NOTICE:
  36. The technology is licensed by the Massachusetts Institute of
  37. Technology, Rutgers State University of New Jersey, and the Research
  38. Foundation of State University of New York at Stony Brook under
  39. United States of America Serial No. 11/760379 and to the patents
  40. and/or patent applications resulting from it.
  41. PATENT MARKING NOTICE:
  42. This software is covered by US Patent No. 8,185,551.
  43. PATENT RIGHTS GRANT:
  44. "THIS IMPLEMENTATION" means the copyrightable works distributed by
  45. Tokutek as part of the Fractal Tree project.
  46. "PATENT CLAIMS" means the claims of patents that are owned or
  47. licensable by Tokutek, both currently or in the future; and that in
  48. the absence of this license would be infringed by THIS
  49. IMPLEMENTATION or by using or running THIS IMPLEMENTATION.
  50. "PATENT CHALLENGE" shall mean a challenge to the validity,
  51. patentability, enforceability and/or non-infringement of any of the
  52. PATENT CLAIMS or otherwise opposing any of the PATENT CLAIMS.
  53. Tokutek hereby grants to you, for the term and geographical scope of
  54. the PATENT CLAIMS, a non-exclusive, no-charge, royalty-free,
  55. irrevocable (except as stated in this section) patent license to
  56. make, have made, use, offer to sell, sell, import, transfer, and
  57. otherwise run, modify, and propagate the contents of THIS
  58. IMPLEMENTATION, where such license applies only to the PATENT
  59. CLAIMS. This grant does not include claims that would be infringed
  60. only as a consequence of further modifications of THIS
  61. IMPLEMENTATION. If you or your agent or licensee institute or order
  62. or agree to the institution of patent litigation against any entity
  63. (including a cross-claim or counterclaim in a lawsuit) alleging that
  64. THIS IMPLEMENTATION constitutes direct or contributory patent
  65. infringement, or inducement of patent infringement, then any rights
  66. granted to you under this License shall terminate as of the date
  67. such litigation is filed. If you or your agent or exclusive
  68. licensee institute or order or agree to the institution of a PATENT
  69. CHALLENGE, then Tokutek may terminate any rights granted to you
  70. under this License.
  71. */
  72. #ident "Copyright (c) 2007-2013 Tokutek Inc. All rights reserved."
  73. #ident "The technology is licensed by the Massachusetts Institute of Technology, Rutgers State University of New Jersey, and the Research Foundation of State University of New York at Stony Brook under United States of America Serial No. 11/760379 and to the patents and/or patent applications resulting from it."
  74. #include <toku_portability.h>
  75. #include <errno.h>
  76. #include <db.h>
  77. #include "fttypes.h"
  78. #include "memory.h"
  79. #include "x1764.h"
  80. struct roll_entry;
  81. #include "logger.h"
  82. #include "rollback.h"
  83. #include "recover.h"
  84. #include "txn.h"
  85. static inline int toku_copy_BYTESTRING(BYTESTRING *target, BYTESTRING val) {
  86. target->len = val.len;
  87. target->data = (char *) toku_memdup(val.data, (size_t)val.len);
  88. if (target->data==0) {
  89. return get_error_errno();
  90. }
  91. return 0;
  92. }
  93. static inline void toku_free_TXNID(TXNID txnid __attribute__((__unused__))) {}
  94. static inline void toku_free_TXNID_PAIR(TXNID_PAIR txnid __attribute__((__unused__))) {}
  95. static inline void toku_free_LSN(LSN lsn __attribute__((__unused__))) {}
  96. static inline void toku_free_uint64_t(uint64_t u __attribute__((__unused__))) {}
  97. static inline void toku_free_uint32_t(uint32_t u __attribute__((__unused__))) {}
  98. static inline void toku_free_uint8_t(uint8_t u __attribute__((__unused__))) {}
  99. static inline void toku_free_FILENUM(FILENUM u __attribute__((__unused__))) {}
  100. static inline void toku_free_BLOCKNUM(BLOCKNUM u __attribute__((__unused__))) {}
  101. static inline void toku_free_bool(bool u __attribute__((__unused__))) {}
  102. static inline void toku_free_XIDP(XIDP xidp) { toku_free(xidp); }
  103. static inline void toku_free_BYTESTRING(BYTESTRING val) { toku_free(val.data); }
  104. static inline void toku_free_FILENUMS(FILENUMS val) { toku_free(val.filenums); }
  105. int toku_maybe_upgrade_log (const char *env_dir, const char *log_dir, LSN * lsn_of_clean_shutdown, bool * upgrade_in_progress);
  106. uint64_t toku_log_upgrade_get_footprint(void);
  107. #endif