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
7f20bcbb
Commit
7f20bcbb
authored
8 years ago
by
kunalsomani
Committed by
Sean Busbey
8 years ago
Browse files
Options
Downloads
Patches
Plain Diff
[couchbase2] Added support for ttl in Couchbase2 (#803)
[couchbase2] Added support for ttl in Couchbase2
parent
1286bdde
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
couchbase2/README.md
+2
-1
2 additions, 1 deletion
couchbase2/README.md
couchbase2/src/main/java/com/yahoo/ycsb/db/couchbase2/Couchbase2Client.java
+8
-4
8 additions, 4 deletions
...n/java/com/yahoo/ycsb/db/couchbase2/Couchbase2Client.java
with
10 additions
and
5 deletions
couchbase2/README.md
+
2
−
1
View file @
7f20bcbb
...
...
@@ -141,4 +141,5 @@ You can set the following properties (with the default settings applied):
-
couchbase.boost=3: If > 0 trades CPU for higher throughput. N is the number of event loops, ideally
set to the number of physical cores. Setting higher than that will likely degrade performance.
-
couchbase.networkMetricsInterval=0: The interval in seconds when latency metrics will be logged.
-
couchbase.runtimeMetricsInterval=0: The interval in seconds when runtime metrics will be logged.
\ No newline at end of file
-
couchbase.runtimeMetricsInterval=0: The interval in seconds when runtime metrics will be logged.
-
couchbase.documentExpiry=0: Document Expiry is the amount of time(second) until a document expires in Couchbase.
\ No newline at end of file
This diff is collapsed.
Click to expand it.
couchbase2/src/main/java/com/yahoo/ycsb/db/couchbase2/Couchbase2Client.java
+
8
−
4
View file @
7f20bcbb
...
...
@@ -93,6 +93,8 @@ import java.util.concurrent.locks.LockSupport;
* set to the number of physical cores. Setting higher than that will likely degrade performance.</li>
* <li><b>couchbase.networkMetricsInterval=0</b> The interval in seconds when latency metrics will be logged.</li>
* <li><b>couchbase.runtimeMetricsInterval=0</b> The interval in seconds when runtime metrics will be logged.</li>
* <li><b>couchbase.documentExpiry=0</b> Document Expiry is the amount of time until a document expires in
* Couchbase.</li>
* </ul>
*/
public
class
Couchbase2Client
extends
DB
{
...
...
@@ -127,7 +129,8 @@ public class Couchbase2Client extends DB {
private
int
networkMetricsInterval
;
private
int
runtimeMetricsInterval
;
private
String
scanAllQuery
;
private
int
documentExpiry
;
@Override
public
void
init
()
throws
DBException
{
Properties
props
=
getProperties
();
...
...
@@ -149,6 +152,7 @@ public class Couchbase2Client extends DB {
boost
=
Integer
.
parseInt
(
props
.
getProperty
(
"couchbase.boost"
,
"3"
));
networkMetricsInterval
=
Integer
.
parseInt
(
props
.
getProperty
(
"couchbase.networkMetricsInterval"
,
"0"
));
runtimeMetricsInterval
=
Integer
.
parseInt
(
props
.
getProperty
(
"couchbase.runtimeMetricsInterval"
,
"0"
));
documentExpiry
=
Integer
.
parseInt
(
props
.
getProperty
(
"couchbase.documentExpiry"
,
"0"
));
scanAllQuery
=
"SELECT RAW meta().id FROM `"
+
bucketName
+
"` WHERE meta().id >= '$1' ORDER BY meta().id LIMIT $2"
;
...
...
@@ -342,7 +346,7 @@ public class Couchbase2Client extends DB {
*/
private
Status
updateKv
(
final
String
docId
,
final
HashMap
<
String
,
ByteIterator
>
values
)
{
waitForMutationResponse
(
bucket
.
async
().
replace
(
RawJsonDocument
.
create
(
docId
,
encode
(
values
)),
RawJsonDocument
.
create
(
docId
,
documentExpiry
,
encode
(
values
)),
persistTo
,
replicateTo
));
...
...
@@ -412,7 +416,7 @@ public class Couchbase2Client extends DB {
for
(
int
i
=
0
;
i
<
tries
;
i
++)
{
try
{
waitForMutationResponse
(
bucket
.
async
().
insert
(
RawJsonDocument
.
create
(
docId
,
encode
(
values
)),
RawJsonDocument
.
create
(
docId
,
documentExpiry
,
encode
(
values
)),
persistTo
,
replicateTo
));
...
...
@@ -491,7 +495,7 @@ public class Couchbase2Client extends DB {
*/
private
Status
upsertKv
(
final
String
docId
,
final
HashMap
<
String
,
ByteIterator
>
values
)
{
waitForMutationResponse
(
bucket
.
async
().
upsert
(
RawJsonDocument
.
create
(
docId
,
encode
(
values
)),
RawJsonDocument
.
create
(
docId
,
documentExpiry
,
encode
(
values
)),
persistTo
,
replicateTo
));
...
...
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