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
{{ message }}
This repository was archived by the owner on Aug 23, 2023. It is now read-only.
cassandraUsername=flag.String("cassandra-username", "cassandra", "username for authentication")
39
-
cassandraPassword=flag.String("cassandra-password", "cassandra", "password for authentication")
40
-
41
-
cassandraDisableInitialHostLookup=flag.Bool("cassandra-disable-initial-host-lookup", false, "instruct the driver to not attempt to get host info from the system.peers table")
42
-
43
-
startTs=flag.Int("start-timestamp", 0, "timestamp at which to start, defaults to 0")
44
-
endTs=flag.Int("end-timestamp", math.MaxInt32, "timestamp at which to stop, defaults to int max")
45
-
numThreads=flag.Int("threads", 10, "number of workers to use to process data")
46
-
47
-
verbose=flag.Bool("verbose", false, "show every record being processed")
48
-
49
-
doneKeysuint64
50
-
doneRowsuint64
22
+
doneKeysuint64
23
+
doneRowsuint64
24
+
startTsint
25
+
endTsint
26
+
numThreadsint
27
+
statusEveryint
28
+
verbosebool
51
29
)
52
30
53
31
funcinit() {
@@ -58,89 +36,71 @@ func init() {
58
36
}
59
37
60
38
funcmain() {
39
+
cfg:=cassandra.CliConfig
40
+
flag.StringVar(&cfg.Addrs, "cassandra-addrs", cfg.Addrs, "cassandra host (may be given multiple times as comma-separated list)")
41
+
flag.StringVar(&cfg.Keyspace, "cassandra-keyspace", cfg.Keyspace, "cassandra keyspace to use for storing the metric data table")
flag.IntVar(&cfg.WriteConcurrency, "cassandra-concurrency", 20, "number of concurrent connections to cassandra.") // this will launch idle write goroutines which we don't need but we can clean this up later.
46
+
flag.IntVar(&cfg.Retries, "cassandra-retries", cfg.Retries, "how many times to retry a query before failing it")
47
+
flag.IntVar(&cfg.WindowFactor, "window-factor", cfg.WindowFactor, "size of compaction window relative to TTL")
48
+
flag.IntVar(&cfg.CqlProtocolVersion, "cql-protocol-version", cfg.CqlProtocolVersion, "cql protocol version to use")
49
+
flag.BoolVar(&cfg.CreateKeyspace, "create-keyspace", cfg.CreateKeyspace, "enable the creation of the keyspace and tables")
50
+
flag.BoolVar(&cfg.SSL, "cassandra-ssl", cfg.SSL, "enable SSL connection to cassandra")
51
+
flag.StringVar(&cfg.CaPath, "cassandra-ca-path", cfg.CaPath, "cassandra CA certificate path when using SSL")
52
+
flag.BoolVar(&cfg.HostVerification, "cassandra-host-verification", cfg.HostVerification, "host (hostname and server cert) verification when using SSL")
flag.StringVar(&cfg.Username, "cassandra-username", cfg.Username, "username for authentication")
55
+
flag.StringVar(&cfg.Password, "cassandra-password", cfg.Password, "password for authentication")
56
+
flag.StringVar(&cfg.SchemaFile, "schema-file", cfg.SchemaFile, "File containing the needed schemas in case database needs initializing")
57
+
flag.BoolVar(&cfg.DisableInitialHostLookup, "cassandra-disable-initial-host-lookup", cfg.DisableInitialHostLookup, "instruct the driver to not attempt to get host info from the system.peers table")
58
+
59
+
cfg.ReadConcurrency=0
60
+
cfg.ReadQueueSize=0
61
+
cfg.WriteQueueSize=0
62
+
63
+
flag.IntVar(&startTs, "start-timestamp", 0, "timestamp at which to start, defaults to 0")
64
+
flag.IntVar(&endTs, "end-timestamp", math.MaxInt32, "timestamp at which to stop, defaults to int max")
65
+
flag.IntVar(&numThreads, "threads", 10, "number of workers to use to process data")
66
+
flag.IntVar(&statusEvery, "status-every", 100000, "print status every x keys")
67
+
68
+
flag.BoolVar(&verbose, "verbose", false, "show every record being processed")
fmt.Fprintln(os.Stderr, "Adjusts the data in Cassandra to use a new TTL value. The TTL is applied counting from the timestamp of the data")
65
-
fmt.Fprintln(os.Stderr, "If table-out not specified or same as table-in, will update in place. Otherwise will not touch input table and store results in table-out")
66
-
fmt.Fprintln(os.Stderr, "In that case, it is up to you to assure table-out exists before running this tool")
67
-
fmt.Fprintln(os.Stderr, "Not supported yet: for the per-ttl tables as of 0.7, automatically putting data in the right table")
74
+
fmt.Fprintln(os.Stderr, "Automatically resolves the corresponding tables based on ttl value. If the table stays the same, will update in place. Otherwise will copy to the new table, not touching the input data")
75
+
fmt.Fprintln(os.Stderr, "Unless you disable create-keyspace, tables are created as needed")
68
76
fmt.Println("Flags:")
69
77
flag.PrintDefaults()
70
78
os.Exit(-1)
71
79
}
72
80
flag.Parse()
73
81
74
-
ifflag.NArg() <2||flag.NArg() >3 {
82
+
stats.NewDevnull() // make sure metrics don't pile up without getting discarded
Copy file name to clipboardexpand all lines: docs/tools.md
+14-7
Original file line number
Diff line number
Diff line change
@@ -511,12 +511,11 @@ Flags:
511
511
## mt-update-ttl
512
512
513
513
```
514
-
mt-update-ttl [flags] ttl table-in [table-out]
514
+
mt-update-ttl [flags] ttl-old ttl-new
515
515
516
516
Adjusts the data in Cassandra to use a new TTL value. The TTL is applied counting from the timestamp of the data
517
-
If table-out not specified or same as table-in, will update in place. Otherwise will not touch input table and store results in table-out
518
-
In that case, it is up to you to assure table-out exists before running this tool
519
-
Not supported yet: for the per-ttl tables as of 0.7, automatically putting data in the right table
517
+
Automatically resolves the corresponding tables based on ttl value. If the table stays the same, will update in place. Otherwise will copy to the new table, not touching the input data
518
+
Unless you disable create-keyspace, tables are created as needed
520
519
Flags:
521
520
-cassandra-addrs string
522
521
cassandra host (may be given multiple times as comma-separated list) (default "localhost")
@@ -525,13 +524,11 @@ Flags:
525
524
-cassandra-ca-path string
526
525
cassandra CA certificate path when using SSL (default "/etc/metrictank/ca.pem")
527
526
-cassandra-concurrency int
528
-
max number of concurrent reads to cassandra. (default 20)
527
+
number of concurrent connections to cassandra. (default 20)
0 commit comments