Exemplo n.º 1
0
/*
 * __txn_oplist_printlog --
 *	Print a list of operations from a log record.
 */
static int
__txn_oplist_printlog(WT_SESSION_IMPL *session,
    const uint8_t **pp, const uint8_t *end, uint32_t flags)
{
	bool firstrecord;

	firstrecord = true;
	WT_RET(__wt_fprintf(session, WT_STDOUT(session), "    \"ops\": [\n"));

	/* The logging subsystem zero-pads records. */
	while (*pp < end && **pp) {
		if (!firstrecord)
			WT_RET(__wt_fprintf(
			    session, WT_STDOUT(session), ",\n"));
		WT_RET(__wt_fprintf(session, WT_STDOUT(session), "      {"));

		firstrecord = false;

		WT_RET(__wt_txn_op_printlog(session, pp, end, flags));
		WT_RET(__wt_fprintf(session, WT_STDOUT(session), "\n      }"));
	}

	WT_RET(__wt_fprintf(session, WT_STDOUT(session), "\n    ]\n"));

	return (0);
}
Exemplo n.º 2
0
/*
 * __txn_commit_printlog --
 *	Print a commit log record.
 */
static int
__txn_commit_printlog(
    WT_SESSION_IMPL *session, const uint8_t **pp, const uint8_t *end, FILE *out)
{
	int firstrecord;

	firstrecord = 1;
	WT_RET(__wt_fprintf(out, "    \"ops\": [\n"));

	/* The logging subsystem zero-pads records. */
	while (*pp < end && **pp) {
		if (!firstrecord)
			WT_RET(__wt_fprintf(out, ",\n"));
		WT_RET(__wt_fprintf(out, "      {"));

		firstrecord = 0;

		WT_RET(__wt_txn_op_printlog(session, pp, end, out));
		WT_RET(__wt_fprintf(out, "\n      }"));
	}

	WT_RET(__wt_fprintf(out, "\n    ]\n"));

	return (0);
}
Exemplo n.º 3
0
/*
 * __txn_commit_printlog --
 *	Print a commit log record.
 */
static int
__txn_commit_printlog(
    WT_SESSION_IMPL *session, const uint8_t **pp, const uint8_t *end, FILE *out)
{
	/* The logging subsystem zero-pads records. */
	while (*pp < end && **pp)
		WT_RET(__wt_txn_op_printlog(session, pp, end, out));
	return (0);
}