Skip to content
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

Open
wants to merge 1 commit into
base: leveldb
Choose a base branch
from

Conversation

Sonivaibhav26
Copy link
Contributor

#41

this.db.put(id, obj);
this._addToBucket(id, obj.data); // promise bnana hai kya
this._addToBucket(id, obj.data, time); // promise bnana hai kya
Copy link
Contributor

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" },
Copy link
Contributor

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)

  1. the field mention in as timestamp
  2. time of message Arrival

@@ -136,16 +137,23 @@ module.exports = class LevelDb {
console.error(`can't store store inactive`);
} else {
try {
let time;
Copy link
Contributor

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"]);
Copy link
Contributor

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants