Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
const _iterateAll = function(
columnNames,
columnFamily,
keyColumnName,
returnKeyColumn,
batchSize,
onEach,
callback,
fromKey
) {
const columns = [
{ name: 'keyId', type: { code: dataTypes.text } },
{ name: 'colOne', type: { code: dataTypes.text } },
{ name: 'colTwo', type: { code: dataTypes.text } }
];
const query = _buildIterateAllQuery(columnNames, columnFamily, keyColumnName, batchSize, fromKey);
// Since Cassandra.runQuery jumps into a new process tick, there is no issue over this recursion exceeding stack size with large data-sets
runQuery(query.query, query.parameters, (err, rows) => {
if (err) {
return callback(err);
}
if (_.isEmpty(rows)) {
// Notify the caller that we've finished
return callback();
}
const requestedRowColumns = [];
const _iterateAll = function(
columnNames,
columnFamily,
keyColumnName,
returnKeyColumn,
batchSize,
onEach,
callback,
fromKey
) {
const columns = [
{ name: 'keyId', type: { code: dataTypes.text } },
{ name: 'colOne', type: { code: dataTypes.text } },
{ name: 'colTwo', type: { code: dataTypes.text } }
];
const query = _buildIterateAllQuery(columnNames, columnFamily, keyColumnName, batchSize, fromKey);
// Since Cassandra.runQuery jumps into a new process tick, there is no issue over this recursion exceeding stack size with large data-sets
runQuery(query.query, query.parameters, (err, rows) => {
if (err) {
return callback(err);
}
if (_.isEmpty(rows)) {
// Notify the caller that we've finished
return callback();
}
const requestedRowColumns = [];
_.each(rows, row => {
// Remember the last key to use for the next iteration