Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
T
titan
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
fangzongwu
titan
Commits
44668f8c
Commit
44668f8c
authored
Oct 31, 2019
by
Connor
Committed by
pingcap-github-bot
Oct 31, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add log for blob file range (#101)
parent
73221d42
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
18 additions
and
9 deletions
+18
-9
blob_gc_job.cc
src/blob_gc_job.cc
+4
-2
blob_storage.cc
src/blob_storage.cc
+10
-5
db_impl.cc
src/db_impl.cc
+4
-2
No files found.
src/blob_gc_job.cc
View file @
44668f8c
...
@@ -585,8 +585,10 @@ Status BlobGCJob::DeleteInputBlobFiles() {
...
@@ -585,8 +585,10 @@ Status BlobGCJob::DeleteInputBlobFiles() {
edit
.
SetColumnFamilyID
(
blob_gc_
->
column_family_handle
()
->
GetID
());
edit
.
SetColumnFamilyID
(
blob_gc_
->
column_family_handle
()
->
GetID
());
for
(
const
auto
&
file
:
blob_gc_
->
sampled_inputs
())
{
for
(
const
auto
&
file
:
blob_gc_
->
sampled_inputs
())
{
ROCKS_LOG_INFO
(
db_options_
.
info_log
,
ROCKS_LOG_INFO
(
db_options_
.
info_log
,
"Titan add obsolete file [%"
PRIu64
"]"
,
"Titan add obsolete file [%"
PRIu64
"] range [%s, %s]"
,
file
->
file_number
());
file
->
file_number
(),
file
->
smallest_key
().
ToString
(
true
).
c_str
(),
file
->
largest_key
().
ToString
(
true
).
c_str
());
metrics_
.
gc_num_files
++
;
metrics_
.
gc_num_files
++
;
RecordInHistogram
(
stats_
,
TitanStats
::
GC_INPUT_FILE_SIZE
,
RecordInHistogram
(
stats_
,
TitanStats
::
GC_INPUT_FILE_SIZE
,
file
->
file_size
());
file
->
file_size
());
...
...
src/blob_storage.cc
View file @
44668f8c
...
@@ -33,6 +33,7 @@ Status BlobStorage::GetBlobFilesInRanges(const RangePtr* ranges, size_t n,
...
@@ -33,6 +33,7 @@ Status BlobStorage::GetBlobFilesInRanges(const RangePtr* ranges, size_t n,
const
Slice
*
end
=
ranges
[
i
].
limit
;
const
Slice
*
end
=
ranges
[
i
].
limit
;
auto
cmp
=
cf_options_
.
comparator
;
auto
cmp
=
cf_options_
.
comparator
;
std
::
string
tmp
;
// nullptr means the minimum or maximum.
// nullptr means the minimum or maximum.
for
(
auto
it
=
((
begin
!=
nullptr
)
?
blob_ranges_
.
lower_bound
(
*
begin
)
for
(
auto
it
=
((
begin
!=
nullptr
)
?
blob_ranges_
.
lower_bound
(
*
begin
)
:
blob_ranges_
.
begin
());
:
blob_ranges_
.
begin
());
...
@@ -49,15 +50,19 @@ Status BlobStorage::GetBlobFilesInRanges(const RangePtr* ranges, size_t n,
...
@@ -49,15 +50,19 @@ Status BlobStorage::GetBlobFilesInRanges(const RangePtr* ranges, size_t n,
(
include_end
&&
cmp
->
Compare
(
it
->
second
->
largest_key
(),
*
end
)
<=
0
)
||
(
include_end
&&
cmp
->
Compare
(
it
->
second
->
largest_key
(),
*
end
)
<=
0
)
||
(
!
include_end
&&
cmp
->
Compare
(
it
->
second
->
largest_key
(),
*
end
)
<
0
))
{
(
!
include_end
&&
cmp
->
Compare
(
it
->
second
->
largest_key
(),
*
end
)
<
0
))
{
files
->
push_back
(
it
->
second
->
file_number
());
files
->
push_back
(
it
->
second
->
file_number
());
if
(
!
tmp
.
empty
())
{
tmp
.
append
(
" "
);
}
tmp
.
append
(
std
::
to_string
(
it
->
second
->
file_number
()));
}
}
assert
(
it
->
second
->
smallest_key
().
empty
()
||
assert
(
it
->
second
->
smallest_key
().
empty
()
||
(
!
begin
||
cmp
->
Compare
(
it
->
second
->
smallest_key
(),
*
begin
)
>=
0
));
(
!
begin
||
cmp
->
Compare
(
it
->
second
->
smallest_key
(),
*
begin
)
>=
0
));
}
}
ROCKS_LOG_INFO
(
db_options_
.
info_log
,
ROCKS_LOG_INFO
(
"Get %"
PRIuPTR
" blob files in the range [%s, %s%c"
,
db_options_
.
info_log
,
files
->
size
(),
begin
?
begin
->
ToString
(
true
).
c_str
()
:
"
"
,
"Get %"
PRIuPTR
" blob files [%s] in the range [%s, %s%c
"
,
end
?
end
->
ToString
(
true
).
c_str
()
:
" "
,
files
->
size
(),
tmp
.
c_str
(),
begin
?
begin
->
ToString
(
true
).
c_str
()
:
" "
,
include_end
?
']'
:
')'
);
end
?
end
->
ToString
(
true
).
c_str
()
:
" "
,
include_end
?
']'
:
')'
);
}
}
return
Status
::
OK
();
return
Status
::
OK
();
}
}
...
...
src/db_impl.cc
View file @
44668f8c
...
@@ -68,8 +68,10 @@ class TitanDBImpl::FileManager : public BlobFileManager {
...
@@ -68,8 +68,10 @@ class TitanDBImpl::FileManager : public BlobFileManager {
if
(
!
s
.
ok
())
return
s
;
if
(
!
s
.
ok
())
return
s
;
ROCKS_LOG_INFO
(
db_
->
db_options_
.
info_log
,
ROCKS_LOG_INFO
(
db_
->
db_options_
.
info_log
,
"Titan adding blob file [%"
PRIu64
"]"
,
"Titan adding blob file [%"
PRIu64
"] range [%s, %s]"
,
file
.
first
->
file_number
());
file
.
first
->
file_number
(),
file
.
first
->
smallest_key
().
ToString
(
true
).
c_str
(),
file
.
first
->
largest_key
().
ToString
(
true
).
c_str
());
edit
.
AddBlobFile
(
file
.
first
);
edit
.
AddBlobFile
(
file
.
first
);
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment