-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
timestamp added #42
base: leveldb
Are you sure you want to change the base?
timestamp added #42
Conversation
this.db.put(id, obj); | ||
this._addToBucket(id, obj.data); // promise bnana hai kya | ||
this._addToBucket(id, obj.data, time); // promise bnana hai kya |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove the comment
@@ -52,7 +75,7 @@ pipeline.source(Stream.consumer({ name: 'process-mapper' })) | |||
// throw new Error('Kaka punjabi'); | |||
next(data, err); | |||
}) | |||
.flow(Batch.map({ number: 5, timeout: 30000, groupBy: ["to", "from"], attributes: ["num", "from"], type: "leveldb" }, | |||
.flow(Batch.map({ number: 5, timeout: 30000, groupBy: ["to", "from"], attributes: ["num", "from" , "_timestamp"], timestamp : "time" }, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
user will not be aware of _timestamp.
you should programmatically return two parameters in the result (similar to our group by parameters)
- the field mention in as timestamp
- time of message Arrival
@@ -136,16 +137,23 @@ module.exports = class LevelDb { | |||
console.error(`can't store store inactive`); | |||
} else { | |||
try { | |||
let time; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
voluntarily capture both options.timesamp and message arrival timestamp and save them in the bucket.
@@ -11,7 +11,7 @@ module.exports = class Batch extends Builder.Flow { | |||
if (new.target === Batch) { | |||
throw new Error('Cannot construct Batch instances directly'); | |||
} | |||
this._storeOptions = _.pick(options, ["number", "groupBy", "attributes", "timeout", "type", "path"]); | |||
this._storeOptions = _.pick(options, ["number", "groupBy", "attributes", "timeout", "type", "path", "timestamp"]); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
passed time stamp parameter should be treated similar to group by or attribute parameters
#41