Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Y
YCSB
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
Model registry
Operate
Environments
Monitor
Incidents
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
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Adnan Ahmad
YCSB
Commits
f9431c60
Commit
f9431c60
authored
13 years ago
by
Robert Lehmann
Committed by
Robert Lehmann
13 years ago
Browse files
Options
Downloads
Patches
Plain Diff
connected to redis server
parent
dfe7ccbf
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
db/redis/com/yahoo/ycsb/db/RedisClient.java
+31
-0
31 additions, 0 deletions
db/redis/com/yahoo/ycsb/db/RedisClient.java
with
31 additions
and
0 deletions
db/redis/com/yahoo/ycsb/db/RedisClient.java
+
31
−
0
View file @
f9431c60
...
...
@@ -8,11 +8,42 @@ import com.yahoo.ycsb.DB;
import
com.yahoo.ycsb.DBException
;
import
java.util.HashMap
;
import
java.util.Properties
;
import
java.util.Set
;
import
java.util.Vector
;
import
redis.clients.jedis.Jedis
;
import
redis.clients.jedis.Protocol
;
public
class
RedisClient
extends
DB
{
private
Jedis
jedis
;
public
static
final
String
HOST_PROPERTY
=
"redis.host"
;
public
static
final
String
PORT_PROPERTY
=
"redis.port"
;
public
static
final
String
PASSWORD_PROPERTY
=
"redis.password"
;
public
void
init
()
throws
DBException
{
Properties
props
=
getProperties
();
int
port
;
String
portString
=
props
.
getProperty
(
PORT_PROPERTY
);
if
(
portString
!=
null
)
{
port
=
Integer
.
parseInt
(
portString
);
}
else
{
port
=
Protocol
.
DEFAULT_PORT
;
}
String
host
=
props
.
getProperty
(
HOST_PROPERTY
);
jedis
=
new
Jedis
(
host
,
port
);
jedis
.
connect
();
String
password
=
props
.
getProperty
(
PASSWORD_PROPERTY
);
if
(
password
!=
null
)
{
jedis
.
auth
(
password
);
jedis
.
flushAll
();
}
}
@Override
...
...
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