Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
T
tarantool
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
core
tarantool
Commits
0809445a
Commit
0809445a
authored
10 years ago
by
Roman Tsisyk
Browse files
Options
Downloads
Patches
Plain Diff
Rename SysviewIndex::predicate() to SysviewIndex::filter()
Code review fixes for sysview branch.
parent
390e80fa
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/box/sysview_index.cc
+13
-13
13 additions, 13 deletions
src/box/sysview_index.cc
src/box/sysview_index.h
+3
-3
3 additions, 3 deletions
src/box/sysview_index.h
with
16 additions
and
16 deletions
src/box/sysview_index.cc
+
13
−
13
View file @
0809445a
...
...
@@ -64,16 +64,16 @@ sysview_iterator_next(struct iterator *iterator)
class
SysviewIndex
*
index
=
(
class
SysviewIndex
*
)
iterator
->
index
;
struct
tuple
*
tuple
;
while
((
tuple
=
it
->
source
->
next
(
it
->
source
))
!=
NULL
)
{
if
(
index
->
predica
te
(
it
->
space
,
tuple
))
if
(
index
->
fil
te
r
(
it
->
space
,
tuple
))
return
tuple
;
}
return
NULL
;
}
SysviewIndex
::
SysviewIndex
(
struct
key_def
*
key_def
,
uint32_t
source_space_id
,
uint32_t
source_index_id
,
sysview_
predica
te_f
predica
te
)
uint32_t
source_index_id
,
sysview_
fil
te
r
_f
fil
te
r
)
:
Index
(
key_def
),
source_space_id
(
source_space_id
),
source_index_id
(
source_index_id
),
predicate
(
predica
te
)
source_index_id
(
source_index_id
),
filter
(
fil
te
r
)
{
}
...
...
@@ -134,7 +134,7 @@ SysviewIndex::findByKey(const char *key, uint32_t part_count) const
tnt_raise
(
ClientError
,
ER_MORE_THAN_ONE_TUPLE
);
primary_key_validate
(
pk
->
key_def
,
key
,
part_count
);
struct
tuple
*
tuple
=
pk
->
findByKey
(
key
,
part_count
);
if
(
tuple
==
NULL
||
!
predica
te
(
source
,
tuple
))
if
(
tuple
==
NULL
||
!
fil
te
r
(
source
,
tuple
))
return
NULL
;
return
tuple
;
}
...
...
@@ -150,7 +150,7 @@ SysviewIndex::replace(struct tuple *old_tuple, struct tuple *new_tuple,
}
static
bool
vspace_
predica
te
(
struct
space
*
source
,
struct
tuple
*
tuple
)
vspace_
fil
te
r
(
struct
space
*
source
,
struct
tuple
*
tuple
)
{
struct
credentials
*
cr
=
current_user
();
if
(
PRIV_R
&
cr
->
universal_access
)
...
...
@@ -166,17 +166,17 @@ vspace_predicate(struct space *source, struct tuple *tuple)
}
SysviewVspaceIndex
::
SysviewVspaceIndex
(
struct
key_def
*
key_def
)
:
SysviewIndex
(
key_def
,
SC_SPACE_ID
,
key_def
->
iid
,
vspace_
predica
te
)
:
SysviewIndex
(
key_def
,
SC_SPACE_ID
,
key_def
->
iid
,
vspace_
fil
te
r
)
{
}
SysviewVindexIndex
::
SysviewVindexIndex
(
struct
key_def
*
key_def
)
:
SysviewIndex
(
key_def
,
SC_INDEX_ID
,
key_def
->
iid
,
vspace_
predica
te
)
:
SysviewIndex
(
key_def
,
SC_INDEX_ID
,
key_def
->
iid
,
vspace_
fil
te
r
)
{
}
static
bool
vuser_
predica
te
(
struct
space
*
source
,
struct
tuple
*
tuple
)
vuser_
fil
te
r
(
struct
space
*
source
,
struct
tuple
*
tuple
)
{
struct
credentials
*
cr
=
current_user
();
if
(
PRIV_R
&
cr
->
universal_access
)
...
...
@@ -190,12 +190,12 @@ vuser_predicate(struct space *source, struct tuple *tuple)
}
SysviewVuserIndex
::
SysviewVuserIndex
(
struct
key_def
*
key_def
)
:
SysviewIndex
(
key_def
,
SC_USER_ID
,
key_def
->
iid
,
vuser_
predica
te
)
:
SysviewIndex
(
key_def
,
SC_USER_ID
,
key_def
->
iid
,
vuser_
fil
te
r
)
{
}
static
bool
vpriv_
predica
te
(
struct
space
*
source
,
struct
tuple
*
tuple
)
vpriv_
fil
te
r
(
struct
space
*
source
,
struct
tuple
*
tuple
)
{
struct
credentials
*
cr
=
current_user
();
if
(
PRIV_R
&
cr
->
universal_access
)
...
...
@@ -209,12 +209,12 @@ vpriv_predicate(struct space *source, struct tuple *tuple)
}
SysviewVprivIndex
::
SysviewVprivIndex
(
struct
key_def
*
key_def
)
:
SysviewIndex
(
key_def
,
SC_PRIV_ID
,
key_def
->
iid
,
vpriv_
predica
te
)
:
SysviewIndex
(
key_def
,
SC_PRIV_ID
,
key_def
->
iid
,
vpriv_
fil
te
r
)
{
}
static
bool
vfunc_
predica
te
(
struct
space
*
source
,
struct
tuple
*
tuple
)
vfunc_
fil
te
r
(
struct
space
*
source
,
struct
tuple
*
tuple
)
{
struct
credentials
*
cr
=
current_user
();
if
((
PRIV_R
|
PRIV_X
)
&
cr
->
universal_access
)
...
...
@@ -233,6 +233,6 @@ vfunc_predicate(struct space *source, struct tuple *tuple)
}
SysviewVfuncIndex
::
SysviewVfuncIndex
(
struct
key_def
*
key_def
)
:
SysviewIndex
(
key_def
,
SC_FUNC_ID
,
key_def
->
iid
,
vfunc_
predica
te
)
:
SysviewIndex
(
key_def
,
SC_FUNC_ID
,
key_def
->
iid
,
vfunc_
fil
te
r
)
{
}
This diff is collapsed.
Click to expand it.
src/box/sysview_index.h
+
3
−
3
View file @
0809445a
...
...
@@ -33,12 +33,12 @@
struct
sysview_iterator
;
typedef
bool
(
*
sysview_
predica
te_f
)(
struct
space
*
source
,
struct
tuple
*
);
typedef
bool
(
*
sysview_
fil
te
r
_f
)(
struct
space
*
source
,
struct
tuple
*
);
class
SysviewIndex
:
public
Index
{
public:
SysviewIndex
(
struct
key_def
*
key_def
,
uint32_t
source_space_id
,
uint32_t
source_index_id
,
sysview_
predica
te_f
predica
te
);
uint32_t
source_index_id
,
sysview_
fil
te
r
_f
fil
te
r
);
virtual
~
SysviewIndex
();
virtual
struct
tuple
*
findByKey
(
const
char
*
key
,
uint32_t
part_count
)
const
;
virtual
struct
tuple
*
replace
(
struct
tuple
*
old_tuple
,
...
...
@@ -52,7 +52,7 @@ class SysviewIndex: public Index {
uint32_t
source_space_id
;
uint32_t
source_index_id
;
sysview_
predica
te_f
predica
te
;
sysview_
fil
te
r
_f
fil
te
r
;
};
class
SysviewVspaceIndex
:
public
SysviewIndex
{
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment