Compare commits

...

2 Commits

Author SHA1 Message Date
philipyoo 15064a5cb0 fix delimiter check 2019-05-09 17:27:44 -07:00
philipyoo e7bc6c1fb2 save 2019-05-09 15:20:14 -07:00
2 changed files with 9 additions and 1 deletions

View File

@ -51,6 +51,7 @@ class DelimiterMaster extends Delimiter {
if ((this.prefix && !key.startsWith(this.prefix))
|| (typeof this[this.nextContinueMarker] === 'string' &&
key <= this[this.nextContinueMarker])) {
console.log('skip 1')
return FILTER_SKIP;
}
@ -75,8 +76,9 @@ class DelimiterMaster extends Delimiter {
* */
if (key === this.prvKey || key === this[this.nextContinueMarker] ||
(this.delimiter &&
key.startsWith(this[this.nextContinueMarker]))) {
key.startsWith(`${this[this.nextContinueMarker]}${this.delimiter}`))) {
/* master version already filtered */
console.log('skip 2')
return FILTER_SKIP;
}
}
@ -89,6 +91,7 @@ class DelimiterMaster extends Delimiter {
* MongoClient). */
this.prvKey = undefined;
this.prvPHDKey = key;
console.log('accept 1')
return FILTER_ACCEPT;
}
if (Version.isDeleteMarker(value)) {
@ -102,9 +105,11 @@ class DelimiterMaster extends Delimiter {
* follow. */
if (key === this.prvPHDKey) {
this.prvKey = undefined;
console.log('accept 2')
return FILTER_ACCEPT;
}
this.prvKey = key;
console.log('skip 3')
return FILTER_SKIP;
}
@ -131,8 +136,10 @@ class DelimiterMaster extends Delimiter {
if (index === this[this.nextContinueMarker].length - 1) {
return this[this.nextContinueMarker];
}
console.log(`skipping: ${this[this.nextContinueMarker] + VID_SEP}`)
return this[this.nextContinueMarker] + VID_SEP;
}
console.log('skipping: none')
return SKIP_NONE;
}
}

View File

@ -919,6 +919,7 @@ class MongoClientInterface {
stream
.on('data', e => {
console.log(JSON.stringify(e));
skip.filter(e);
})
.on('error', err => {