Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
tapir
Manage
Activity
Members
Labels
Plan
Issues
8
Issue boards
Milestones
Wiki
Code
Merge requests
2
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
syslab
tapir
Commits
c81361b5
Commit
c81361b5
authored
9 years ago
by
Naveen Kr. Sharma
Browse files
Options
Downloads
Patches
Plain Diff
README on how to run stores and clients
parent
f9d8f73b
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
store/README.md
+50
-0
50 additions, 0 deletions
store/README.md
store/common/frontend/client.h
+6
-6
6 additions, 6 deletions
store/common/frontend/client.h
with
56 additions
and
6 deletions
store/README.md
0 → 100644
+
50
−
0
View file @
c81361b5
# How to Run
The clients and servers have to be provided a configuration file, one
for each shard and a timestamp server (for OCC). For example a 3 shard
configuration will have the following files:
shard0.config
```
f 1
replica <server-address-1>:<port>
replica <server-address-2>:<port>
replica <server-address-3>:<port>
```
shard1.config
```
f 1
replica <server-address-4>:<port>
replica <server-address-5>:<port>
replica <server-address-6>:<port>
```
shard2.config
```
f 1
replica <server-address-7>:<port>
replica <server-address-8>:<port>
replica <server-address-9>:<port>
```
shard.tss.config
```
f 1
replica <server-address-10>:<port>
replica <server-address-11>:<port>
replica <server-address-12>:<port>
```
## Running Servers
To start the replicas, run the following command with the
`server`
binary for any of the stores,
`./server -c <shard-config-$n> -i <replica-number> -m <mode> -f <preload-keys>`
For each shard, you need to run
`2f+1`
instances of
`server`
corresponding to the address:port pointed by
`replica-number`
.
Make sure you run all replicas for all shards.
## Running Clients
To run any of the clients in the benchmark directory,
`./client -c <shard-config-prefix> -N <n_shards> -m <mode>`
This diff is collapsed.
Click to expand it.
store/common/frontend/client.h
+
6
−
6
View file @
c81361b5
...
...
@@ -40,13 +40,13 @@ public:
// Sharding logic: Given key, generates a number b/w 0 to nshards-1
uint64_t
key_to_shard
(
const
std
::
string
&
key
,
uint64_t
nshards
)
{
uint64_t
hash
=
5381
;
const
char
*
str
=
key
.
c_str
();
for
(
unsigned
int
i
=
0
;
i
<
key
.
length
();
i
++
)
{
hash
=
((
hash
<<
5
)
+
hash
)
+
(
uint64_t
)
str
[
i
];
}
uint64_t
hash
=
5381
;
const
char
*
str
=
key
.
c_str
();
for
(
unsigned
int
i
=
0
;
i
<
key
.
length
();
i
++
)
{
hash
=
((
hash
<<
5
)
+
hash
)
+
(
uint64_t
)
str
[
i
];
}
return
(
hash
%
nshards
);
return
(
hash
%
nshards
);
};
};
...
...
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