aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--music-core/src/main/java/org/onap/music/datastore/jsonobjects/JsonUpdate.java6
-rw-r--r--music-core/src/main/java/org/onap/music/lockingservice/cassandra/CassaLockStore.java2
-rw-r--r--music-core/src/main/java/org/onap/music/lockingservice/cassandra/MusicLockState.java7
-rw-r--r--music-core/src/main/java/org/onap/music/main/CipherUtil.java3
-rw-r--r--music-core/src/main/java/org/onap/music/main/DeadlockDetectionUtil.java7
-rw-r--r--music-core/src/main/java/org/onap/music/main/MusicUtil.java12
-rw-r--r--music-core/src/main/java/org/onap/music/service/impl/MusicCassaCore.java3
7 files changed, 19 insertions, 21 deletions
diff --git a/music-core/src/main/java/org/onap/music/datastore/jsonobjects/JsonUpdate.java b/music-core/src/main/java/org/onap/music/datastore/jsonobjects/JsonUpdate.java
index cd767a44..29fdb1d4 100644
--- a/music-core/src/main/java/org/onap/music/datastore/jsonobjects/JsonUpdate.java
+++ b/music-core/src/main/java/org/onap/music/datastore/jsonobjects/JsonUpdate.java
@@ -190,7 +190,6 @@ public class JsonUpdate implements Serializable {
}
EELFLoggerDelegate.mdcPut("keyspace", "( "+this.getKeyspaceName()+" ) ");
- long startTime = System.currentTimeMillis();
String operationId = UUID.randomUUID().toString(); // just for infoging purposes.
String consistency = this.getConsistencyInfo().get("type");
@@ -311,9 +310,6 @@ public class JsonUpdate implements Serializable {
conditionInfo = new Condition(this.getConditions(), selectQuery);
}
- ReturnType operationResult = null;
- long jsonParseCompletionTime = System.currentTimeMillis();
-
if(consistency.equalsIgnoreCase(MusicUtil.EVENTUAL) && this.getConsistencyInfo().get("consistency") != null) {
if(MusicUtil.isValidConsistency(this.getConsistencyInfo().get("consistency"))) {
queryObject.setConsistency(this.getConsistencyInfo().get("consistency"));
@@ -376,7 +372,7 @@ public class JsonUpdate implements Serializable {
}
public String getRowIdString() {
- return this.rowIdString.toString();
+ return this.rowIdString;
}
public void setRowIdString(String rowIdString) {
diff --git a/music-core/src/main/java/org/onap/music/lockingservice/cassandra/CassaLockStore.java b/music-core/src/main/java/org/onap/music/lockingservice/cassandra/CassaLockStore.java
index 0c5d39c8..9a69a9ba 100644
--- a/music-core/src/main/java/org/onap/music/lockingservice/cassandra/CassaLockStore.java
+++ b/music-core/src/main/java/org/onap/music/lockingservice/cassandra/CassaLockStore.java
@@ -503,7 +503,7 @@ public class CassaLockStore {
}
public List<String> getAllLocksForOwner(String ownerId, String keyspace, String table) throws MusicServiceException, MusicQueryException {
- List<String> toRet = new ArrayList<String>();
+ List<String> toRet = new ArrayList<>();
String lockTable = table_prepend_name + table;
PreparedQueryObject queryObject = new PreparedQueryObject();
queryObject.appendQueryString("SELECT key, lockreference FROM " + keyspace + "." + lockTable);
diff --git a/music-core/src/main/java/org/onap/music/lockingservice/cassandra/MusicLockState.java b/music-core/src/main/java/org/onap/music/lockingservice/cassandra/MusicLockState.java
index 00187dc8..14fb8135 100644
--- a/music-core/src/main/java/org/onap/music/lockingservice/cassandra/MusicLockState.java
+++ b/music-core/src/main/java/org/onap/music/lockingservice/cassandra/MusicLockState.java
@@ -39,15 +39,18 @@ import org.onap.music.eelf.logging.format.ErrorTypes;
// the state variable that will be stored in the locking service, capturing the transitions of
public class MusicLockState implements Serializable {
+ // captures the state of the lock
public enum LockStatus {
UNLOCKED, BEING_LOCKED, LOCKED
- };// captures the state of the lock
+ }
+
private static EELFLoggerDelegate logger = EELFLoggerDelegate.getLogger(MusicLockState.class);
private LockStatus lockStatus;
private boolean needToSyncQuorum = false;
private String lockHolder;
- private long leasePeriod = Long.MAX_VALUE, leaseStartTime = -1;
+ private long leasePeriod = Long.MAX_VALUE;
+ private long leaseStartTime = -1;
private String errorMessage = null;
public MusicLockState(String errorMessage) {
diff --git a/music-core/src/main/java/org/onap/music/main/CipherUtil.java b/music-core/src/main/java/org/onap/music/main/CipherUtil.java
index 3278dc12..9a8ff69d 100644
--- a/music-core/src/main/java/org/onap/music/main/CipherUtil.java
+++ b/music-core/src/main/java/org/onap/music/main/CipherUtil.java
@@ -168,7 +168,8 @@ public class CipherUtil {
*/
public static String encryptPKC(String value, String skey) {
Cipher cipher = null;
- byte[] iv = null, finalByte = null;
+ byte[] iv = null;
+ byte[] finalByte = null;
try {
cipher = Cipher.getInstance(ALGORYTHM_DETAILS, "SunJCE");
diff --git a/music-core/src/main/java/org/onap/music/main/DeadlockDetectionUtil.java b/music-core/src/main/java/org/onap/music/main/DeadlockDetectionUtil.java
index 23ccca7f..004bd550 100644
--- a/music-core/src/main/java/org/onap/music/main/DeadlockDetectionUtil.java
+++ b/music-core/src/main/java/org/onap/music/main/DeadlockDetectionUtil.java
@@ -47,7 +47,7 @@ public class DeadlockDetectionUtil {
public Node(String id) {
super();
this.id = id;
- this.links = new ArrayList<Node>();
+ this.links = new ArrayList<>();
}
public List<Node> getLinks() {
@@ -85,7 +85,7 @@ public class DeadlockDetectionUtil {
}
public DeadlockDetectionUtil() {
- this.nodeList = new HashMap<String, Node>();
+ this.nodeList = new HashMap<>();
}
public void listAllNodes() {
@@ -105,8 +105,7 @@ public class DeadlockDetectionUtil {
currentNode = nodeList.get("o" + owner);
}
- boolean cycle = findCycle(currentNode);
- return cycle;
+ return findCycle(currentNode);
}
private boolean findCycle(Node currentNode) {
diff --git a/music-core/src/main/java/org/onap/music/main/MusicUtil.java b/music-core/src/main/java/org/onap/music/main/MusicUtil.java
index 865ca01f..4b8b1059 100644
--- a/music-core/src/main/java/org/onap/music/main/MusicUtil.java
+++ b/music-core/src/main/java/org/onap/music/main/MusicUtil.java
@@ -516,7 +516,7 @@ public class MusicUtil {
case MAP:
return (Map<String, Object>) valueObj;
case LIST:
- return (List<Object>)valueObj;
+ return valueObj;
case BLOB:
default:
@@ -525,8 +525,8 @@ public class MusicUtil {
}
public static ByteBuffer convertToActualDataType(DataType colType, byte[] valueObj) {
- ByteBuffer buffer = ByteBuffer.wrap(valueObj);
- return buffer;
+
+ return ByteBuffer.wrap(valueObj);
}
/**
@@ -620,11 +620,9 @@ public class MusicUtil {
* @throws MusicServiceException
* @throws MusicQueryException
*/
- public static long v2sTimeStampInMicroseconds(long ordinal, long timeOfWrite) throws MusicServiceException, MusicQueryException {
+ public static long v2sTimeStampInMicroseconds(long ordinal, long timeOfWrite) throws MusicServiceException, MusicQueryException{
// TODO: use acquire time instead of music eternity epoch
- long ts = ordinal * MaxLockReferenceTimePart + (timeOfWrite - MusicEternityEpochMillis);
-
- return ts;
+ return ordinal * MaxLockReferenceTimePart + (timeOfWrite - MusicEternityEpochMillis);
}
public static MusicCoreService getMusicCoreService() {
diff --git a/music-core/src/main/java/org/onap/music/service/impl/MusicCassaCore.java b/music-core/src/main/java/org/onap/music/service/impl/MusicCassaCore.java
index d29ba32b..8055a48d 100644
--- a/music-core/src/main/java/org/onap/music/service/impl/MusicCassaCore.java
+++ b/music-core/src/main/java/org/onap/music/service/impl/MusicCassaCore.java
@@ -1080,9 +1080,10 @@ public class MusicCassaCore implements MusicCoreService {
ReturnType result = null;
try {
+
PreparedQueryObject queryObj = null;
queryObj = jsonInsertObj.genInsertPreparedQueryObj();
-
+
if (consistency.equalsIgnoreCase(MusicUtil.EVENTUAL)) {
result = eventualPut(jsonInsertObj.genInsertPreparedQueryObj());
} else if (consistency.equalsIgnoreCase(MusicUtil.CRITICAL)) {