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
cbbdd107
Commit
cbbdd107
authored
13 years ago
by
Michi Mutsuzaki
Browse files
Options
Downloads
Patches
Plain Diff
gh-37 removed slf4j dependency from MongoDbClient.java
parent
947bccc6
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/mongodb/src/com/yahoo/ycsb/db/MongoDbClient.java
+8
-13
8 additions, 13 deletions
db/mongodb/src/com/yahoo/ycsb/db/MongoDbClient.java
with
8 additions
and
13 deletions
db/mongodb/src/com/yahoo/ycsb/db/MongoDbClient.java
+
8
−
13
View file @
cbbdd107
...
...
@@ -16,9 +16,6 @@ import java.util.Properties;
import
java.util.Set
;
import
java.util.Vector
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.bson.types.ObjectId
;
import
com.mongodb.BasicDBObject
;
...
...
@@ -47,8 +44,6 @@ import com.yahoo.ycsb.DBException;
*/
public
class
MongoDbClient
extends
DB
{
private
static
final
Logger
logger
=
LoggerFactory
.
getLogger
(
MongoDbClient
.
class
);
private
Mongo
mongo
;
private
WriteConcern
writeConcern
;
private
String
database
;
...
...
@@ -86,9 +81,9 @@ public class MongoDbClient extends DB {
mongo
=
new
Mongo
(
new
DBAddress
(
url
));
System
.
out
.
println
(
"mongo connection created with "
+
url
);
}
catch
(
Exception
e1
)
{
logger
.
error
(
System
.
err
.
println
(
"Could not initialize MongoDB connection pool for Loader: "
+
e1
,
e1
);
+
e1
.
toString
()
);
return
;
}
...
...
@@ -119,7 +114,7 @@ public class MongoDbClient extends DB {
return
((
Integer
)
errors
.
get
(
"n"
))
==
1
?
0
:
1
;
}
catch
(
Exception
e
)
{
logger
.
error
(
e
+
""
,
e
);
System
.
err
.
println
(
e
.
toString
()
);
return
1
;
}
finally
...
...
@@ -159,11 +154,11 @@ public class MongoDbClient extends DB {
// determine if record was inserted, does not seem to return
// n=<records affected> for insert
DBObject
errors
=
db
.
getLastError
();
System
.
out
.
println
(
errors
.
toString
());
System
.
err
.
println
(
errors
.
toString
());
return
((
Double
)
errors
.
get
(
"ok"
)
==
1.0
)
&&
errors
.
get
(
"err"
)
==
null
?
0
:
1
;
}
catch
(
Exception
e
)
{
logger
.
error
(
e
+
""
,
e
);
System
.
err
.
println
(
e
.
toString
()
);
return
1
;
}
finally
{
if
(
db
!=
null
)
...
...
@@ -213,7 +208,7 @@ public class MongoDbClient extends DB {
}
return
queryResult
!=
null
?
0
:
1
;
}
catch
(
Exception
e
)
{
logger
.
error
(
e
+
""
,
e
);
System
.
err
.
println
(
e
.
toString
()
);
return
1
;
}
finally
{
if
(
db
!=
null
)
...
...
@@ -264,7 +259,7 @@ public class MongoDbClient extends DB {
return
(
Integer
)
errors
.
get
(
"n"
)
==
1
?
0
:
1
;
}
catch
(
Exception
e
)
{
logger
.
error
(
e
+
""
,
e
);
System
.
err
.
println
(
e
.
toString
()
);
return
1
;
}
finally
{
if
(
db
!=
null
)
...
...
@@ -304,7 +299,7 @@ public class MongoDbClient extends DB {
return
0
;
}
catch
(
Exception
e
)
{
logger
.
error
(
e
+
""
,
e
);
System
.
err
.
println
(
e
.
toString
()
);
return
1
;
}
finally
...
...
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