Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
eos
QuarkDB
Commits
33a78d13
Commit
33a78d13
authored
Jun 11, 2018
by
Georgios Bitzes
Browse files
Add command to show per-compaction-level size and number of SST files
parent
1f9500d6
Pipeline
#411253
passed with stages
in 29 minutes and 49 seconds
Changes
6
Pipelines
4
Hide whitespace changes
Inline
Side-by-side
src/Commands.cc
View file @
33a78d13
...
...
@@ -121,6 +121,7 @@ struct cmdMapInit {
redis_cmd_map
[
"quarkdb_bulkload_finalize"
]
=
{
RedisCommand
::
QUARKDB_BULKLOAD_FINALIZE
,
CommandType
::
QUARKDB
};
redis_cmd_map
[
"quarkdb_invalid_command"
]
=
{
RedisCommand
::
QUARKDB_INVALID_COMMAND
,
CommandType
::
QUARKDB
};
redis_cmd_map
[
"quarkdb_manual_compaction"
]
=
{
RedisCommand
::
QUARKDB_MANUAL_COMPACTION
,
CommandType
::
QUARKDB
};
redis_cmd_map
[
"quarkdb_level_stats"
]
=
{
RedisCommand
::
QUARKDB_LEVEL_STATS
,
CommandType
::
QUARKDB
};
redis_cmd_map
[
"recovery_info"
]
=
{
RedisCommand
::
RECOVERY_INFO
,
CommandType
::
QUARKDB
};
}
...
...
src/Commands.hh
View file @
33a78d13
...
...
@@ -128,6 +128,7 @@ enum class RedisCommand {
QUARKDB_BULKLOAD_FINALIZE
,
QUARKDB_INVALID_COMMAND
,
// used in tests
QUARKDB_MANUAL_COMPACTION
,
QUARKDB_LEVEL_STATS
,
RECOVERY_INFO
};
...
...
src/Shard.cc
View file @
33a78d13
...
...
@@ -185,6 +185,15 @@ LinkStatus Shard::dispatch(Connection *conn, RedisRequest &req) {
return
conn
->
fromStatus
(
stateMachine
->
manualCompaction
());
}
case
RedisCommand
::
QUARKDB_LEVEL_STATS
:
{
if
(
req
.
size
()
!=
1
)
return
conn
->
errArgs
(
req
[
0
]);
InFlightRegistration
registration
(
inFlightTracker
);
if
(
!
registration
.
ok
())
{
return
conn
->
err
(
"unavailable"
);
}
return
conn
->
status
(
stateMachine
->
levelStats
());
}
default:
{
if
(
req
.
getCommandType
()
==
CommandType
::
QUARKDB
)
{
qdb_critical
(
"Unable to dispatch command '"
<<
req
[
0
]
<<
"' of type QUARKDB"
);
...
...
src/StateMachine.cc
View file @
33a78d13
...
...
@@ -1222,6 +1222,12 @@ std::string StateMachine::statistics() {
return
stats
;
}
std
::
string
StateMachine
::
levelStats
()
{
std
::
string
stats
;
db
->
GetProperty
(
rocksdb
::
DB
::
Properties
::
kLevelStats
,
&
stats
);
return
stats
;
}
rocksdb
::
Status
StateMachine
::
noop
(
LogIndex
index
)
{
StagingArea
stagingArea
(
*
this
);
return
stagingArea
.
commit
(
index
);
...
...
src/StateMachine.hh
View file @
33a78d13
...
...
@@ -168,6 +168,11 @@ public:
//----------------------------------------------------------------------------
std
::
string
statistics
();
//----------------------------------------------------------------------------
// Get level stats
//----------------------------------------------------------------------------
std
::
string
levelStats
();
bool
inBulkLoad
()
const
{
return
bulkLoad
;
}
...
...
test/e2e.cc
View file @
33a78d13
...
...
@@ -936,6 +936,7 @@ TEST_F(Raft_e2e, smove) {
ASSERT_REPLY
(
tunnel
(
leaderID
)
->
exec
(
"smembers"
,
"set1"
),
make_vec
(
"i2"
,
"i3"
,
"i4"
,
"i5"
));
ASSERT_REPLY
(
tunnel
(
leaderID
)
->
exec
(
"smembers"
,
"set2"
),
make_vec
(
"i1"
,
"t1"
,
"t2"
,
"t3"
,
"t4"
,
"t5"
));
ASSERT_REPLY
(
tunnel
(
leaderID
)
->
exec
(
"quarkdb-manual-compaction"
),
"OK"
);
qdb_info
(
qclient
::
describeRedisReply
(
tunnel
(
leaderID
)
->
exec
(
"quarkdb-level-stats"
).
get
()));
}
TEST_F
(
Raft_e2e
,
sscan
)
{
...
...
Write
Preview
Supports
Markdown
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