add function sf_file_writer_get_last_line
parent
e095ce45c2
commit
7ee7e7b535
|
|
@ -627,3 +627,22 @@ int sf_file_writer_get_last_lines(const char *data_path,
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int sf_file_writer_get_last_line(const char *data_path,
|
||||||
|
const char *subdir_name, char *buff,
|
||||||
|
const int buff_size, int *length)
|
||||||
|
{
|
||||||
|
int result;
|
||||||
|
int last_index;
|
||||||
|
int count = 1;
|
||||||
|
|
||||||
|
if ((result=sf_file_writer_get_binlog_last_index(data_path,
|
||||||
|
subdir_name, &last_index)) != 0)
|
||||||
|
{
|
||||||
|
*length = 0;
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
return sf_file_writer_get_last_lines(data_path, subdir_name,
|
||||||
|
last_index, buff, buff_size, &count, length);
|
||||||
|
}
|
||||||
|
|
|
||||||
|
|
@ -251,6 +251,19 @@ int sf_file_writer_get_last_lines(const char *data_path,
|
||||||
const char *subdir_name, const int current_write_index,
|
const char *subdir_name, const int current_write_index,
|
||||||
char *buff, const int buff_size, int *count, int *length);
|
char *buff, const int buff_size, int *count, int *length);
|
||||||
|
|
||||||
|
static inline int sf_file_writer_get_last_line_ex(const char *data_path,
|
||||||
|
const char *subdir_name, const int current_write_index,
|
||||||
|
char *buff, const int buff_size, int *length)
|
||||||
|
{
|
||||||
|
int count = 1;
|
||||||
|
return sf_file_writer_get_last_lines(data_path, subdir_name,
|
||||||
|
current_write_index, buff, buff_size, &count, length);
|
||||||
|
}
|
||||||
|
|
||||||
|
int sf_file_writer_get_last_line(const char *data_path,
|
||||||
|
const char *subdir_name, char *buff,
|
||||||
|
const int buff_size, int *length);
|
||||||
|
|
||||||
int sf_file_writer_write_to_binlog_index_file_ex(const char *data_path,
|
int sf_file_writer_write_to_binlog_index_file_ex(const char *data_path,
|
||||||
const char *subdir_name, const char *file_prefix,
|
const char *subdir_name, const char *file_prefix,
|
||||||
const int start_index, const int last_index,
|
const int start_index, const int last_index,
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue