Esempio n. 1
0
int
__wt_logop_row_truncate_print(
    WT_SESSION_IMPL *session, const uint8_t **pp, const uint8_t *end, FILE *out)
{
	WT_DECL_RET;
	uint32_t fileid;
	WT_ITEM start;
	WT_ITEM stop;
	uint32_t mode;
	char *escaped;

	escaped = NULL;
	WT_RET(__wt_logop_row_truncate_unpack(
	    session, pp, end, &fileid, &start, &stop, &mode));

	WT_RET(__wt_fprintf(out, " \"optype\": \"row_truncate\",\n"));
	WT_ERR(__wt_fprintf(out,
	    "        \"fileid\": \"%" PRIu32 "\",\n", fileid));
	WT_ERR(__logrec_jsonify_str(session, &escaped, &start));
	WT_ERR(__wt_fprintf(out,
	    "        \"start\": \"%s\",\n", escaped));
	WT_ERR(__logrec_jsonify_str(session, &escaped, &stop));
	WT_ERR(__wt_fprintf(out,
	    "        \"stop\": \"%s\",\n", escaped));
	WT_ERR(__wt_fprintf(out,
	    "        \"mode\": \"%" PRIu32 "\"", mode));

err:	__wt_free(session, escaped);
	return (ret);
}
Esempio n. 2
0
int
__wt_logop_row_put_print(
    WT_SESSION_IMPL *session, const uint8_t **pp, const uint8_t *end, FILE *out)
{
	WT_DECL_RET;
	uint32_t fileid;
	WT_ITEM key;
	WT_ITEM value;
	char *escaped;

	escaped = NULL;
	WT_RET(__wt_logop_row_put_unpack(
	    session, pp, end, &fileid, &key, &value));

	WT_RET(__wt_fprintf(out, " \"optype\": \"row_put\",\n"));
	WT_ERR(__wt_fprintf(out,
	    "        \"fileid\": \"%" PRIu32 "\",\n", fileid));
	WT_ERR(__logrec_jsonify_str(session, &escaped, &key));
	WT_ERR(__wt_fprintf(out,
	    "        \"key\": \"%s\",\n", escaped));
	WT_ERR(__logrec_jsonify_str(session, &escaped, &value));
	WT_ERR(__wt_fprintf(out,
	    "        \"value\": \"%s\"", escaped));

err:	__wt_free(session, escaped);
	return (ret);
}
Esempio n. 3
0
File: log_auto.c Progetto: 3rf/mongo
int
__wt_logop_row_remove_print(
    WT_SESSION_IMPL *session, const uint8_t **pp, const uint8_t *end, FILE *out)
{
	uint32_t fileid;
	WT_ITEM key;
	char *escaped;

	escaped = NULL;
	WT_RET(__wt_logop_row_remove_unpack(
	    session, pp, end, &fileid, &key));

	fprintf(out, "    \"optype\": \"row_remove\",\n");
	fprintf(out, "    \"fileid\": \"%" PRIu32 "\",\n", fileid);
	WT_RET(__logrec_jsonify_str(session, &escaped, &key));
	fprintf(out, "    \"key\": \"%s\",\n", escaped);
	__wt_free(session, escaped);
	return (0);
}
Esempio n. 4
0
File: log_auto.c Progetto: 3rf/mongo
int
__wt_logop_col_put_print(
    WT_SESSION_IMPL *session, const uint8_t **pp, const uint8_t *end, FILE *out)
{
	uint32_t fileid;
	uint64_t recno;
	WT_ITEM value;
	char *escaped;

	escaped = NULL;
	WT_RET(__wt_logop_col_put_unpack(
	    session, pp, end, &fileid, &recno, &value));

	fprintf(out, "    \"optype\": \"col_put\",\n");
	fprintf(out, "    \"fileid\": \"%" PRIu32 "\",\n", fileid);
	fprintf(out, "    \"recno\": \"%" PRIu64 "\",\n", recno);
	WT_RET(__logrec_jsonify_str(session, &escaped, &value));
	fprintf(out, "    \"value\": \"%s\",\n", escaped);
	__wt_free(session, escaped);
	return (0);
}