Use inline execution in camshaft instead of a database service stub

This commit is contained in:
Raul Ochoa
2016-04-14 17:25:08 +02:00
parent a26025b259
commit da602eeda0
3 changed files with 9 additions and 30 deletions
+7 -6
View File
@@ -2,15 +2,16 @@ var camshaft = require('camshaft');
function AnalysisBackend(options) {
var batchConfig = options.batch || {};
this.batchEndpoint = batchConfig.endpoint || 'http://127.0.0.1:8080/api/v1/sql/job';
var databaseService = batchConfig.databaseService || null;
this.analysisFactory = (databaseService === null) ? camshaft : new camshaft(databaseService);
batchConfig.endpoint = batchConfig.endpoint || 'http://127.0.0.1:8080/api/v1/sql/job';
batchConfig.inlineExecution = batchConfig.inlineExecution || false;
this.batchConfig = batchConfig;
}
module.exports = AnalysisBackend;
AnalysisBackend.prototype.create = function(analysisConfiguration, analysisDefinition, callback) {
analysisConfiguration.batch.endpoint = this.batchEndpoint;
this.analysisFactory.create(analysisConfiguration, analysisDefinition, callback);
analysisConfiguration.batch.endpoint = this.batchConfig.endpoint;
analysisConfiguration.batch.inlineExecution = this.batchConfig.inlineExecution;
camshaft.create(analysisConfiguration, analysisDefinition, callback);
};