Code Review
/
music.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
review
|
tree
raw
|
inline
| side by side
Merge "Update junits"
[music.git]
/
music-core
/
src
/
main
/
java
/
org
/
onap
/
music
/
datastore
/
MusicDataStore.java
diff --git
a/music-core/src/main/java/org/onap/music/datastore/MusicDataStore.java
b/music-core/src/main/java/org/onap/music/datastore/MusicDataStore.java
index
9ccff82
..
2e17670
100755
(executable)
--- a/
music-core/src/main/java/org/onap/music/datastore/MusicDataStore.java
+++ b/
music-core/src/main/java/org/onap/music/datastore/MusicDataStore.java
@@
-61,10
+61,6
@@
import com.datastax.driver.extras.codecs.enums.EnumNameCodec;
*
*/
public class MusicDataStore {
*
*/
public class MusicDataStore {
-
- public static final String CONSISTENCY_LEVEL_ONE = "ONE";
- public static final String CONSISTENCY_LEVEL_QUORUM = "QUORUM";
- public static final String CONSISTENCY_LEVEL_LOCAL_QUORUM = "LOCAL_QUORUM";
private Session session;
private Cluster cluster;
private Session session;
private Cluster cluster;
@@
-471,15
+467,16
@@
public class MusicDataStore {
try {
SimpleStatement statement = new SimpleStatement(queryObject.getQuery(), queryObject.getValues().toArray());
try {
SimpleStatement statement = new SimpleStatement(queryObject.getQuery(), queryObject.getValues().toArray());
- if (consistencyLevel.equalsIgnoreCase(
CONSISTENCY_LEVEL_
ONE)) {
+ if (consistencyLevel.equalsIgnoreCase(
MusicUtil.
ONE)) {
if(queryObject.getConsistency() == null) {
statement.setConsistencyLevel(ConsistencyLevel.ONE);
} else {
statement.setConsistencyLevel(MusicUtil.getConsistencyLevel(queryObject.getConsistency()));
}
if(queryObject.getConsistency() == null) {
statement.setConsistencyLevel(ConsistencyLevel.ONE);
} else {
statement.setConsistencyLevel(MusicUtil.getConsistencyLevel(queryObject.getConsistency()));
}
- }
- else if (consistencyLevel.equalsIgnoreCase(CONSISTENCY_LEVEL_QUORUM)) {
+ } else if (consistencyLevel.equalsIgnoreCase(MusicUtil.QUORUM)) {
statement.setConsistencyLevel(ConsistencyLevel.QUORUM);
statement.setConsistencyLevel(ConsistencyLevel.QUORUM);
+ } else if (consistencyLevel.equalsIgnoreCase(MusicUtil.LOCAL_QUORUM)) {
+ statement.setConsistencyLevel(ConsistencyLevel.LOCAL_QUORUM);
}
results = session.execute(statement);
}
results = session.execute(statement);
@@
-501,7
+498,7
@@
public class MusicDataStore {
*/
public ResultSet executeOneConsistencyGet(PreparedQueryObject queryObject)
throws MusicServiceException, MusicQueryException {
*/
public ResultSet executeOneConsistencyGet(PreparedQueryObject queryObject)
throws MusicServiceException, MusicQueryException {
- return executeGet(queryObject,
CONSISTENCY_LEVEL_
ONE);
+ return executeGet(queryObject,
MusicUtil.
ONE);
}
/**
}
/**
@@
-512,7
+509,7
@@
public class MusicDataStore {
*/
public ResultSet executeLocalQuorumConsistencyGet(PreparedQueryObject queryObject)
throws MusicServiceException, MusicQueryException {
*/
public ResultSet executeLocalQuorumConsistencyGet(PreparedQueryObject queryObject)
throws MusicServiceException, MusicQueryException {
- return executeGet(queryObject,
CONSISTENCY_LEVEL_
LOCAL_QUORUM);
+ return executeGet(queryObject,
MusicUtil.
LOCAL_QUORUM);
}
/**
}
/**
@@
-523,7
+520,7
@@
public class MusicDataStore {
*/
public ResultSet executeQuorumConsistencyGet(PreparedQueryObject queryObject)
throws MusicServiceException, MusicQueryException {
*/
public ResultSet executeQuorumConsistencyGet(PreparedQueryObject queryObject)
throws MusicServiceException, MusicQueryException {
- return executeGet(queryObject,
CONSISTENCY_LEVEL_
QUORUM);
+ return executeGet(queryObject,
MusicUtil.
QUORUM);
}
}
}
}