You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardexpand all lines: idx/cassandra/cassandra.go
+21-16
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,8 @@
1
1
package cassandra
2
2
3
3
import (
4
+
"os"
5
+
"io/ioutil"
4
6
"flag"
5
7
"fmt"
6
8
"strings"
@@ -18,22 +20,6 @@ import (
18
20
"gopkg.in/raintank/schema.v1"
19
21
)
20
22
21
-
constKeyspaceSchema=`CREATE KEYSPACE IF NOT EXISTS %s WITH replication = {'class': 'SimpleStrategy', 'replication_factor': 1} AND durable_writes = true`
22
-
constTableSchema=`CREATE TABLE IF NOT EXISTS %s.metric_idx (
23
-
id text,
24
-
orgid int,
25
-
partition int,
26
-
name text,
27
-
metric text,
28
-
interval int,
29
-
unit text,
30
-
mtype text,
31
-
tags set<text>,
32
-
lastupdate int,
33
-
PRIMARY KEY (partition, id)
34
-
) WITH compaction = {'class': 'SizeTieredCompactionStrategy'}
35
-
AND compression = {'sstable_compression': 'org.apache.cassandra.io.compress.LZ4Compressor'}`
36
-
37
23
var (
38
24
// metric idx.cassadra.query-insert.ok is how many insert queries for a metric completed successfully (triggered by an add or an update)
Copy file name to clipboardexpand all lines: metrictank.go
+4-1
Original file line number
Diff line number
Diff line change
@@ -88,6 +88,9 @@ var (
88
88
cassandraUsername=flag.String("cassandra-username", "cassandra", "username for authentication")
89
89
cassandraPassword=flag.String("cassandra-password", "cassandra", "password for authentication")
90
90
91
+
cassandraKeyspaceSchemaTemplate=flag.String("storage-keyspace-schema-template", "/etc/metrictank/storage-keyspace-schema-cassandra.template", "Cassandra CQL template for keyspace creation")
92
+
cassandraKeytableSchemaTemplate=flag.String("storage-keytable-schema-template", "/etc/metrictank/storage-keytable-schema-cassandra.template", "Cassandra CQL template for keytable creation")
93
+
91
94
// Profiling, instrumentation and logging:
92
95
blockProfileRate=flag.Int("block-profile-rate", 0, "see https://golang.org/pkg/runtime/#SetBlockProfileRate")
93
96
memProfileRate=flag.Int("mem-profile-rate", 512*1024, "0 to disable. 1 for max precision (expensive!) see https://golang.org/pkg/runtime/#pkg-variables")
Copy file name to clipboardexpand all lines: store/cassandra/store_cassandra.go
+17-11
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,8 @@
1
1
package cassandra
2
2
3
3
import (
4
+
"os"
5
+
"io/ioutil"
4
6
"bytes"
5
7
"context"
6
8
"encoding/binary"
@@ -29,16 +31,6 @@ import (
29
31
30
32
constMonth_sec=60*60*24*28
31
33
32
-
constkeyspace_schema=`CREATE KEYSPACE IF NOT EXISTS %s WITH replication = {'class': 'SimpleStrategy', 'replication_factor': 1} AND durable_writes = true`
33
-
consttable_schema=`CREATE TABLE IF NOT EXISTS %s.%s (
0 commit comments