-
Notifications
You must be signed in to change notification settings - Fork 80
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Implement ObjectID to replace mongodb
We need to remove code related to mongodb as we are using postgrace. This is to be done in steps and first step is to implement ObjectId class and replace mongodb.ObjectId calls with that class. Signed-off-by: Ashish Pandey <[email protected]>
- Loading branch information
Showing
50 changed files
with
1,421 additions
and
228 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,14 +4,14 @@ | |
// const _ = require('lodash'); | ||
const argv = require('minimist')(process.argv); | ||
const cluster = require('cluster'); | ||
const mongodb = require('mongodb'); | ||
|
||
const api = require('../api'); | ||
const config = require('../../config'); | ||
const dotenv = require('../util/dotenv'); | ||
const Speedometer = require('../util/speedometer'); | ||
const { RPC_BUFFERS } = require('../rpc'); | ||
|
||
const ObjectID = require('../util/objectid.js'); | ||
dotenv.load(); | ||
|
||
argv.email = argv.email || '[email protected]'; | ||
|
@@ -60,7 +60,7 @@ async function worker(client) { | |
} | ||
|
||
async function write_block(client) { | ||
const block_id = new mongodb.ObjectId(); | ||
const block_id = (new ObjectID(null)).toString(); | ||
return client.block_store.write_block({ | ||
[RPC_BUFFERS]: { data: Buffer.allocUnsafe(argv.size) }, | ||
block_md: { | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.