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
43fd0ea0
There was an error fetching the commit references. Please try again later.
Commit
43fd0ea0
authored
9 years ago
by
Jaemyoun
Browse files
Options
Downloads
Patches
Plain Diff
modify to use parameters as getProperty()
parent
17a6cf81
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
rados/src/main/java/com/yahoo/ycsb/db/RadosClient.java
+28
-12
28 additions, 12 deletions
rados/src/main/java/com/yahoo/ycsb/db/RadosClient.java
with
28 additions
and
12 deletions
rados/src/main/java/com/yahoo/ycsb/db/RadosClient.java
+
28
−
12
View file @
43fd0ea0
...
@@ -16,6 +16,7 @@ import com.yahoo.ycsb.StringByteIterator;
...
@@ -16,6 +16,7 @@ import com.yahoo.ycsb.StringByteIterator;
import
java.io.File
;
import
java.io.File
;
import
java.util.HashMap
;
import
java.util.HashMap
;
import
java.util.Properties
;
import
java.util.Set
;
import
java.util.Set
;
import
java.util.Vector
;
import
java.util.Vector
;
...
@@ -28,24 +29,39 @@ import org.json.JSONObject;
...
@@ -28,24 +29,39 @@ import org.json.JSONObject;
*/
*/
public
class
RadosClient
extends
DB
{
public
class
RadosClient
extends
DB
{
// TODO: use conf file
private
static
String
envCONFIGFILE
=
System
.
getenv
(
"RADOS_JAVA_CONFIG_FILE"
);
private
static
String
envID
=
System
.
getenv
(
"RADOS_JAVA_ID"
);
private
static
String
envPOOL
=
System
.
getenv
(
"RADOS_JAVA_POOL"
);
private
static
final
String
CONFIG_FILE
=
envCONFIGFILE
==
null
?
"/etc/ceph/ceph.conf"
:
envCONFIGFILE
;
private
static
final
String
ID
=
envID
==
null
?
"admin"
:
envID
;
private
static
final
String
POOL
=
envPOOL
==
null
?
"data"
:
envPOOL
;
private
static
Rados
rados
;
private
static
Rados
rados
;
private
static
IoCTX
ioctx
;
private
static
IoCTX
ioctx
;
public
static
final
String
CONFIG_FILE_PROPERTY
=
"rados.configfile"
;
public
static
final
String
CONFIG_FILE_DEFAULT
=
"/etc/ceph/ceph.conf"
;
public
static
final
String
ID_PROPERTY
=
"rados.id"
;
public
static
final
String
ID_DEFAULT
=
"admin"
;
public
static
final
String
POOL_PROPERTY
=
"rados.pool"
;
public
static
final
String
POOL_DEFAULT
=
"data"
;
public
void
init
()
throws
DBException
{
public
void
init
()
throws
DBException
{
rados
=
new
Rados
(
ID
);
Properties
props
=
getProperties
();
String
configfile
=
props
.
getProperty
(
CONFIG_FILE_PROPERTY
);
if
(
configfile
==
null
)
{
configfile
=
CONFIG_FILE_DEFAULT
;
}
String
id
=
props
.
getProperty
(
ID_PROPERTY
);
if
(
id
==
null
)
{
id
=
ID_DEFAULT
;
}
String
pool
=
props
.
getProperty
(
POOL_PROPERTY
);
if
(
pool
==
null
)
{
pool
=
POOL_DEFAULT
;
}
rados
=
new
Rados
(
id
);
try
{
try
{
rados
.
confReadFile
(
new
File
(
CONFIG_FILE
));
rados
.
confReadFile
(
new
File
(
configfile
));
rados
.
connect
();
rados
.
connect
();
ioctx
=
rados
.
ioCtxCreate
(
POOL
);
ioctx
=
rados
.
ioCtxCreate
(
pool
);
}
catch
(
RadosException
e
)
{
}
catch
(
RadosException
e
)
{
throw
new
DBException
(
e
.
getMessage
()
+
": "
+
e
.
getReturnValue
());
throw
new
DBException
(
e
.
getMessage
()
+
": "
+
e
.
getReturnValue
());
}
}
...
...
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