top button
Flag Notify
    Connect to us
      Site Registration

Site Registration

Mongo: How can I invoke truncate with YCSB

0 votes
279 views

I am trying to use the truncate feature within YCSB to cause the db to truncate the data set to allow multiple runs against the DB to see the same DB state in spite of previous runs inserts.
I am using -p truncate=true. Is this the correct way to cause a truncate in Mongo.

posted Nov 10, 2016 by anonymous

Looking for an answer?  Promote on:
Facebook Share Button Twitter Share Button LinkedIn Share Button

Similar Questions
+1 vote

I am new to Node and Mongo, I was trying to connect to a mongo database in one file and export the database handler to many other files, so that I need not to connect to the database in all files which need a connection to it. Here is how I attempted to do it

// db.js
var client = require(mongodb).MongoClient
var assert = require(assert)
var url = mongodb://localhost:27017/test

client.connect(url, (err, db) => {
  assert.equal(err, null)
  module.exports = db
})

After exporting the db handler, I tried to access methods on it in another file as follows

var db = require(./db)
console.log(db.collection(col))

but it throws a TypeError, saying that db.collection is not a function. How can I access the methods on db handler in other files?

+1 vote

With the non-blocking asynchronous mongo java/scala driver, it is possible to define a wait time and a wait queue size for operations that cannot be executed directly with a free connection. When settings these values, the mongo driver will make the threads waiting for an available connection.

This behavior is very dangerous for an application written with non-blocking asynchronous IO in mind. These applications use a very limited number of threads (= numbers of cores). Blocking one of these thread can block the whole application.

What would be the recommended way to for this kind of applications? Should we set all these waiting settings to 0 and handle MongoWaitQueueFullException with retries in the application? Should the driver call an application callback when a connection is free?

0 votes

Can we use mongo recommended snapshot i.e LVM snapshot across versions? i.e snapshot taken from v2.4.10 and restore it to v3.0.4.
We have tested the same and this works. Is this recommended by mongo?

...