Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
Synapse Compress State
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
Service Desk
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
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
TeDomum
Synapse Compress State
Commits
3b3ddc0e
Commit
3b3ddc0e
authored
6 years ago
by
Erik Johnston
Browse files
Options
Downloads
Patches
Plain Diff
Fix up arg names and help text
parent
cd63923f
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/main.rs
+18
-8
18 additions, 8 deletions
src/main.rs
with
18 additions
and
8 deletions
src/main.rs
+
18
−
8
View file @
3b3ddc0e
...
...
@@ -126,15 +126,25 @@ fn main() {
.help
(
"File to output the changes to in SQL"
)
.takes_value
(
true
),
)
.arg
(
Arg
::
with_name
(
"
individual_
transactions"
)
Arg
::
with_name
(
"transactions"
)
.short
(
"t"
)
.help
(
"Whether to wrap each state group change in a transaction
, when writing to file
"
)
.help
(
"Whether to wrap each state group change in a transaction"
)
.requires
(
"output_file"
),
)
.arg
(
Arg
::
with_name
(
"level_sizes"
)
.short
(
"l"
)
.value_name
(
"LEVELS"
)
.help
(
"Sizes of each new level in the compression algorithm, as a comma separate list"
)
.help
(
"Sizes of each new level in the compression algorithm, as a comma separated list."
)
.long_help
(
concat!
(
"Sizes of each new level in the compression algorithm, as a comma separated list."
,
" The first entry in the list is for the lowest, most granular level,"
,
" with each subsequent entry being for the next highest level."
,
" The number of entries in the list determines the number of levels"
,
" that will be used."
,
"
\n
The sum of the sizes of the levels effect the performance of fetching the state"
,
" from the database, as the sum of the sizes is the upper bound on number of"
,
" iterations needed to fetch a given set of state."
,
))
.default_value
(
"100,50,25"
)
.takes_value
(
true
),
)
.get_matches
();
...
...
@@ -150,7 +160,7 @@ fn main() {
.value_of
(
"room_id"
)
.expect
(
"room_id should be required since no file"
);
let
individual_
transactions
=
matches
.is_present
(
"
individual_
transactions"
);
let
transactions
=
matches
.is_present
(
"transactions"
);
let
level_sizes
=
value_t_or_exit!
(
matches
,
"level_sizes"
,
LevelSizes
);
...
...
@@ -203,8 +213,8 @@ fn main() {
);
// If we are given an output file, we output the changes as SQL. If the
// `
individual_
transactions` argument is set we wrap each change to a state
//
group in a
transaction.
// `transactions` argument is set we wrap each change to a state
group in a
// transaction.
if
let
Some
(
output
)
=
&
mut
output_file
{
println!
(
"Writing changes..."
);
...
...
@@ -220,7 +230,7 @@ fn main() {
let
new_entry
=
&
new_state_group_map
[
sg
];
if
old_entry
!=
new_entry
{
if
individual_
transactions
{
if
transactions
{
writeln!
(
output
,
"BEGIN;"
);
}
...
...
@@ -254,7 +264,7 @@ fn main() {
writeln!
(
output
,
";"
);
}
if
individual_
transactions
{
if
transactions
{
writeln!
(
output
,
"COMMIT;"
);
}
writeln!
(
output
);
...
...
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