6195dbef3e4c7b218ad33b85515940c01e4723f6
[music.git] / src / main / java / org / onap / music / datastore / MusicDataStore.java
1 /*
2  * ============LICENSE_START==========================================
3  * org.onap.music
4  * ===================================================================
5  *  Copyright (c) 2017 AT&T Intellectual Property
6  * ===================================================================
7  *  Modifications Copyright (c) 2018-2019 IBM
8  *  Modifications Copyright (c) 2019 Samsung
9  * ===================================================================
10  *  Licensed under the Apache License, Version 2.0 (the "License");
11  *  you may not use this file except in compliance with the License.
12  *  You may obtain a copy of the License at
13  *
14  *     http://www.apache.org/licenses/LICENSE-2.0
15  *
16  *  Unless required by applicable law or agreed to in writing, software
17  *  distributed under the License is distributed on an "AS IS" BASIS,
18  *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
19  *  See the License for the specific language governing permissions and
20  *  limitations under the License.
21  *
22  * ============LICENSE_END=============================================
23  * ====================================================================
24  */
25
26 package org.onap.music.datastore;
27
28 import java.net.InetAddress;
29 import java.net.NetworkInterface;
30 import java.net.SocketException;
31 import java.nio.ByteBuffer;
32 import java.util.ArrayList;
33 import java.util.Enumeration;
34 import java.util.HashMap;
35 import java.util.Iterator;
36 import java.util.Map;
37
38 import org.onap.music.eelf.logging.EELFLoggerDelegate;
39 import org.onap.music.eelf.logging.format.AppMessages;
40 import org.onap.music.eelf.logging.format.ErrorSeverity;
41 import org.onap.music.eelf.logging.format.ErrorTypes;
42 import org.onap.music.exceptions.MusicQueryException;
43 import org.onap.music.exceptions.MusicServiceException;
44 import org.onap.music.main.CipherUtil;
45 import org.onap.music.main.MusicUtil;
46 import com.datastax.driver.core.Cluster;
47 import com.datastax.driver.core.ColumnDefinitions;
48 import com.datastax.driver.core.ColumnDefinitions.Definition;
49 import com.datastax.driver.core.ConsistencyLevel;
50 import com.datastax.driver.core.DataType;
51 import com.datastax.driver.core.HostDistance;
52 import com.datastax.driver.core.KeyspaceMetadata;
53 import com.datastax.driver.core.Metadata;
54 import com.datastax.driver.core.PoolingOptions;
55 import com.datastax.driver.core.ResultSet;
56 import com.datastax.driver.core.Row;
57 import com.datastax.driver.core.Session;
58 import com.datastax.driver.core.SimpleStatement;
59 import com.datastax.driver.core.TableMetadata;
60 import com.datastax.driver.core.exceptions.AlreadyExistsException;
61 import com.datastax.driver.core.exceptions.InvalidQueryException;
62 import com.datastax.driver.core.exceptions.NoHostAvailableException;
63
64 /**
65  * @author nelson24
66  *
67  */
68 public class MusicDataStore {
69
70     public static final String CONSISTENCY_LEVEL_ONE = "ONE";
71     public static final String CONSISTENCY_LEVEL_QUORUM = "QUORUM";
72     private Session session;
73     private Cluster cluster;
74
75
76     /**
77      * @param session
78      */
79     public void setSession(Session session) {
80         this.session = session;
81     }
82
83     /**
84      * @param session
85      */
86     public Session getSession() {
87         return session;
88     }
89
90     /**
91      * @param cluster
92      */
93     public void setCluster(Cluster cluster) {
94         this.cluster = cluster;
95     }
96
97
98     private EELFLoggerDelegate logger = EELFLoggerDelegate.getLogger(MusicDataStore.class);
99
100     /**
101      *
102      */
103     public MusicDataStore() {
104         connectToCassaCluster();
105     }
106
107
108     /**
109      * @param cluster
110      * @param session
111      */
112     public MusicDataStore(Cluster cluster, Session session) {
113         this.session = session;
114         this.cluster = cluster;
115     }
116
117     /**
118      *
119      * @param remoteIp
120      * @throws MusicServiceException
121      */
122     public MusicDataStore(String remoteIp) {
123         try {
124             connectToCassaCluster(remoteIp);
125         } catch (MusicServiceException e) {
126             logger.error(EELFLoggerDelegate.errorLogger, e.getMessage(), e);
127         }
128     }
129
130     /**
131      *
132      * @return
133      */
134     private ArrayList<String> getAllPossibleLocalIps() {
135         ArrayList<String> allPossibleIps = new ArrayList<>();
136         try {
137             Enumeration<NetworkInterface> en = NetworkInterface.getNetworkInterfaces();
138             while (en.hasMoreElements()) {
139                 NetworkInterface ni = en.nextElement();
140                 Enumeration<InetAddress> ee = ni.getInetAddresses();
141                 while (ee.hasMoreElements()) {
142                     InetAddress ia = ee.nextElement();
143                     allPossibleIps.add(ia.getHostAddress());
144                 }
145             }
146         } catch (SocketException e) {
147             logger.error(EELFLoggerDelegate.errorLogger, e.getMessage(), AppMessages.CONNCECTIVITYERROR,
148                 ErrorSeverity.ERROR, ErrorTypes.CONNECTIONERROR, e);
149         }catch(Exception e) {
150             logger.error(EELFLoggerDelegate.errorLogger, e.getMessage(), ErrorSeverity.ERROR, ErrorTypes
151                 .GENERALSERVICEERROR, e);
152         }
153         return allPossibleIps;
154     }
155
156     /**
157      * This method iterates through all available IP addresses and connects to multiple cassandra
158      * clusters.
159      */
160     private void connectToCassaCluster() {
161         Iterator<String> it = getAllPossibleLocalIps().iterator();
162         String address = "localhost";
163         String[] addresses = null;
164         address = MusicUtil.getMyCassaHost();
165         addresses = address.split(",");
166
167         logger.info(EELFLoggerDelegate.applicationLogger,
168                         "Connecting to cassa cluster: Iterating through possible ips:"
169                                         + getAllPossibleLocalIps());
170         PoolingOptions poolingOptions = new PoolingOptions();
171         poolingOptions
172         .setConnectionsPerHost(HostDistance.LOCAL,  4, 10)
173         .setConnectionsPerHost(HostDistance.REMOTE, 2, 4);
174         while (it.hasNext()) {
175             try {
176                 if(MusicUtil.getCassName() != null && MusicUtil.getCassPwd() != null) {
177                     String cassPwd = CipherUtil.decryptPKC(MusicUtil.getCassPwd());
178                     logger.info(EELFLoggerDelegate.applicationLogger,
179                             "Building with credentials "+MusicUtil.getCassName()+" & "+MusicUtil.getCassPwd());
180                     cluster = Cluster.builder().withPort(MusicUtil.getCassandraPort())
181                                         .withCredentials(MusicUtil.getCassName(), cassPwd)
182                                         //.withLoadBalancingPolicy(new RoundRobinPolicy())
183                                         .withoutJMXReporting()
184                                         .withPoolingOptions(poolingOptions)
185                                         .addContactPoints(addresses).build();
186                 }
187                 else
188                     cluster = Cluster.builder().withPort(MusicUtil.getCassandraPort())
189                                         //.withLoadBalancingPolicy(new RoundRobinPolicy())
190                                         .addContactPoints(addresses).build();
191
192                 Metadata metadata = cluster.getMetadata();
193                 logger.info(EELFLoggerDelegate.applicationLogger, "Connected to cassa cluster "
194                                 + metadata.getClusterName() + " at " + address);
195                 session = cluster.connect();
196
197                 break;
198             } catch (NoHostAvailableException e) {
199                 address = it.next();
200                 logger.error(EELFLoggerDelegate.errorLogger, e.getMessage(),AppMessages.HOSTUNAVAILABLE,
201                     ErrorSeverity.ERROR, ErrorTypes.CONNECTIONERROR, e);
202             }
203         }
204     }
205
206     /**
207      *
208      */
209     public void close() {
210         session.close();
211     }
212
213     /**
214      * This method connects to cassandra cluster on specific address.
215      *
216      * @param address
217      */
218     private void connectToCassaCluster(String address) throws MusicServiceException {
219         String[] addresses = null;
220         addresses = address.split(",");
221         PoolingOptions poolingOptions = new PoolingOptions();
222         poolingOptions
223         .setConnectionsPerHost(HostDistance.LOCAL,  4, 10)
224         .setConnectionsPerHost(HostDistance.REMOTE, 2, 4);
225         if(MusicUtil.getCassName() != null && MusicUtil.getCassPwd() != null) {
226             String cassPwd = CipherUtil.decryptPKC(MusicUtil.getCassPwd());
227             logger.info(EELFLoggerDelegate.applicationLogger,
228                     "Building with credentials "+MusicUtil.getCassName()+" & "+ MusicUtil.getCassPwd());
229             cluster = Cluster.builder().withPort(MusicUtil.getCassandraPort())
230                         .withCredentials(MusicUtil.getCassName(), cassPwd)
231                         //.withLoadBalancingPolicy(new RoundRobinPolicy())
232                         .withoutJMXReporting()
233                         .withPoolingOptions(poolingOptions)
234                         .addContactPoints(addresses).build();
235         } else {
236             cluster = Cluster.builder().withPort(MusicUtil.getCassandraPort())
237                         //.withLoadBalancingPolicy(new RoundRobinPolicy())
238                         .withoutJMXReporting()
239                         .withPoolingOptions(poolingOptions)
240                         .addContactPoints(addresses).build();
241         }
242         
243         // JmxReporter reporter =
244         //         JmxReporter.forRegistry(cluster.getMetrics().getRegistry())
245         //             .inDomain(cluster.getClusterName() + "-metrics")
246         //             .build();
247
248         //     reporter.start();
249             
250         Metadata metadata = cluster.getMetadata();
251         logger.info(EELFLoggerDelegate.applicationLogger, "Connected to cassa cluster "
252                         + metadata.getClusterName() + " at " + address);
253         try {
254             session = cluster.connect();
255         } catch (Exception ex) {
256             logger.error(EELFLoggerDelegate.errorLogger, ex.getMessage(),AppMessages.CASSANDRACONNECTIVITY,
257                 ErrorSeverity.ERROR, ErrorTypes.SERVICEUNAVAILABLE, ex);
258             throw new MusicServiceException(
259                             "Error while connecting to Cassandra cluster.. " + ex.getMessage());
260         }
261     }
262
263     /**
264      *
265      * @param keyspace
266      * @param tableName
267      * @param columnName
268      * @return DataType
269      */
270     public DataType returnColumnDataType(String keyspace, String tableName, String columnName) {
271         KeyspaceMetadata ks = cluster.getMetadata().getKeyspace(keyspace);
272         TableMetadata table = ks.getTable(tableName);
273         return table.getColumn(columnName).getType();
274
275     }
276
277     /**
278      *
279      * @param keyspace
280      * @param tableName
281      * @return TableMetadata
282      */
283     public TableMetadata returnColumnMetadata(String keyspace, String tableName) {
284         KeyspaceMetadata ks = cluster.getMetadata().getKeyspace(keyspace);
285         return ks.getTable(tableName);
286     }
287     
288     /**
289     *
290     * @param keyspace
291     * @param tableName
292     * @return TableMetadata
293     */
294    public KeyspaceMetadata returnKeyspaceMetadata(String keyspace) {
295        KeyspaceMetadata ks = cluster.getMetadata().getKeyspace(keyspace);
296        return ks;
297    }
298
299
300     /**
301      * Utility function to return the Java specific object type.
302      *
303      * @param row
304      * @param colName
305      * @param colType
306      * @return
307      */
308     public Object getColValue(Row row, String colName, DataType colType) {
309
310         switch (colType.getName()) {
311             case VARCHAR:
312                 return row.getString(colName);
313             case UUID:
314                 return row.getUUID(colName);
315             case VARINT:
316                 return row.getVarint(colName);
317             case BIGINT:
318                 return row.getLong(colName);
319             case INT:
320                 return row.getInt(colName);
321             case FLOAT:
322                 return row.getFloat(colName);
323             case DOUBLE:
324                 return row.getDouble(colName);
325             case BOOLEAN:
326                 return row.getBool(colName);
327             case MAP:
328                 return row.getMap(colName, String.class, String.class);
329             case LIST:
330                 return row.getList(colName, String.class);
331             default:
332                 return null;
333         }
334     }
335
336     public byte[] getBlobValue(Row row, String colName, DataType colType) {
337         ByteBuffer bb = row.getBytes(colName);
338         return bb.array();
339     }
340
341     public boolean doesRowSatisfyCondition(Row row, Map<String, Object> condition) throws Exception {
342         ColumnDefinitions colInfo = row.getColumnDefinitions();
343
344         for (Map.Entry<String, Object> entry : condition.entrySet()) {
345             String colName = entry.getKey();
346             DataType colType = colInfo.getType(colName);
347             Object columnValue = getColValue(row, colName, colType);
348             Object conditionValue = MusicUtil.convertToActualDataType(colType, entry.getValue());
349             if (columnValue.equals(conditionValue) == false)
350                 return false;
351         }
352         return true;
353     }
354
355     /**
356      * Utility function to store ResultSet values in to a MAP for output.
357      *
358      * @param results
359      * @return MAP
360      */
361     public Map<String, HashMap<String, Object>> marshalData(ResultSet results) {
362         Map<String, HashMap<String, Object>> resultMap =
363                         new HashMap<>();
364         int counter = 0;
365         for (Row row : results) {
366             ColumnDefinitions colInfo = row.getColumnDefinitions();
367             HashMap<String, Object> resultOutput = new HashMap<>();
368             for (Definition definition : colInfo) {
369                 if (!(("vector_ts").equals(definition.getName()))) {
370                     if(definition.getType().toString().toLowerCase().contains("blob")) {
371                         resultOutput.put(definition.getName(),
372                                 getBlobValue(row, definition.getName(), definition.getType()));
373                     } else {
374                         resultOutput.put(definition.getName(),
375                                     getColValue(row, definition.getName(), definition.getType()));
376                     }
377                 }
378             }
379             resultMap.put("row " + counter, resultOutput);
380             counter++;
381         }
382         return resultMap;
383     }
384
385
386     // Prepared Statements 1802 additions
387     
388     public boolean executePut(PreparedQueryObject queryObject, String consistency)
389             throws MusicServiceException, MusicQueryException {
390         return executePut(queryObject, consistency, 0);
391     }
392     /**
393      * This Method performs DDL and DML operations on Cassandra using specified consistency level
394      *
395      * @param queryObject Object containing cassandra prepared query and values.
396      * @param consistency Specify consistency level for data synchronization across cassandra
397      *        replicas
398      * @return Boolean Indicates operation success or failure
399      * @throws MusicServiceException
400      * @throws MusicQueryException
401      */
402     public boolean executePut(PreparedQueryObject queryObject, String consistency,long timeSlot)
403                     throws MusicServiceException, MusicQueryException {
404
405         boolean result = false;
406         long timeOfWrite = System.currentTimeMillis();
407         if (!MusicUtil.isValidQueryObject(!queryObject.getValues().isEmpty(), queryObject)) {
408             logger.error(EELFLoggerDelegate.errorLogger, queryObject.getQuery(),AppMessages.QUERYERROR, ErrorSeverity.ERROR, ErrorTypes.QUERYERROR);
409             throw new MusicQueryException("Ill formed queryObject for the request = " + "["
410                             + queryObject.getQuery() + "]");
411         }
412         logger.debug(EELFLoggerDelegate.applicationLogger,
413                         "In preprared Execute Put: the actual insert query:"
414                                         + queryObject.getQuery() + "; the values"
415                                         + queryObject.getValues());
416         SimpleStatement preparedInsert = null;
417
418         try {
419             preparedInsert = new SimpleStatement(queryObject.getQuery(), queryObject.getValues().toArray());
420             if (consistency.equalsIgnoreCase(MusicUtil.CRITICAL)) {
421                 logger.info(EELFLoggerDelegate.applicationLogger, "Executing critical put query");
422                 preparedInsert.setConsistencyLevel(ConsistencyLevel.QUORUM);
423             } else if (consistency.equalsIgnoreCase(MusicUtil.EVENTUAL)) {
424                 logger.info(EELFLoggerDelegate.applicationLogger, "Executing simple put query");
425                 if(queryObject.getConsistency() == null)
426                     preparedInsert.setConsistencyLevel(ConsistencyLevel.ONE);
427                 else
428                     preparedInsert.setConsistencyLevel(MusicUtil.getConsistencyLevel(queryObject.getConsistency()));
429             } else if (consistency.equalsIgnoreCase(MusicUtil.ONE)) {
430                 preparedInsert.setConsistencyLevel(ConsistencyLevel.ONE);
431             }  else if (consistency.equalsIgnoreCase(MusicUtil.QUORUM)) {
432                 preparedInsert.setConsistencyLevel(ConsistencyLevel.LOCAL_QUORUM);
433             } else if (consistency.equalsIgnoreCase(MusicUtil.ALL)) {
434                 preparedInsert.setConsistencyLevel(ConsistencyLevel.ALL);
435             }
436             long timestamp = MusicUtil.v2sTimeStampInMicroseconds(timeSlot, timeOfWrite);
437             preparedInsert.setDefaultTimestamp(timestamp);
438
439             ResultSet rs = session.execute(preparedInsert);
440             result = rs.wasApplied();
441
442         }
443         catch (AlreadyExistsException ae) {
444             // logger.error(EELFLoggerDelegate.errorLogger,"AlreadExistsException: " + ae.getMessage(),AppMessages.QUERYERROR,
445             // ErrorSeverity.ERROR, ErrorTypes.QUERYERROR);
446             throw new MusicQueryException("AlreadyExistsException: " + ae.getMessage(),ae);
447         } catch ( InvalidQueryException e ) {
448             // logger.error(EELFLoggerDelegate.errorLogger,"InvalidQueryException: " + e.getMessage(),AppMessages.SESSIONFAILED + " [" 
449             // + queryObject.getQuery() + "]", ErrorSeverity.ERROR, ErrorTypes.QUERYERROR);
450             throw new MusicQueryException("InvalidQueryException: " + e.getMessage(),e);
451         } catch (Exception e) {
452             // logger.error(EELFLoggerDelegate.errorLogger,e.getClass().toString() + ":" + e.getMessage(),AppMessages.SESSIONFAILED + " [" 
453             //     + queryObject.getQuery() + "]", ErrorSeverity.ERROR, ErrorTypes.QUERYERROR, e);
454             throw new MusicServiceException("Executing Session Failure for Request = " + "["
455                 + queryObject.getQuery() + "]" + " Reason = " + e.getMessage(),e);
456         }
457         return result;
458     }
459
460  /*   *//**
461      * This method performs DDL operations on Cassandra using consistency level ONE.
462      *
463      * @param queryObject Object containing cassandra prepared query and values.
464      * @return ResultSet
465      * @throws MusicServiceException
466      * @throws MusicQueryException
467      *//*
468     public ResultSet executeEventualGet(PreparedQueryObject queryObject)
469                     throws MusicServiceException, MusicQueryException {
470         CacheAccess<String, PreparedStatement> queryBank = CachingUtil.getStatementBank();
471         PreparedStatement preparedEventualGet = null;
472         if (!MusicUtil.isValidQueryObject(!queryObject.getValues().isEmpty(), queryObject)) {
473             logger.error(EELFLoggerDelegate.errorLogger, "",AppMessages.QUERYERROR+ " [" + queryObject.getQuery() + "]", ErrorSeverity.ERROR, ErrorTypes.QUERYERROR);
474             throw new MusicQueryException("Ill formed queryObject for the request = " + "["
475                             + queryObject.getQuery() + "]");
476         }
477         logger.info(EELFLoggerDelegate.applicationLogger,
478                         "Executing Eventual  get query:" + queryObject.getQuery());
479
480         ResultSet results = null;
481         try {
482             if(queryBank.get(queryObject.getQuery()) != null )
483                 preparedEventualGet=queryBank.get(queryObject.getQuery());
484             else {
485                 preparedEventualGet = session.prepare(queryObject.getQuery());
486                 CachingUtil.updateStatementBank(queryObject.getQuery(), preparedEventualGet);
487             }
488             if(queryObject.getConsistency() == null) {
489                 preparedEventualGet.setConsistencyLevel(ConsistencyLevel.ONE);
490             } else {
491                 preparedEventualGet.setConsistencyLevel(MusicUtil.getConsistencyLevel(queryObject.getConsistency()));
492             }
493             results = session.execute(preparedEventualGet.bind(queryObject.getValues().toArray()));
494
495         } catch (Exception ex) {
496             logger.error("Exception", ex);
497             logger.error(EELFLoggerDelegate.errorLogger, ex.getMessage(),AppMessages.UNKNOWNERROR+ "[" + queryObject.getQuery() + "]", ErrorSeverity.ERROR, ErrorTypes.QUERYERROR);
498             throw new MusicServiceException(ex.getMessage());
499         }
500         return results;
501     }
502
503     *//**
504      *
505      * This method performs DDL operation on Cassandra using consistency level QUORUM.
506      *
507      * @param queryObject Object containing cassandra prepared query and values.
508      * @return ResultSet
509      * @throws MusicServiceException
510      * @throws MusicQueryException
511      *//*
512     public ResultSet executeCriticalGet(PreparedQueryObject queryObject)
513                     throws MusicServiceException, MusicQueryException {
514         if (!MusicUtil.isValidQueryObject(!queryObject.getValues().isEmpty(), queryObject)) {
515             logger.error(EELFLoggerDelegate.errorLogger, "",AppMessages.QUERYERROR+ " [" + queryObject.getQuery() + "]", ErrorSeverity.ERROR, ErrorTypes.QUERYERROR);
516             throw new MusicQueryException("Error processing Prepared Query Object for the request = " + "["
517                             + queryObject.getQuery() + "]");
518         }
519         logger.info(EELFLoggerDelegate.applicationLogger,
520                         "Executing Critical get query:" + queryObject.getQuery());
521         PreparedStatement preparedEventualGet = session.prepare(queryObject.getQuery());
522         preparedEventualGet.setConsistencyLevel(ConsistencyLevel.QUORUM);
523         ResultSet results = null;
524         try {
525             results = session.execute(preparedEventualGet.bind(queryObject.getValues().toArray()));
526         } catch (Exception ex) {
527             logger.error("Exception", ex);
528             logger.error(EELFLoggerDelegate.errorLogger, ex.getMessage(),AppMessages.UNKNOWNERROR+ "[" + queryObject.getQuery() + "]", ErrorSeverity.ERROR, ErrorTypes.QUERYERROR);
529             throw new MusicServiceException(ex.getMessage());
530         }
531         return results;
532
533     }
534     */
535     public ResultSet executeGet(PreparedQueryObject queryObject,String consistencyLevel) throws MusicQueryException, MusicServiceException {
536         if (!MusicUtil.isValidQueryObject(!queryObject.getValues().isEmpty(), queryObject)) {
537             logger.error(EELFLoggerDelegate.errorLogger, "",AppMessages.QUERYERROR+ " [" + queryObject.getQuery() + "]", ErrorSeverity.ERROR, ErrorTypes.QUERYERROR);
538             throw new MusicQueryException("Error processing Prepared Query Object for the request = " + "["
539                             + queryObject.getQuery() + "]");
540         }
541         ResultSet results = null;
542         try {
543             SimpleStatement statement = new SimpleStatement(queryObject.getQuery(), queryObject.getValues().toArray());
544
545             if (consistencyLevel.equalsIgnoreCase(CONSISTENCY_LEVEL_ONE)) {
546                 if(queryObject.getConsistency() == null) {
547                     statement.setConsistencyLevel(ConsistencyLevel.ONE);
548                 } else {
549                     statement.setConsistencyLevel(MusicUtil.getConsistencyLevel(queryObject.getConsistency()));
550                 }
551             }
552             else if (consistencyLevel.equalsIgnoreCase(CONSISTENCY_LEVEL_QUORUM)) {
553                 statement.setConsistencyLevel(ConsistencyLevel.QUORUM);
554             }
555
556             results = session.execute(statement);
557
558         } catch (Exception ex) {
559             logger.error(EELFLoggerDelegate.errorLogger, "Execute Get Error" + ex.getMessage(),AppMessages.UNKNOWNERROR+ "[" + queryObject
560                 .getQuery() + "]", ErrorSeverity.ERROR, ErrorTypes.QUERYERROR, ex);
561             throw new MusicServiceException("Execute Get Error" + ex.getMessage());
562         }
563         
564         return results;
565         
566     }
567     
568     /**
569      * This method performs DDL operations on Cassandra using consistency level ONE.
570      * 
571      * @param queryObject Object containing cassandra prepared query and values.
572      */
573     public ResultSet executeOneConsistencyGet(PreparedQueryObject queryObject)
574                     throws MusicServiceException, MusicQueryException {
575         return executeGet(queryObject, CONSISTENCY_LEVEL_ONE);
576     }
577
578     /**
579      * 
580      * This method performs DDL operation on Cassandra using consistency level QUORUM.
581      * 
582      * @param queryObject Object containing cassandra prepared query and values.
583      */
584     public ResultSet executeQuorumConsistencyGet(PreparedQueryObject queryObject)
585                     throws MusicServiceException, MusicQueryException {
586         return executeGet(queryObject, CONSISTENCY_LEVEL_QUORUM);
587     }
588
589 }