* ============LICENSE_START=======================================================
* org.onap.aai
* ================================================================================
- * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+ * Copyright © 2017-2018 AT&T Intellectual Property. All rights reserved.
* ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* See the License for the specific language governing permissions and
* limitations under the License.
* ============LICENSE_END=========================================================
- *
- * ECOMP is a trademark and service mark of AT&T Intellectual Property.
*/
package org.onap.aai.dbmap;
import java.util.Properties;
-import org.apache.commons.lang.exception.ExceptionUtils;
import org.apache.tinkerpop.gremlin.structure.io.IoCore;
import org.onap.aai.dbgen.SchemaGenerator;
import org.onap.aai.logging.LogFormatTools;
-import com.thinkaurelius.titan.core.TitanFactory;
-import com.thinkaurelius.titan.core.TitanGraph;
-import com.thinkaurelius.titan.core.TitanTransaction;
-import com.thinkaurelius.titan.core.schema.TitanManagement;
+import org.janusgraph.core.JanusGraphFactory;
+import org.janusgraph.core.JanusGraph;
+import org.janusgraph.core.JanusGraphTransaction;
+import org.janusgraph.core.schema.JanusGraphManagement;
import com.att.eelf.configuration.EELFLogger;
import com.att.eelf.configuration.EELFManager;
public class InMemoryGraph {
private static final EELFLogger LOGGER = EELFManager.getInstance().getLogger(InMemoryGraph.class);
- private TitanGraph graph = null;
+ private JanusGraph graph = null;
public InMemoryGraph(Builder builder) throws IOException {
*/
InputStream is = new FileInputStream(builder.propertyFile);
try {
- graph = TitanFactory.open(builder.propertyFile);
+ graph = JanusGraphFactory.open(builder.propertyFile);
Properties graphProps = new Properties();
graphProps.load(is);
- TitanManagement graphMgt = graph.openManagement();
+ JanusGraphManagement graphMgt = graph.openManagement();
if(builder.isSchemaEnabled){
LOGGER.info("Schema Enabled");
- SchemaGenerator.loadSchemaIntoTitan(graph, graphMgt);
+ SchemaGenerator.loadSchemaIntoJanusGraph(graphMgt);
}
- TitanTransaction transaction = graph.newTransaction();
+ JanusGraphTransaction transaction = graph.newTransaction();
LOGGER.info("Loading snapshot");
transaction.io(IoCore.graphson()).readGraph(builder.graphsonLocation);
transaction.commit();
}
}
- public TitanGraph getGraph() {
+ public JanusGraph getGraph() {
return graph;
}