aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFiete Ostkamp <Fiete.Ostkamp@telekom.de>2024-06-19 10:45:03 +0200
committerFiete Ostkamp <Fiete.Ostkamp@telekom.de>2024-06-22 11:02:39 +0200
commit7119a1fef48ae1307baae1bace228fb6709bcc30 (patch)
tree83728685bfe78b1545c546eb2cdedceeeeb76673
parent4b4a713c0b5802172c3fb7ce8b3a6a1efcead057 (diff)
Update aai-common to 1.14.2 in graphadmin
- contains janusgraph update 0.3.3 -> 0.4.0, tinkerpop 3.3.11 -> 3.4.0 Issue-ID: AAI-3889 Change-Id: Iffad56f3dc4ef1c28e89d0c4a3cc351594ff60f9 Signed-off-by: Fiete Ostkamp <Fiete.Ostkamp@telekom.de>
-rwxr-xr-xpom.xml12
-rw-r--r--src/main/java/org/onap/aai/dbgen/UpdatePropertyToolInternal.java19
-rw-r--r--src/main/java/org/onap/aai/historytruncate/HistoryTruncate.java302
-rw-r--r--src/main/resources/application.properties18
-rw-r--r--src/test/resources/application-test.properties4
-rw-r--r--version.properties2
6 files changed, 182 insertions, 175 deletions
diff --git a/pom.xml b/pom.xml
index a6acab9..1a08548 100755
--- a/pom.xml
+++ b/pom.xml
@@ -26,11 +26,11 @@
<parent>
<groupId>org.onap.aai.aai-common</groupId>
<artifactId>aai-parent</artifactId>
- <version>1.14.1</version>
+ <version>1.14.2-SNAPSHOT</version>
</parent>
<groupId>org.onap.aai.graphadmin</groupId>
<artifactId>aai-graphadmin</artifactId>
- <version>1.14.1-SNAPSHOT</version>
+ <version>1.14.2-SNAPSHOT</version>
<properties>
@@ -55,7 +55,7 @@
<docker.push.registry>localhost:5000</docker.push.registry>
<aai.docker.version>1.0.0</aai.docker.version>
<aai.schema.service.version>1.12.4</aai.schema.service.version>
- <aai.common.version>1.14.1</aai.common.version>
+ <aai.common.version>1.14.2-SNAPSHOT</aai.common.version>
<aai.build.directory>${project.build.directory}/${project.artifactId}-${project.version}-build/
</aai.build.directory>
<aai.docker.namespace>onap</aai.docker.namespace>
@@ -682,6 +682,12 @@
<groupId>org.skyscreamer</groupId>
<artifactId>jsonassert</artifactId>
<scope>test</scope>
+ <exclusions>
+ <exclusion>
+ <groupId>com.vaadin.external.google</groupId>
+ <artifactId>android-json</artifactId>
+ </exclusion>
+ </exclusions>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
diff --git a/src/main/java/org/onap/aai/dbgen/UpdatePropertyToolInternal.java b/src/main/java/org/onap/aai/dbgen/UpdatePropertyToolInternal.java
index a994c7b..cea04c9 100644
--- a/src/main/java/org/onap/aai/dbgen/UpdatePropertyToolInternal.java
+++ b/src/main/java/org/onap/aai/dbgen/UpdatePropertyToolInternal.java
@@ -35,6 +35,7 @@ import org.onap.aai.exceptions.AAIException;
import org.onap.aai.util.AAIConfig;
import java.io.BufferedReader;
+import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;
import java.util.ArrayList;
@@ -98,14 +99,18 @@ public class UpdatePropertyToolInternal {
*/
private boolean processCommandLineArguments(final String[] args) {
logAndPrint("Start of processCommandLineArguments()");
+ boolean filenameExists = false;
+ boolean vertexIdExists = false;
+ boolean isValidArgs = true;
final JCommander commander = new JCommander();
commander.addObject(this);
commander.setVerbose(1);
- commander.parse(args);
commander.setProgramName(UpdatePropertyTool.class.getSimpleName());
- boolean filenameExists = false;
- boolean vertexIdExists = false;
- boolean isValidArgs = true;
+ try {
+ commander.parse(args);
+ } catch (Exception e) {
+ return false;
+ }
// check for help flag
if (help) {
@@ -262,7 +267,11 @@ public class UpdatePropertyToolInternal {
String allVertexIdsString = sb.toString();
logAndPrint("All vertex IDs from file " + filePath + ":\n" + allVertexIdsString);
} catch (IOException ioe) {
- logErrorAndPrint("ERROR reading in text file failed.", ioe);
+ if(ioe instanceof FileNotFoundException) {
+ logErrorAndPrint(String.format("File %s not found.", filePath));
+ } else {
+ logErrorAndPrint("ERROR reading in text file failed.", ioe);
+ }
}
}
diff --git a/src/main/java/org/onap/aai/historytruncate/HistoryTruncate.java b/src/main/java/org/onap/aai/historytruncate/HistoryTruncate.java
index 8d7114e..b2a3c91 100644
--- a/src/main/java/org/onap/aai/historytruncate/HistoryTruncate.java
+++ b/src/main/java/org/onap/aai/historytruncate/HistoryTruncate.java
@@ -21,8 +21,8 @@ package org.onap.aai.historytruncate;
import java.util.*;
import java.util.concurrent.TimeUnit;
+import java.util.stream.Collectors;
-import org.onap.aai.restclient.PropertyPasswordConfiguration;
import org.apache.tinkerpop.gremlin.process.traversal.P;
import org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.GraphTraversalSource;
import org.apache.tinkerpop.gremlin.structure.Edge;
@@ -47,13 +47,13 @@ import org.janusgraph.core.JanusGraph;
public class HistoryTruncate {
private static Logger LOGGER = LoggerFactory.getLogger(HistoryTruncate.class);
-
+
/* Using realtime d */
private static final String REALTIME_DB = "realtime";
-
+
private static final String LOG_ONLY_MODE = "LOG_ONLY";
private static final String DELETE_AND_LOG_MODE = "DELETE_AND_LOG";
- private static final String SILENT_DELETE_MODE = "SILENT_DELETE";
+ private static final String SILENT_DELETE_MODE = "SILENT_DELETE";
static ArrayList <String> VALIDMODES = new <String> ArrayList ();
static {
VALIDMODES.add(LOG_ONLY_MODE);
@@ -61,51 +61,45 @@ public class HistoryTruncate {
VALIDMODES.add(SILENT_DELETE_MODE);
}
- private static final int batchCommitSize = 500;
-
+ private static final int batchCommitSize = 500;
+
private static boolean historyEnabled;
private static String defaultTruncateMode;
private static Integer defaultTruncateWindowDays;
-
+
/**
* The main method.
*
*/
public static void main(String[] args) {
-
+
// Set the logging file properties to be used by EELFManager
System.setProperty("aai.service.name", HistoryTruncate.class.getSimpleName());
Properties props = System.getProperties();
props.setProperty(Configuration.PROPERTY_LOGGING_FILE_NAME, AAIConstants.AAI_LOGBACK_PROPS);
props.setProperty(Configuration.PROPERTY_LOGGING_FILE_PATH, AAIConstants.AAI_HOME_BUNDLECONFIG);
-
- AnnotationConfigApplicationContext ctx = new AnnotationConfigApplicationContext();
- PropertyPasswordConfiguration initializer = new PropertyPasswordConfiguration();
- initializer.initialize(ctx);
- try {
- ctx.scan(
- "org.onap.aai.config",
- "org.onap.aai.setup"
- );
- ctx.refresh();
- } catch (Exception e) {
- LOGGER.error("Error - Could not initialize context beans for HistoryTruncate. ");
- AAISystemExitUtil.systemExitCloseAAIGraph(1);
- }
-
- historyEnabled = Boolean.parseBoolean(ctx.getEnvironment().getProperty("history.enabled","false"));
- if( !historyEnabled ) {
- String emsg = "Error - HistoryTruncate may only be used when history.enabled=true. ";
- System.out.println(emsg);
- LOGGER.error(emsg);
- AAISystemExitUtil.systemExitCloseAAIGraph(1);
+
+ try (AnnotationConfigApplicationContext ctx = new AnnotationConfigApplicationContext()) {
+ try {
+ ctx.refresh();
+ } catch (Exception e) {
+ LOGGER.error("Error - Could not initialize context beans for HistoryTruncate. ");
+ AAISystemExitUtil.systemExitCloseAAIGraph(1);
+ }
+
+ historyEnabled = Boolean.parseBoolean(ctx.getEnvironment().getProperty("history.enabled","false"));
+ if( !historyEnabled ) {
+ String emsg = "Error - HistoryTruncate may only be used when history.enabled=true. ";
+ System.out.println(emsg);
+ LOGGER.error(emsg);
+ AAISystemExitUtil.systemExitCloseAAIGraph(1);
+ }
+
+ defaultTruncateWindowDays = Integer.parseInt(ctx.getEnvironment().getProperty("history.truncate.window.days","999"));
+ defaultTruncateMode = ctx.getEnvironment().getProperty("history.truncate.mode",LOG_ONLY_MODE);
}
-
- defaultTruncateWindowDays = Integer.parseInt(ctx.getEnvironment().getProperty("history.truncate.window.days","999"));
- defaultTruncateMode = ctx.getEnvironment().getProperty("history.truncate.mode",LOG_ONLY_MODE);
-
- HistoryTruncate histTrunc = new HistoryTruncate();
+ HistoryTruncate histTrunc = new HistoryTruncate();
boolean success = histTrunc.executeCommand(args);
if(success){
AAISystemExitUtil.systemExitCloseAAIGraph(0);
@@ -118,60 +112,60 @@ public class HistoryTruncate {
public boolean executeCommand(String[] args) {
boolean successStatus = true;
- // If they passed in args on the command line, then we should
+ // If they passed in args on the command line, then we should
// use those in place of the default ones we got from environment variables.
// "-truncateMode","LOG_ONLY","-truncateWindow","999"
String truncateMode = defaultTruncateMode;
int truncateWindowDays = defaultTruncateWindowDays;
-
- if (args != null && args.length > 0) {
- // They passed some arguments in that will affect processing
- for (int i = 0; i < args.length; i++) {
- String thisArg = args[i];
- if (thisArg.equals("-truncateMode")) {
- i++;
- if (i >= args.length) {
- LOGGER.error(" No value passed with -truncateMode option. ");
- return false;
- }
- if( !VALIDMODES.contains(args[i]) ) {
- LOGGER.error(" Unrecognized -truncateMode value passed: [" +
- args[i] + "]. Valid values = " + VALIDMODES.toString() );
- return false;
- }
- truncateMode = args[i];
- } else if (thisArg.equals("-truncateWindowDays")) {
- i++;
- if (i >= args.length) {
- LOGGER.error("No value passed with -truncateWindowDays option.");
- return false;
- }
- String nextArg = args[i];
- try {
- truncateWindowDays = Integer.parseInt(nextArg);
- } catch (Exception e) {
- LOGGER.error("Bad value passed with -truncateWindowDays option: ["
- + nextArg + "]");
- return false;
- }
- } else {
- LOGGER.error(" Unrecognized argument passed to HistoryTruncate: ["
- + thisArg + "]. ");
- LOGGER.error(" Valid values are: -truncateMode -truncateWindowDays ");
- return false;
- }
- }
- }
+
+ if (args != null && args.length > 0) {
+ // They passed some arguments in that will affect processing
+ for (int i = 0; i < args.length; i++) {
+ String thisArg = args[i];
+ if (thisArg.equals("-truncateMode")) {
+ i++;
+ if (i >= args.length) {
+ LOGGER.error(" No value passed with -truncateMode option. ");
+ return false;
+ }
+ if( !VALIDMODES.contains(args[i]) ) {
+ LOGGER.error(" Unrecognized -truncateMode value passed: [" +
+ args[i] + "]. Valid values = " + VALIDMODES.toString() );
+ return false;
+ }
+ truncateMode = args[i];
+ } else if (thisArg.equals("-truncateWindowDays")) {
+ i++;
+ if (i >= args.length) {
+ LOGGER.error("No value passed with -truncateWindowDays option.");
+ return false;
+ }
+ String nextArg = args[i];
+ try {
+ truncateWindowDays = Integer.parseInt(nextArg);
+ } catch (Exception e) {
+ LOGGER.error("Bad value passed with -truncateWindowDays option: ["
+ + nextArg + "]");
+ return false;
+ }
+ } else {
+ LOGGER.error(" Unrecognized argument passed to HistoryTruncate: ["
+ + thisArg + "]. ");
+ LOGGER.error(" Valid values are: -truncateMode -truncateWindowDays ");
+ return false;
+ }
+ }
+ }
LOGGER.debug(" Running HistoryTruncate with: truncateMode = " + truncateMode +
", truncateWindowDays = " + truncateWindowDays );
-
+
Long truncateEndTs = calculateTruncWindowEndTimeStamp(truncateWindowDays);
JanusGraph jgraph = null;
long scriptStartTime = System.currentTimeMillis();
Boolean doLogging = doLoggingOrNot( truncateMode );
Boolean doDelete = doDeleteOrNot( truncateMode );
-
+
try {
AAIConfig.init();
ErrorLogHelper.loadProperties();
@@ -180,7 +174,7 @@ public class HistoryTruncate {
verifyGraph(AAIGraph.getInstance().getGraph());
jgraph = AAIGraph.getInstance().getGraph();
LOGGER.debug(" ---- got the new graph instance. ");
-
+
// Note - process edges first so they get logged as they are deleted since
// edges connected to vertices being deleted would get auto-deleted by the db.
long timeA = System.nanoTime();
@@ -191,7 +185,7 @@ public class HistoryTruncate {
long secCount = TimeUnit.NANOSECONDS.toSeconds(diffTime) - (60 * minCount);
LOGGER.debug(" Took this long to process the Edges: " +
minCount + " minutes, " + secCount + " seconds " );
-
+
processVerts(jgraph, truncateEndTs, doLogging, doDelete);
long timeC = System.nanoTime();
diffTime = timeC - timeB;
@@ -199,7 +193,7 @@ public class HistoryTruncate {
secCount = TimeUnit.NANOSECONDS.toSeconds(diffTime) - (60 * minCount);
LOGGER.debug(" Took this long to process the Vertices: " +
minCount + " minutes, " + secCount + " seconds " );
-
+
} catch (AAIException e) {
ErrorLogHelper.logError("AAI_6128", e.getMessage());
LOGGER.error("Encountered an exception during the historyTruncate: ", e);
@@ -223,50 +217,48 @@ public class HistoryTruncate {
return successStatus;
}
-
-
- public void processVerts(JanusGraph jgraph, Long truncBeforeTs,
+
+
+ public void processVerts(JanusGraph jgraph, Long truncBeforeTs,
Boolean doLogging, Boolean doDelete ) {
Graph g = jgraph.newTransaction();
GraphTraversalSource gts = g.traversal();
//Iterator <Vertex> vertItr = gts.V().has(AAIProperties.END_TS, P.lt(truncBeforeTs));
- Iterator <Vertex> vertItr = gts.V().has("end-ts", P.lt(truncBeforeTs));
- ArrayList <Long> vidList = new ArrayList <Long> ();
- while( vertItr.hasNext() ) {
- Vertex tmpV = vertItr.next();
- Long tmpVid = Long.valueOf(tmpV.id().toString());
- vidList.add(tmpVid);
- }
+ List<Long> vidList = gts.V().has("end-ts", P.lt(truncBeforeTs))
+ .toStream()
+ .map(v -> v.id().toString())
+ .map(Long::valueOf)
+ .collect(Collectors.toList());
int vTotalCount = vidList.size();
int batchCount = vTotalCount / batchCommitSize;
if((batchCount * batchCommitSize) < vTotalCount){
batchCount++;
}
-
+
LOGGER.info( " Vertex TotalCount = " + vTotalCount +
- ", we get batchCount = " + batchCount +
+ ", we get batchCount = " + batchCount +
", using commit size = " + batchCommitSize );
-
- int vIndex = 0;
+
+ int vIndex = 0;
for(int batchNo=1; batchNo<=batchCount; batchNo++){
- ArrayList <Long> batchVids = new ArrayList <Long> ();
- int thisBVCount = 0;
- while( (thisBVCount < batchCommitSize) && (vIndex < vTotalCount) ) {
+ ArrayList <Long> batchVids = new ArrayList<Long>();
+ int thisBVCount = 0;
+ while((thisBVCount < batchCommitSize) && (vIndex < vTotalCount)) {
batchVids.add(vidList.get(vIndex));
thisBVCount++;
vIndex++;
}
// now process this batch
LOGGER.info( "Process vertex batch # " + batchNo +
- ", which contains " + batchVids.size() + " ids. ");
+ ", which contains " + batchVids.size() + " ids. ");
processVertBatch(jgraph, doLogging, doDelete, batchVids);
}
}
-
- private void processVertBatch(JanusGraph jgraph, Boolean doLogging,
+
+ private void processVertBatch(JanusGraph jgraph, Boolean doLogging,
Boolean doDelete, ArrayList <Long> vidList ) {
Graph g = jgraph.newTransaction();
@@ -274,14 +266,14 @@ public class HistoryTruncate {
int delFailCount = 0;
int vCount = 0;
int delCount = 0;
-
- Iterator <Vertex> vertItr = gts.V(vidList);
- while( vertItr.hasNext() ) {
+
+ Iterator<Vertex> vertItr = gts.V(vidList);
+ while(vertItr.hasNext()) {
vCount++;
Vertex tmpV = vertItr.next();
String tmpVid = tmpV.id().toString();
String tmpPropsStr = "";
- if( doLogging ) {
+ if(doLogging) {
Iterator<VertexProperty<Object>> pI = tmpV.properties();
while( pI.hasNext() ){
VertexProperty<Object> tp = pI.next();
@@ -290,8 +282,8 @@ public class HistoryTruncate {
}
LOGGER.info(" vid = " + tmpVid + ", props: (" + tmpPropsStr + ") " );
}
-
- if( doDelete ) {
+
+ if(doDelete) {
LOGGER.info("Removing vid = " + tmpVid );
try {
tmpV.remove();
@@ -303,21 +295,21 @@ public class HistoryTruncate {
}
}
}
-
- if( doDelete ) {
+
+ if(doDelete) {
LOGGER.info("Calling commit on delete of Vertices." );
try {
g.tx().commit();
} catch ( Exception e ) {
- LOGGER.error("ERROR trying to commit Vertex Deletes for this batch. " +
+ LOGGER.error("ERROR trying to commit Vertex Deletes for this batch. " +
LogFormatTools.getStackTop(e) );
- LOGGER.info( vCount + " candidate vertices processed. "
+ LOGGER.info( vCount + " candidate vertices processed. "
+ " vertex deletes - COMMIT FAILED. ");
return;
}
}
-
- if( doDelete ) {
+
+ if(doDelete) {
LOGGER.info( vCount + " candidate vertices processed. " +
delFailCount + " delete attempts failed, " +
delCount + " deletes successful. ");
@@ -327,8 +319,8 @@ public class HistoryTruncate {
}
}
-
- public void processEdges(JanusGraph jgraph, Long truncBeforeTs,
+
+ public void processEdges(JanusGraph jgraph, Long truncBeforeTs,
Boolean doLogging, Boolean doDelete ) {
Graph g = jgraph.newTransaction();
@@ -340,22 +332,22 @@ public class HistoryTruncate {
Edge tmpE = edgeItr.next();
String tmpEid = tmpE.id().toString();
eidList.add(tmpEid);
- }
+ }
int eTotalCount = eidList.size();
int batchCount = eTotalCount / batchCommitSize;
if((batchCount * batchCommitSize) < eTotalCount){
batchCount++;
}
-
+
LOGGER.info( " Edge TotalCount = " + eTotalCount +
- ", we get batchCount = " + batchCount +
+ ", we get batchCount = " + batchCount +
", using commit size = " + batchCommitSize );
-
- int eIndex = 0;
+
+ int eIndex = 0;
for(int batchNo=1; batchNo<=batchCount; batchNo++){
ArrayList <String> batchEids = new ArrayList <String> ();
- int thisBECount = 0;
+ int thisBECount = 0;
while( (thisBECount < batchCommitSize) && (eIndex < eTotalCount) ) {
batchEids.add(eidList.get(eIndex));
thisBECount++;
@@ -363,13 +355,13 @@ public class HistoryTruncate {
}
// now process this batch
LOGGER.info( "Process edge batch # " + batchNo +
- ", which contains " + batchEids.size() + " ids. ");
+ ", which contains " + batchEids.size() + " ids. ");
processEdgeBatch(jgraph, doLogging, doDelete, batchEids);
}
}
-
- private void processEdgeBatch(JanusGraph jgraph, Boolean doLogging,
+
+ private void processEdgeBatch(JanusGraph jgraph, Boolean doLogging,
Boolean doDelete, ArrayList <String> eidList ) {
Graph g = jgraph.newTransaction();
@@ -377,7 +369,7 @@ public class HistoryTruncate {
int delFailCount = 0;
int eCount = 0;
int delCount = 0;
-
+
Iterator <Edge> edgeItr = gts.E(eidList);
while( edgeItr.hasNext() ) {
eCount++;
@@ -397,11 +389,11 @@ public class HistoryTruncate {
Vertex conV = conVtxs.next();
tmpConVs = tmpConVs + "[" + conV.id().toString() + "] ";
}
- LOGGER.info(" eid = " + tmpEid
+ LOGGER.info(" eid = " + tmpEid
+ ", Connecting vids = " + tmpConVs
+ ", props: (" + tmpEProps + "). " );
}
-
+
if( doDelete ) {
LOGGER.info("Removing Edge eid = " + tmpEid );
try {
@@ -413,20 +405,20 @@ public class HistoryTruncate {
}
}
}
-
+
if( doDelete ) {
LOGGER.info("Calling commit on delete of Edges." );
try {
g.tx().commit();
} catch ( Exception e ) {
- LOGGER.error("ERROR trying to commit Edge Deletes for this batch. " +
+ LOGGER.error("ERROR trying to commit Edge Deletes for this batch. " +
LogFormatTools.getStackTop(e) );
- LOGGER.info( eCount + " candidate edges processed. "
+ LOGGER.info( eCount + " candidate edges processed. "
+ " edge deletes - COMMIT FAILED. ");
return;
}
}
-
+
if( doDelete ) {
LOGGER.info( eCount + " candidate edges processed. " +
delFailCount + " delete attempts failed, " +
@@ -436,42 +428,42 @@ public class HistoryTruncate {
LOGGER.info( eCount + " candidate edges processed in this batch. " );
}
}
-
-
+
+
public int getCandidateVertexCount(JanusGraph jgraph, int windowDaysVal) {
Graph g = jgraph.newTransaction();
GraphTraversalSource gts = g.traversal();
- Long truncTs = calculateTruncWindowEndTimeStamp(windowDaysVal);
+ Long truncTs = calculateTruncWindowEndTimeStamp(windowDaysVal);
//int candVCount = gts.V().has(AAIProperties.END_TS, P.lt(truncTs)).count().next().intValue();
int candVCount = gts.V().has("end-ts", P.lt(truncTs)).count().next().intValue();
- LOGGER.info( " for the timeStamp = " + truncTs
- + ", which corresponds to the passed truncateWindowDays = "
- + windowDaysVal
- + ", found " + candVCount
+ LOGGER.info( " for the timeStamp = " + truncTs
+ + ", which corresponds to the passed truncateWindowDays = "
+ + windowDaysVal
+ + ", found " + candVCount
+ " candidate vertices. ");
return candVCount;
}
-
+
public int getCandidateEdgeCount(JanusGraph jgraph, int windowDaysVal) {
Graph g = jgraph.newTransaction();
GraphTraversalSource gts = g.traversal();
- Long truncTs = calculateTruncWindowEndTimeStamp(windowDaysVal);
+ Long truncTs = calculateTruncWindowEndTimeStamp(windowDaysVal);
//int candECount = gts.E().has(AAIProperties.END_TS, P.lt(truncTs)).count().next().intValue();
int candECount = gts.E().has("end-ts", P.lt(truncTs)).count().next().intValue();
- LOGGER.info( " for the timeStamp = " + truncTs
- + ", which corresponds to the passed truncateWindowDays = "
- + windowDaysVal
- + ", found " + candECount
+ LOGGER.info( " for the timeStamp = " + truncTs
+ + ", which corresponds to the passed truncateWindowDays = "
+ + windowDaysVal
+ + ", found " + candECount
+ " candidate Edges. ");
return candECount;
}
-
+
public static void verifyGraph(JanusGraph graph) {
if (graph == null) {
- String emsg = "Not able to get a graph object in DataSnapshot.java\n";
+ String emsg = "Not able to get a graph object in HistoryTruncate.java\n";
LOGGER.debug(emsg);
AAISystemExitUtil.systemExitCloseAAIGraph(1);
}
@@ -479,20 +471,20 @@ public class HistoryTruncate {
}
public long calculateTruncWindowEndTimeStamp( int timeWindowDays ){
- // Given a window size in days, calculate the timestamp that
+ // Given a window size in days, calculate the timestamp that
// represents the early-edge of that window.
-
+
long unixTimeNow = System.currentTimeMillis();
if( timeWindowDays <= 0 ){
// This just means that they want to truncate all the way up to the current time
return unixTimeNow;
}
-
+
long windowInMillis = timeWindowDays * 24 * 60 * 60L * 1000;
long windowEdgeTimeStampInMs = unixTimeNow - windowInMillis;
return windowEdgeTimeStampInMs;
-
- }
+
+ }
private Boolean doLoggingOrNot( String truncMode ){
if( truncMode.equals(SILENT_DELETE_MODE) ){
@@ -501,8 +493,8 @@ public class HistoryTruncate {
else {
return true;
}
- }
-
+ }
+
private Boolean doDeleteOrNot( String truncMode ){
if( truncMode.equals(LOG_ONLY_MODE) ){
return false;
@@ -510,7 +502,7 @@ public class HistoryTruncate {
else {
return true;
}
- }
-
-
-} \ No newline at end of file
+ }
+
+
+}
diff --git a/src/main/resources/application.properties b/src/main/resources/application.properties
index 57987b9..6e2fbcc 100644
--- a/src/main/resources/application.properties
+++ b/src/main/resources/application.properties
@@ -20,14 +20,14 @@ server.tomcat.max-idle-time=60000
# If you get an application startup failure that the port is already taken
# If thats not it, please check if the key-store file path makes sense
-server.local.startpath=src/main/resources/
+server.local.startpath=src/main/resources
server.basic.auth.location=${server.local.startpath}etc/auth/realm.properties
server.port=8449
server.ssl.enabled-protocols=TLSv1.1,TLSv1.2
-server.ssl.key-store=${server.local.startpath}etc/auth/aai_keystore
+server.ssl.key-store=${server.local.startpath}/etc/auth/aai_keystore
server.ssl.key-store-password=password(OBF:1vn21ugu1saj1v9i1v941sar1ugw1vo0)
-server.ssl.trust-store=${server.local.startpath}etc/auth/aai_keystore
+server.ssl.trust-store=${server.local.startpath}/etc/auth/aai_keystore
server.ssl.trust-store-password=password(OBF:1vn21ugu1saj1v9i1v941sar1ugw1vo0)
server.ssl.client-auth=want
server.ssl.key-store-type=JKS
@@ -38,7 +38,7 @@ jms.bind.address=tcp://localhost:61450
# dmaap is deprecated and now replaced with kafka
spring.kafka.producer.bootstrap-servers=${BOOTSTRAP_SERVERS}
spring.kafka.producer.properties.security.protocol=SASL_PLAINTEXT
-spring.kafka.producer.properties.sasl.mechanism=SCRAM-SHA-512
+spring.kafka.producer.properties.sasl.mechanism=SCRAM-SHA-512
spring.kafka.producer.key-serializer=org.apache.kafka.common.serialization.StringSerializer
spring.kafka.producer.value-serializer=org.apache.kafka.common.serialization.StringSerializer
spring.kafka.producer.properties.sasl.jaas.config = ${JAAS_CONFIG}
@@ -51,7 +51,7 @@ schema.source.name=onap
schema.nodes.location=${server.local.startpath}/schema/${schema.source.name}/oxm/
schema.edges.location=${server.local.startpath}/schema/${schema.source.name}/dbedgerules/
-schema.ingest.file=${server.local.startpath}/application.properties
+schema.ingest.file=${server.local.startpath}/application.propertiess
# Schema Version Related Attributes
@@ -78,9 +78,9 @@ schema.service.nodes.endpoint=nodes?version=
schema.service.edges.endpoint=edgerules?version=
schema.service.versions.endpoint=versions
-schema.service.ssl.key-store=${server.local.startpath}etc/auth/aai_keystore
+schema.service.ssl.key-store=${server.local.startpath}/etc/auth/aai_keystore
schema.service.ssl.key-store-password=password(OBF:1vn21ugu1saj1v9i1v941sar1ugw1vo0)
-schema.service.ssl.trust-store=${server.local.startpath}etc/auth/aai_keystore
+schema.service.ssl.trust-store=${server.local.startpath}/etc/auth/aai_keystore
schema.service.ssl.trust-store-password=password(OBF:1vn21ugu1saj1v9i1v941sar1ugw1vo0)
aaf.cadi.file=${server.local.startpath}/cadi.properties
@@ -89,8 +89,8 @@ aperture.rdbmsname=aai_relational
aperture.service.client=no-auth
aperture.service.base.url=http://localhost:8457/aai/aperture
-aperture.service.ssl.key-store=${server.local.startpath}etc/auth/aai_keystore
-aperture.service.ssl.trust-store=${server.local.startpath}etc/auth/aai_keystore
+aperture.service.ssl.key-store=${server.local.startpath}/etc/auth/aai_keystore
+aperture.service.ssl.trust-store=${server.local.startpath}/etc/auth/aai_keystore
aperture.service.ssl.key-store-password=password(OBF:1vn21ugu1saj1v9i1v941sar1ugw1vo0)
aperture.service.ssl.trust-store-password=password(OBF:1vn21ugu1saj1v9i1v941sar1ugw1vo0)
aperture.service.timeout-in-milliseconds=300000
diff --git a/src/test/resources/application-test.properties b/src/test/resources/application-test.properties
index 26d4197..d5b47d2 100644
--- a/src/test/resources/application-test.properties
+++ b/src/test/resources/application-test.properties
@@ -27,8 +27,8 @@ server.tomcat.max-idle-time=60000
# If you get an application startup failure that the port is already taken
# If thats not it, please check if the key-store file path makes sense
-server.local.startpath=src/main/resources/
-server.basic.auth.location=${server.local.startpath}etc/auth/realm.properties
+server.local.startpath=src/main/resources
+server.basic.auth.location=${server.local.startpath}/etc/auth/realm.properties
server.port=8449
security.require-ssl=false
diff --git a/version.properties b/version.properties
index 654a031..466ec95 100644
--- a/version.properties
+++ b/version.properties
@@ -5,7 +5,7 @@
major_version=1
minor_version=14
-patch_version=1
+patch_version=2
base_version=${major_version}.${minor_version}.${patch_version}