コード例 #1
0
ファイル: tc_wal.c プロジェクト: anatoliy-sokolenko/tarantool
static int tc_wal_printer(struct tnt_iter *i) {
	struct tnt_request *r = TNT_IREQUEST_PTR(i);
	struct tnt_stream_xlog *s =
		TNT_SXLOG_CAST(TNT_IREQUEST_STREAM(i));
	tc_wal_print(&s->hdr, r);
	return 0;
}
コード例 #2
0
ファイル: tnt_xlog.c プロジェクト: tarantool/migrate
static int
tnt_xlog_request(struct tnt_stream *s, struct tnt_request *r)
{
	struct tnt_stream_xlog *sx = TNT_SXLOG_CAST(s);

	struct tnt_log_row *row =
		tnt_log_next_to(&sx->log, (union tnt_log_value*)r);

	if (row == NULL && tnt_log_error(&sx->log) == TNT_LOG_EOK)
		return 1;

	return (row) ? 0: -1;
}
コード例 #3
0
ファイル: tnt_xlog.c プロジェクト: tarantool/migrate
int tnt_xlog_reset(struct tnt_stream *s) {
	struct tnt_stream_xlog *sx = TNT_SXLOG_CAST(s);
	return tnt_log_seek(&(sx->log), sx->log.begin_offset);
}
コード例 #4
0
ファイル: tnt_xlog.c プロジェクト: tarantool/migrate
static void tnt_xlog_free(struct tnt_stream *s) {
	struct tnt_stream_xlog *sx = TNT_SXLOG_CAST(s);
	tnt_log_close(&sx->log);
	tnt_mem_free(s->data);
	s->data = NULL;
}
コード例 #5
0
ファイル: tnt_xlog.c プロジェクト: tarantool/migrate
/*
 * tnt_xlog_errno()
 *
 * get saved errno;
 *
 * s - xlog stream pointer
*/
int tnt_xlog_errno(struct tnt_stream *s) {
	return TNT_SXLOG_CAST(s)->log.errno_;
}
コード例 #6
0
ファイル: tnt_xlog.c プロジェクト: tarantool/migrate
/*
 * tnt_xlog_strerror()
 *
 * get stream error status description string;
 *
 * s - xlog stream pointer
*/
char *tnt_xlog_strerror(struct tnt_stream *s) {
	return tnt_log_strerror(&TNT_SXLOG_CAST(s)->log);
}
コード例 #7
0
ファイル: tnt_xlog.c プロジェクト: tarantool/migrate
/*
 * tnt_xlog_error()
 *
 * get stream error status;
 *
 * s - xlog stream pointer
*/
enum tnt_log_error tnt_xlog_error(struct tnt_stream *s) {
	return TNT_SXLOG_CAST(s)->log.error;
}
コード例 #8
0
ファイル: tnt_xlog.c プロジェクト: tarantool/migrate
/*
 * tnt_xlog_close()
 *
 * close xlog stream; 
 *
 * s - xlog stream pointer
 * 
 * returns 0 on success, or -1 on error.
*/
void tnt_xlog_close(struct tnt_stream *s) {
	struct tnt_stream_xlog *sx = TNT_SXLOG_CAST(s);
	tnt_log_close(&sx->log);
}
コード例 #9
0
ファイル: tnt_xlog.c プロジェクト: tarantool/migrate
/*
 * tnt_xlog_open()
 *
 * open xlog file and associate it with stream;
 *
 * s - xlog stream pointer
 * 
 * returns 0 on success, or -1 on error.
*/
int tnt_xlog_open(struct tnt_stream *s, const char *file) {
	struct tnt_stream_xlog *sx = TNT_SXLOG_CAST(s);
	return tnt_log_open(&sx->log, file, TNT_LOG_XLOG);
}