Connect to RocksDB & enable Lazy Ingestion only for Java REST-API
package eu.fasten.analyzer.restapiplugin;
+import eu.fasten.core.data.Constants;
import eu.fasten.core.data.callableindex.RocksDao;
import eu.fasten.core.data.metadatadb.MetadataDao;
import eu.fasten.core.dbconnectors.PostgresConnector;
@@ -195,6 +196,8 @@ public class KnowledgeBaseConnector {
*/
@PostConstruct
public void connectToGraphDB() {
+ switch (KnowledgeBaseConnector.forge) {
+ case Constants.mvnForge: {
logger.info("Establishing connection to the Graph Database at " + graphdbPath + "...");
try {
graphDao = RocksDBConnector.createReadOnlyRocksDBAccessObject(graphdbPath);
@@ -203,10 +206,15 @@ public class KnowledgeBaseConnector {
System.exit(1);
}
logger.info("...Graph database connection established successfully.");
+
+ }
+ }
}
@PostConstruct
public void initKafkaProducer() {
+ switch (this.forge) {
+ case Constants.mvnForge: {
ingestTopic = this.kafkaOutputTopic;
var producerProperties = new Properties();
producerProperties.setProperty(ProducerConfig.BOOTSTRAP_SERVERS_CONFIG, kafkaAddress);
@@ -217,3 +225,5 @@ public class KnowledgeBaseConnector {
kafkaProducer = new KafkaProducer<>(producerProperties);
}
}
+ }
+}
