Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
dcdb
dcdb
Commits
99bc166a
Commit
99bc166a
authored
Aug 08, 2019
by
Alessio Netti
Browse files
Switching to TimeWindow Cassandra compaction strategy
parent
f2e6a8bb
Changes
2
Hide whitespace changes
Inline
Side-by-side
lib/include_internal/dcdbglobals.h
View file @
99bc166a
...
...
@@ -42,6 +42,7 @@
#define KEYSPACE_NAME "dcdb"
#define CF_SENSORDATA "sensordata"
#define SENSORDATA_GC_GRACE_SECONDS "600"
#define SENSORDATA_COMPACTION "{'class' : 'TimeWindowCompactionStrategy', 'compaction_window_unit' : 'DAYS', 'compaction_window_size' : 1 }"
#define CONFIG_KEYSPACE_NAME KEYSPACE_NAME "_config"
#define CF_PUBLISHEDSENSORS "publishedsensors"
...
...
lib/src/connection.cpp
View file @
99bc166a
...
...
@@ -488,7 +488,8 @@ bool ConnectionImpl::initSchema() {
createColumnFamily
(
CF_SENSORDATA
,
"sid varchar, ws smallint, ts bigint, value bigint"
,
"sid, ws, ts"
,
"COMPACT STORAGE AND gc_grace_seconds = "
SENSORDATA_GC_GRACE_SECONDS
);
"COMPACT STORAGE AND gc_grace_seconds = "
SENSORDATA_GC_GRACE_SECONDS
" AND compaction = "
SENSORDATA_COMPACTION
);
}
if
(
!
existsColumnFamily
(
CF_VIRTUALSENSORS
))
{
...
...
@@ -496,7 +497,8 @@ bool ConnectionImpl::initSchema() {
createColumnFamily
(
CF_VIRTUALSENSORS
,
"sid varchar, ws smallint, ts bigint, value bigint"
,
"sid, ws, ts"
,
"COMPACT STORAGE AND gc_grace_seconds = "
SENSORDATA_GC_GRACE_SECONDS
);
"COMPACT STORAGE AND gc_grace_seconds = "
SENSORDATA_GC_GRACE_SECONDS
" AND compaction = "
SENSORDATA_COMPACTION
);
}
/* Keyspace and column family for job data */
...
...
Write
Preview
Supports
Markdown
0%
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!
Cancel
Please
register
or
sign in
to comment