aboutsummaryrefslogtreecommitdiffstats
path: root/aai-traversal/src/main
diff options
context:
space:
mode:
authorKajur, Harish (vk250x) <vk250x@att.com>2018-03-21 19:51:39 -0400
committerKajur, Harish (vk250x) <vk250x@att.com>2018-03-28 16:02:27 -0400
commit6da2faa2bbf183f43365ddad786a5aa945d5ed98 (patch)
tree7b02f35f0b5932e418ae45aaffacd15d737dd432 /aai-traversal/src/main
parent248c5f89fdf9505c2e81129ad7d95c0ee86de517 (diff)
Update the titan code to janus graph code
Issue-ID: AAI-949 Change-Id: Iabb282fb808742d2cc09791a189a5372a01f5be2 Signed-off-by: Kajur, Harish (vk250x) <vk250x@att.com>
Diffstat (limited to 'aai-traversal/src/main')
-rw-r--r--aai-traversal/src/main/assembly/descriptor.xml6
-rw-r--r--aai-traversal/src/main/docker/docker-entrypoint.sh11
-rw-r--r--aai-traversal/src/main/java/org/onap/aai/dbgraphmap/SearchGraph.java6
-rw-r--r--aai-traversal/src/main/java/org/onap/aai/rest/search/SearchProvider.java6
-rw-r--r--aai-traversal/src/main/resources/etc/appprops/error.properties2
-rw-r--r--aai-traversal/src/main/resources/etc/appprops/janusgraph-cached.properties (renamed from aai-traversal/src/main/resources/etc/appprops/titan-cached.properties)4
-rw-r--r--aai-traversal/src/main/resources/etc/appprops/janusgraph-realtime.properties (renamed from aai-traversal/src/main/resources/etc/appprops/titan-realtime.properties)4
-rw-r--r--aai-traversal/src/main/resources/etc/query/stored-queries.json4
-rw-r--r--aai-traversal/src/main/resources/logback.xml2
-rw-r--r--aai-traversal/src/main/swm/package/nix/dist_files/opt/app/aai-traversal/docker-compose.template.yaml4
10 files changed, 29 insertions, 20 deletions
diff --git a/aai-traversal/src/main/assembly/descriptor.xml b/aai-traversal/src/main/assembly/descriptor.xml
index c0dc10e..08e253f 100644
--- a/aai-traversal/src/main/assembly/descriptor.xml
+++ b/aai-traversal/src/main/assembly/descriptor.xml
@@ -9,21 +9,21 @@
<fileSets>
<fileSet>
<directory>${project.basedir}/src/main/resources</directory>
- <outputDirectory>/resources</outputDirectory>
+ <outputDirectory>./resources</outputDirectory>
<includes>
<include>**/*</include>
</includes>
</fileSet>
<fileSet>
<directory>${project.basedir}/src/main/scripts</directory>
- <outputDirectory>/bin</outputDirectory>
+ <outputDirectory>./bin</outputDirectory>
<includes>
<include>**/*</include>
</includes>
</fileSet>
<fileSet>
<directory>${project.build.directory}</directory>
- <outputDirectory>/lib</outputDirectory>
+ <outputDirectory>./lib</outputDirectory>
<includes>
<include>${project.artifactId}-${project.version}.jar</include>
</includes>
diff --git a/aai-traversal/src/main/docker/docker-entrypoint.sh b/aai-traversal/src/main/docker/docker-entrypoint.sh
index efaba95..8e52f0b 100644
--- a/aai-traversal/src/main/docker/docker-entrypoint.sh
+++ b/aai-traversal/src/main/docker/docker-entrypoint.sh
@@ -35,10 +35,6 @@ USER_ID=${LOCAL_USER_ID:-9001}
GROUP_ID=${LOCAL_GROUP_ID:-9001}
if [ $(cat /etc/passwd | grep aaiadmin | wc -l) -eq 0 ]; then
-
- ln -s bin scripts
- ln -s /opt/aai/logroot/AAI-GQ logs
-
groupadd aaiadmin -g ${GROUP_ID} || {
echo "Unable to create the group id for ${GROUP_ID}";
exit 1;
@@ -53,7 +49,12 @@ chown -R aaiadmin:aaiadmin /opt/app /opt/aai/logroot /var/chef
find /opt/app/ -name "*.sh" -exec chmod +x {} +
if [ -f ${APP_HOME}/aai.sh ]; then
+
+ gosu aaiadmin ln -s bin scripts
+ gosu aaiadmin ln -s /opt/aai/logroot/AAI-GQ logs
+
mv ${APP_HOME}/aai.sh /etc/profile.d/aai.sh
+
chmod 755 /etc/profile.d/aai.sh
fi;
@@ -114,6 +115,6 @@ JAVA_OPTS="${JAVA_OPTS} -Djava.security.egd=file:/dev/./urandom";
JAVA_OPTS="${JAVA_OPTS} -Dloader.path=$APP_HOME/resources";
JAVA_OPTS="${JAVA_OPTS} ${POST_JAVA_OPTS}";
-JAVA_MAIN_JAR=$(ls lib/aai-traversal-*SNAPSHOT.jar);
+JAVA_MAIN_JAR=$(ls lib/aai-traversal*.jar);
${JAVA_CMD} ${JVM_OPTS} ${JAVA_OPTS} -jar ${JAVA_MAIN_JAR};
diff --git a/aai-traversal/src/main/java/org/onap/aai/dbgraphmap/SearchGraph.java b/aai-traversal/src/main/java/org/onap/aai/dbgraphmap/SearchGraph.java
index c986aa4..419743b 100644
--- a/aai-traversal/src/main/java/org/onap/aai/dbgraphmap/SearchGraph.java
+++ b/aai-traversal/src/main/java/org/onap/aai/dbgraphmap/SearchGraph.java
@@ -67,7 +67,7 @@ import org.onap.aai.serialization.db.DBSerializer;
import org.onap.aai.serialization.db.EdgeRule;
import org.onap.aai.serialization.db.EdgeRules;
import org.onap.aai.serialization.engines.QueryStyle;
-import org.onap.aai.serialization.engines.TitanDBEngine;
+import org.onap.aai.serialization.engines.JanusGraphDBEngine;
import org.onap.aai.serialization.engines.TransactionalGraphEngine;
import org.onap.aai.serialization.queryformats.exceptions.AAIFormatVertexException;
import org.onap.aai.serialization.queryformats.utils.UrlBuilder;
@@ -521,7 +521,7 @@ public class SearchGraph {
MoxyLoader loader = (MoxyLoader)LoaderFactory.createLoaderForVersion(ModelType.MOXY, AAIProperties.LATEST);
DynamicJAXBContext jaxbContext = loader.getJAXBContext();
- dbEngine = new TitanDBEngine(
+ dbEngine = new JanusGraphDBEngine(
QueryStyle.TRAVERSAL,
connectionType,
loader);
@@ -641,7 +641,7 @@ public class SearchGraph {
MoxyLoader loader = (MoxyLoader) LoaderFactory.createLoaderForVersion(ModelType.MOXY, AAIProperties.LATEST);
DynamicJAXBContext jaxbContext = loader.getJAXBContext();
- dbEngine = new TitanDBEngine(
+ dbEngine = new JanusGraphDBEngine(
QueryStyle.TRAVERSAL,
connectionType,
loader);
diff --git a/aai-traversal/src/main/java/org/onap/aai/rest/search/SearchProvider.java b/aai-traversal/src/main/java/org/onap/aai/rest/search/SearchProvider.java
index 73f6f50..e1d4400 100644
--- a/aai-traversal/src/main/java/org/onap/aai/rest/search/SearchProvider.java
+++ b/aai-traversal/src/main/java/org/onap/aai/rest/search/SearchProvider.java
@@ -53,7 +53,7 @@ import org.onap.aai.restcore.HttpMethod;
import org.onap.aai.restcore.RESTAPI;
import org.onap.aai.serialization.db.DBSerializer;
import org.onap.aai.serialization.engines.QueryStyle;
-import org.onap.aai.serialization.engines.TitanDBEngine;
+import org.onap.aai.serialization.engines.JanusGraphDBEngine;
import org.onap.aai.serialization.engines.TransactionalGraphEngine;
import org.onap.aai.serialization.queryformats.utils.UrlBuilder;
import org.onap.aai.util.AAIConstants;
@@ -153,7 +153,7 @@ public class SearchProvider extends RESTAPI {
}
final ModelType factoryType = ModelType.MOXY;
Loader loader = LoaderFactory.createLoaderForVersion(factoryType, version);
- TransactionalGraphEngine dbEngine = new TitanDBEngine(
+ TransactionalGraphEngine dbEngine = new JanusGraphDBEngine(
QueryStyle.TRAVERSAL,
type,
loader);
@@ -287,7 +287,7 @@ public class SearchProvider extends RESTAPI {
}
final ModelType factoryType = ModelType.MOXY;
Loader loader = LoaderFactory.createLoaderForVersion(factoryType, version);
- TransactionalGraphEngine dbEngine = new TitanDBEngine(
+ TransactionalGraphEngine dbEngine = new JanusGraphDBEngine(
QueryStyle.TRAVERSAL,
type,
loader);
diff --git a/aai-traversal/src/main/resources/etc/appprops/error.properties b/aai-traversal/src/main/resources/etc/appprops/error.properties
index ba71275..d25a2bf 100644
--- a/aai-traversal/src/main/resources/etc/appprops/error.properties
+++ b/aai-traversal/src/main/resources/etc/appprops/error.properties
@@ -67,7 +67,7 @@ AAI_5107=5:2:WARN:5107:400:3000:Required information missing
AAI_5108=5:2:WARN:5108:200:0:Unexpected information in request being ignored
#--- aaidbgen: 6101-6199
-AAI_6101=5:4:ERROR:6101:500:3002:null TitanGraph object passed
+AAI_6101=5:4:ERROR:6101:500:3002:null JanusGraph object passed
AAI_6102=5:4:WARN:6102:400:3000:Passed-in property is not valid for this nodeType
AAI_6103=5:4:WARN:6103:400:3000:Required Node-property not found in input data
AAI_6104=5:4:WARN:6104:400:3000:Required Node-property was passed with no data
diff --git a/aai-traversal/src/main/resources/etc/appprops/titan-cached.properties b/aai-traversal/src/main/resources/etc/appprops/janusgraph-cached.properties
index 0106788..aecea7c 100644
--- a/aai-traversal/src/main/resources/etc/appprops/titan-cached.properties
+++ b/aai-traversal/src/main/resources/etc/appprops/janusgraph-cached.properties
@@ -21,11 +21,15 @@
#
query.fast-property=true
+query.smart-limit=false
# the following parameters are not reloaded automatically and require a manual bounce
#storage.backend=inmemory
storage.backend=inmemory
storage.hostname=localhost
+#explicit Titan version in use - added for JanusGraph migration
+#graph.titan-version=1.0.0
+
#schema.default=none
storage.lock.wait-time=300
storage.hbase.table=aaigraph-dev02
diff --git a/aai-traversal/src/main/resources/etc/appprops/titan-realtime.properties b/aai-traversal/src/main/resources/etc/appprops/janusgraph-realtime.properties
index ace08b3..9e64ac2 100644
--- a/aai-traversal/src/main/resources/etc/appprops/titan-realtime.properties
+++ b/aai-traversal/src/main/resources/etc/appprops/janusgraph-realtime.properties
@@ -21,11 +21,15 @@
#
query.fast-property=true
+query.smart-limit=false
# the following parameters are not reloaded automatically and require a manual bounce
#storage.backend=inmemory
storage.backend=inmemory
storage.hostname=localhost
+#explicit Titan version in use - added for JanusGraph migration
+#graph.titan-version=1.0.0
+
#schema.default=none
storage.lock.wait-time=300
storage.hbase.table=aaigraph-dev02
diff --git a/aai-traversal/src/main/resources/etc/query/stored-queries.json b/aai-traversal/src/main/resources/etc/query/stored-queries.json
index 8d18fd7..6c61246 100644
--- a/aai-traversal/src/main/resources/etc/query/stored-queries.json
+++ b/aai-traversal/src/main/resources/etc/query/stored-queries.json
@@ -31,7 +31,7 @@
}
},{
"pnf-topology":{
- "stored-query":"builder.store('x').union(builder.newInstance().createEdgeTraversal(EdgeType.TREE, 'pnf', 'p-interface').where(builder.newInstance().createEdgeTraversal(EdgeType.COUSIN, 'p-interface', 'physical-link')).as('item').store('x').createEdgeTraversal(EdgeType.COUSIN, 'p-interface', 'physical-link').store('x').createEdgeTraversal(EdgeType.COUSIN, 'physical-link', 'p-interface').where(builder.newInstance().not(builder.newInstance().cap('item'))).store('x').union(builder.newInstance().createEdgeTraversal(EdgeType.TREE, 'p-interface', 'pserver').store('x'),builder.newInstance().createEdgeTraversal(EdgeType.TREE, 'p-interface', 'pnf').store('x')),builder.newInstance().createEdgeTraversal(EdgeType.COUSIN, 'pnf', 'complex').store('x')).cap('x').unfold().dedup()"
+ "stored-query":"builder.store('x').union(builder.newInstance().createEdgeTraversal(EdgeType.TREE, 'pnf', 'p-interface').where(builder.newInstance().createEdgeTraversal(EdgeType.COUSIN, 'p-interface', 'physical-link')).as('item').store('x').createEdgeTraversal(EdgeType.COUSIN, 'p-interface', 'physical-link').store('x').createEdgeTraversal(EdgeType.COUSIN, 'physical-link', 'p-interface').store('x').union(builder.newInstance().createEdgeTraversal(EdgeType.TREE, 'p-interface', 'pserver').store('x'),builder.newInstance().createEdgeTraversal(EdgeType.TREE, 'p-interface', 'pnf').store('x')),builder.newInstance().createEdgeTraversal(EdgeType.COUSIN, 'pnf', 'complex').store('x')).cap('x').unfold().dedup()"
}
},{
"so-request-vfModule":{
@@ -185,7 +185,7 @@
}
},{
"ucpe-topology":{
- "stored-query":"builder.store('x').union(builder.newInstance().createEdgeTraversal(EdgeType.TREE, 'pserver', 'p-interface').where(builder.newInstance().createEdgeTraversal(EdgeType.COUSIN, 'p-interface', 'physical-link')).as('item').store('x').createEdgeTraversal(EdgeType.COUSIN, 'p-interface', 'physical-link').store('x').createEdgeTraversal(EdgeType.COUSIN, 'physical-link', 'p-interface').where(builder.newInstance().not(builder.newInstance().cap('item'))).store('x').createEdgeTraversal(EdgeType.TREE, 'p-interface', 'pnf').store('x'),builder.newInstance().createEdgeTraversal(EdgeType.COUSIN, 'pserver', 'generic-vnf').store('x').as('vnf').createEdgeTraversal(EdgeType.COUSIN, 'generic-vnf', 'vnf-image').store('x').select('vnf').createEdgeTraversal(EdgeType.COUSIN, 'generic-vnf', 'service-instance').store('x').createEdgeTraversal(EdgeType.TREE, 'service-instance', 'service-subscription').store('x').createEdgeTraversal(EdgeType.TREE, 'service-subscription', 'customer').store('x'),builder.newInstance().createEdgeTraversal(EdgeType.COUSIN, 'pserver', 'complex').store('x'),builder.newInstance().createEdgeTraversal(EdgeType.COUSIN, 'pserver', 'vserver').createEdgeTraversal(EdgeType.COUSIN, 'vserver', 'generic-vnf').store('x').as('vnf').createEdgeTraversal(EdgeType.COUSIN, 'generic-vnf', 'vnf-image').store('x').select('vnf').createEdgeTraversal(EdgeType.COUSIN, 'generic-vnf', 'service-instance').store('x').createEdgeTraversal(EdgeType.TREE, 'service-instance', 'service-subscription').store('x').createEdgeTraversal(EdgeType.TREE, 'service-subscription', 'customer').store('x')).cap('x').unfold().dedup()"
+ "stored-query":"builder.store('x').union(builder.newInstance().createEdgeTraversal(EdgeType.TREE, 'pserver', 'p-interface').where(builder.newInstance().createEdgeTraversal(EdgeType.COUSIN, 'p-interface', 'physical-link')).as('item').store('x').createEdgeTraversal(EdgeType.COUSIN, 'p-interface', 'physical-link').store('x').createEdgeTraversal(EdgeType.COUSIN, 'physical-link', 'p-interface').store('x').createEdgeTraversal(EdgeType.TREE, 'p-interface', 'pnf').store('x'),builder.newInstance().createEdgeTraversal(EdgeType.COUSIN, 'pserver', 'generic-vnf').store('x').as('vnf').createEdgeTraversal(EdgeType.COUSIN, 'generic-vnf', 'vnf-image').store('x').select('vnf').createEdgeTraversal(EdgeType.COUSIN, 'generic-vnf', 'service-instance').store('x').createEdgeTraversal(EdgeType.TREE, 'service-instance', 'service-subscription').store('x').createEdgeTraversal(EdgeType.TREE, 'service-subscription', 'customer').store('x'),builder.newInstance().createEdgeTraversal(EdgeType.COUSIN, 'pserver', 'complex').store('x'),builder.newInstance().createEdgeTraversal(EdgeType.COUSIN, 'pserver', 'vserver').createEdgeTraversal(EdgeType.COUSIN, 'vserver', 'generic-vnf').store('x').as('vnf').createEdgeTraversal(EdgeType.COUSIN, 'generic-vnf', 'vnf-image').store('x').select('vnf').createEdgeTraversal(EdgeType.COUSIN, 'generic-vnf', 'service-instance').store('x').createEdgeTraversal(EdgeType.TREE, 'service-instance', 'service-subscription').store('x').createEdgeTraversal(EdgeType.TREE, 'service-subscription', 'customer').store('x')).cap('x').unfold().dedup()"
}
},{
"topology-summary":{
diff --git a/aai-traversal/src/main/resources/logback.xml b/aai-traversal/src/main/resources/logback.xml
index 4bdc015..7947f8f 100644
--- a/aai-traversal/src/main/resources/logback.xml
+++ b/aai-traversal/src/main/resources/logback.xml
@@ -373,7 +373,7 @@
<logger name="org.apache" level="WARN" />
<logger name="org.zookeeper" level="WARN" />
- <logger name="com.thinkaurelius" level="WARN" />
+ <logger name="org.janusgraph" level="WARN" />
<logger name="com.att.aft.dme2" level="WARN" />
<!-- ============================================================================ -->
diff --git a/aai-traversal/src/main/swm/package/nix/dist_files/opt/app/aai-traversal/docker-compose.template.yaml b/aai-traversal/src/main/swm/package/nix/dist_files/opt/app/aai-traversal/docker-compose.template.yaml
index 74ae555..7d31b8b 100644
--- a/aai-traversal/src/main/swm/package/nix/dist_files/opt/app/aai-traversal/docker-compose.template.yaml
+++ b/aai-traversal/src/main/swm/package/nix/dist_files/opt/app/aai-traversal/docker-compose.template.yaml
@@ -42,8 +42,8 @@ services:
- /opt/app/aai-traversal/appconfig/dme2.properties:/opt/app/aai-traversal/resources/dme2.properties
- /opt/app/aai-traversal/appconfig/localhost-access-logback.xml:/opt/app/aai-traversal/resources/localhost-access-logback.xml
- /opt/app/aai-traversal/appconfig/logback.xml:/opt/app/aai-traversal/resources/logback.xml
- - /opt/app/aai-traversal/appconfig/titan-cached.properties:/opt/app/aai-traversal/resources/etc/appprops/titan-cached.properties
- - /opt/app/aai-traversal/appconfig/titan-realtime.properties:/opt/app/aai-traversal/resources/etc/appprops/titan-realtime.properties
+ - /opt/app/aai-traversal/appconfig/janusgraph-cached.properties:/opt/app/aai-traversal/resources/etc/appprops/janusgraph-cached.properties
+ - /opt/app/aai-traversal/appconfig/janusgraph-realtime.properties:/opt/app/aai-traversal/resources/etc/appprops/janusgraph-realtime.properties
logging:
driver: "json-file"
options: