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
018a0bb1
Unverified
Commit
018a0bb1
authored
Dec 11, 2020
by
qupeng
Committed by
GitHub
Dec 11, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add `seqno` into iterator (#198)
parent
ab0a8b90
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
14 additions
and
6 deletions
+14
-6
.gitignore
.gitignore
+3
-0
compaction_filter.h
src/compaction_filter.h
+7
-6
db_iter.h
src/db_iter.h
+4
-0
No files found.
.gitignore
View file @
018a0bb1
...
@@ -6,6 +6,9 @@ titandb_bench
...
@@ -6,6 +6,9 @@ titandb_bench
titandb_stress
titandb_stress
build/
build/
rocksdb
Makefile
*.cmake
.idea/
.idea/
.vscode/
.vscode/
cmake-build-debug/
cmake-build-debug/
src/compaction_filter.h
View file @
018a0bb1
...
@@ -31,15 +31,16 @@ class TitanCompactionFilter final : public CompactionFilter {
...
@@ -31,15 +31,16 @@ class TitanCompactionFilter final : public CompactionFilter {
const
char
*
Name
()
const
override
{
return
filter_name_
.
c_str
();
}
const
char
*
Name
()
const
override
{
return
filter_name_
.
c_str
();
}
Decision
FilterV2
(
int
level
,
const
Slice
&
key
,
ValueType
value_type
,
Decision
FilterV3
(
int
level
,
const
Slice
&
key
,
SequenceNumber
seqno
,
const
Slice
&
value
,
std
::
string
*
new_value
,
ValueType
value_type
,
const
Slice
&
value
,
std
::
string
*
new_value
,
std
::
string
*
skip_until
)
const
override
{
std
::
string
*
skip_until
)
const
override
{
if
(
skip_value_
)
{
if
(
skip_value_
)
{
return
original_filter_
->
FilterV
2
(
level
,
key
,
value_type
,
Slice
(),
return
original_filter_
->
FilterV
3
(
level
,
key
,
seqno
,
value_type
,
Slice
(),
new_value
,
skip_until
);
new_value
,
skip_until
);
}
}
if
(
value_type
!=
kBlobIndex
)
{
if
(
value_type
!=
kBlobIndex
)
{
return
original_filter_
->
FilterV
2
(
level
,
key
,
value_type
,
value
,
return
original_filter_
->
FilterV
3
(
level
,
key
,
seqno
,
value_type
,
value
,
new_value
,
skip_until
);
new_value
,
skip_until
);
}
}
...
@@ -73,8 +74,8 @@ class TitanCompactionFilter final : public CompactionFilter {
...
@@ -73,8 +74,8 @@ class TitanCompactionFilter final : public CompactionFilter {
// TODO(yiwu): Tell the two cases apart.
// TODO(yiwu): Tell the two cases apart.
return
Decision
::
kKeep
;
return
Decision
::
kKeep
;
}
else
if
(
s
.
ok
())
{
}
else
if
(
s
.
ok
())
{
auto
decision
=
original_filter_
->
FilterV
2
(
auto
decision
=
original_filter_
->
FilterV
3
(
level
,
key
,
kValue
,
record
.
value
,
new_value
,
skip_until
);
level
,
key
,
seqno
,
kValue
,
record
.
value
,
new_value
,
skip_until
);
// It would be a problem if it change the value whereas the value_type
// It would be a problem if it change the value whereas the value_type
// is still kBlobIndex. For now, just returns kKeep.
// is still kBlobIndex. For now, just returns kKeep.
...
...
src/db_iter.h
View file @
018a0bb1
...
@@ -116,6 +116,10 @@ class TitanDBIterator : public Iterator {
...
@@ -116,6 +116,10 @@ class TitanDBIterator : public Iterator {
return
record_
.
value
;
return
record_
.
value
;
}
}
bool
seqno
(
SequenceNumber
*
number
)
const
override
{
return
iter_
->
seqno
(
number
);
}
private
:
private
:
bool
ShouldGetBlobValue
()
{
bool
ShouldGetBlobValue
()
{
if
(
!
iter_
->
Valid
()
||
!
iter_
->
IsBlob
()
||
options_
.
key_only
)
{
if
(
!
iter_
->
Valid
()
||
!
iter_
->
IsBlob
()
||
options_
.
key_only
)
{
...
...
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