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
ad6735fe
Commit
ad6735fe
authored
10 years ago
by
lvca
Committed by
Sean Busbey
9 years ago
Browse files
Options
Downloads
Patches
Plain Diff
[orientdb] Upgraded OrientDB from 1.0.1 -> 1.7.5-SNAPSHOT
parent
2973ea5a
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
orientdb/pom.xml
+1
-1
1 addition, 1 deletion
orientdb/pom.xml
orientdb/src/main/java/com/yahoo/ycsb/db/OrientDBClient.java
+22
-18
22 additions, 18 deletions
orientdb/src/main/java/com/yahoo/ycsb/db/OrientDBClient.java
with
23 additions
and
19 deletions
orientdb/pom.xml
+
1
−
1
View file @
ad6735fe
...
...
@@ -28,7 +28,7 @@
<dependency>
<groupId>
com.orientechnologies
</groupId>
<artifactId>
orientdb-core
</artifactId>
<version>
1.
0.1
</version>
<version>
1.
7.5-SNAPSHOT
</version>
</dependency>
</dependencies>
</project>
This diff is collapsed.
Click to expand it.
orientdb/src/main/java/com/yahoo/ycsb/db/OrientDBClient.java
+
22
−
18
View file @
ad6735fe
...
...
@@ -7,16 +7,11 @@
package
com.yahoo.ycsb.db
;
import
java.util.Collection
;
import
java.util.HashMap
;
import
java.util.Map.Entry
;
import
java.util.Properties
;
import
java.util.Set
;
import
java.util.Vector
;
import
com.orientechnologies.orient.core.config.OGlobalConfiguration
;
import
com.orientechnologies.orient.core.db.document.ODatabaseDocumentTx
;
import
com.orientechnologies.orient.core.db.record.OIdentifiable
;
import
com.orientechnologies.orient.core.dictionary.ODictionary
;
import
com.orientechnologies.orient.core.index.OIndexCursor
;
import
com.orientechnologies.orient.core.intent.OIntentMassiveInsert
;
import
com.orientechnologies.orient.core.record.ORecordInternal
;
import
com.orientechnologies.orient.core.record.impl.ODocument
;
...
...
@@ -25,23 +20,29 @@ import com.yahoo.ycsb.DB;
import
com.yahoo.ycsb.DBException
;
import
com.yahoo.ycsb.StringByteIterator
;
import
java.util.HashMap
;
import
java.util.Map.Entry
;
import
java.util.Properties
;
import
java.util.Set
;
import
java.util.Vector
;
/**
* OrientDB client for YCSB framework.
*
*
* Properties to set:
*
*
* orientdb.url=local:C:/temp/databases or remote:localhost:2424 <br>
* orientdb.database=ycsb <br>
* orientdb.user=admin <br>
* orientdb.password=admin <br>
*
*
* @author Luca Garulli
*
*
*/
public
class
OrientDBClient
extends
DB
{
private
ODatabaseDocumentTx
db
;
private
static
final
String
CLASS
=
"usertable"
;
private
ODatabaseDocumentTx
db
;
private
ODictionary
<
ORecordInternal
<?>>
dictionary
;
/**
...
...
@@ -51,7 +52,7 @@ public class OrientDBClient extends DB {
// initialize OrientDB driver
Properties
props
=
getProperties
();
String
url
=
props
.
getProperty
(
"orientdb.url"
,
"local:C:/temp/databases/ycsb"
);
String
url
=
props
.
getProperty
(
"orientdb.url"
,
"
p
local:C:/temp/databases/ycsb"
);
String
user
=
props
.
getProperty
(
"orientdb.user"
,
"admin"
);
String
password
=
props
.
getProperty
(
"orientdb.password"
,
"admin"
);
Boolean
newdb
=
Boolean
.
parseBoolean
(
props
.
getProperty
(
"orientdb.newdb"
,
"false"
));
...
...
@@ -206,13 +207,16 @@ public class OrientDBClient extends DB {
*/
public
int
scan
(
String
table
,
String
startkey
,
int
recordcount
,
Set
<
String
>
fields
,
Vector
<
HashMap
<
String
,
ByteIterator
>>
result
)
{
try
{
final
Collection
<
ODocument
>
documents
=
dictionary
.
getIndex
().
getEntriesMajor
(
startkey
,
true
,
recordcount
);
for
(
ODocument
document
:
documents
)
{
final
HashMap
<
String
,
ByteIterator
>
entry
=
new
HashMap
<
String
,
ByteIterator
>(
fields
.
size
());
result
.
add
(
entry
);
final
OIndexCursor
entries
=
dictionary
.
getIndex
().
iterateEntriesMajor
(
startkey
,
true
,
true
);
while
(
entries
.
hasNext
())
{
final
Entry
<
Object
,
OIdentifiable
>
entry
=
entries
.
nextEntry
();
final
ODocument
document
=
entry
.
getValue
().
getRecord
();
final
HashMap
<
String
,
ByteIterator
>
map
=
new
HashMap
<
String
,
ByteIterator
>();
result
.
add
(
map
);
for
(
String
field
:
fields
)
entry
.
put
(
field
,
new
StringByteIterator
((
String
)
document
.
field
(
field
)));
map
.
put
(
field
,
new
StringByteIterator
((
String
)
document
.
field
(
field
)));
}
return
0
;
...
...
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