6555ea21bd06e0bc6b71800b4cf02f8e4f8f53d9
[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                         .withoutJMXReporting()
238                         .withPoolingOptions(poolingOptions)
239                         .addContactPoints(addresses).build();
240         }
241         
242         Metadata metadata = cluster.getMetadata();
243         logger.info(EELFLoggerDelegate.applicationLogger, "Connected to cassa cluster "
244                         + metadata.getClusterName() + " at " + address);
245         try {
246             session = cluster.connect();
247         } catch (Exception ex) {
248             logger.error(EELFLoggerDelegate.errorLogger, ex.getMessage(),AppMessages.CASSANDRACONNECTIVITY,
249                 ErrorSeverity.ERROR, ErrorTypes.SERVICEUNAVAILABLE, ex);
250             throw new MusicServiceException(
251                             "Error while connecting to Cassandra cluster.. " + ex.getMessage());
252         }
253     }
254
255     /**
256      *
257      * @param keyspace
258      * @param tableName
259      * @param columnName
260      * @return DataType
261      */
262     public DataType returnColumnDataType(String keyspace, String tableName, String columnName) {
263         KeyspaceMetadata ks = cluster.getMetadata().getKeyspace(keyspace);
264         TableMetadata table = ks.getTable(tableName);
265         return table.getColumn(columnName).getType();
266
267     }
268
269     /**
270      *
271      * @param keyspace
272      * @param tableName
273      * @return TableMetadata
274      */
275     public TableMetadata returnColumnMetadata(String keyspace, String tableName) {
276         KeyspaceMetadata ks = cluster.getMetadata().getKeyspace(keyspace);
277         return ks.getTable(tableName);
278     }
279     
280     /**
281     *
282     * @param keyspace
283     * @param tableName
284     * @return TableMetadata
285     */
286    public KeyspaceMetadata returnKeyspaceMetadata(String keyspace) {
287        return cluster.getMetadata().getKeyspace(keyspace);
288    }
289
290
291     /**
292      * Utility function to return the Java specific object type.
293      *
294      * @param row
295      * @param colName
296      * @param colType
297      * @return
298      */
299     public Object getColValue(Row row, String colName, DataType colType) {
300
301         switch (colType.getName()) {
302             case VARCHAR:
303                 return row.getString(colName);
304             case UUID:
305                 return row.getUUID(colName);
306             case VARINT:
307                 return row.getVarint(colName);
308             case BIGINT:
309                 return row.getLong(colName);
310             case INT:
311                 return row.getInt(colName);
312             case FLOAT:
313                 return row.getFloat(colName);
314             case DOUBLE:
315                 return row.getDouble(colName);
316             case BOOLEAN:
317                 return row.getBool(colName);
318             case MAP:
319                 return row.getMap(colName, String.class, String.class);
320             case LIST:
321                 return row.getList(colName, String.class);
322             default:
323                 return null;
324         }
325     }
326
327     public byte[] getBlobValue(Row row, String colName, DataType colType) {
328         ByteBuffer bb = row.getBytes(colName);
329         return bb.array();
330     }
331
332     public boolean doesRowSatisfyCondition(Row row, Map<String, Object> condition) throws Exception {
333         ColumnDefinitions colInfo = row.getColumnDefinitions();
334
335         for (Map.Entry<String, Object> entry : condition.entrySet()) {
336             String colName = entry.getKey();
337             DataType colType = colInfo.getType(colName);
338             Object columnValue = getColValue(row, colName, colType);
339             Object conditionValue = MusicUtil.convertToActualDataType(colType, entry.getValue());
340             if (columnValue.equals(conditionValue) == false)
341                 return false;
342         }
343         return true;
344     }
345
346     /**
347      * Utility function to store ResultSet values in to a MAP for output.
348      *
349      * @param results
350      * @return MAP
351      */
352     public Map<String, HashMap<String, Object>> marshalData(ResultSet results) {
353         Map<String, HashMap<String, Object>> resultMap =
354                         new HashMap<>();
355         int counter = 0;
356         for (Row row : results) {
357             ColumnDefinitions colInfo = row.getColumnDefinitions();
358             HashMap<String, Object> resultOutput = new HashMap<>();
359             for (Definition definition : colInfo) {
360                 if (!(("vector_ts").equals(definition.getName()))) {
361                     if(definition.getType().toString().toLowerCase().contains("blob")) {
362                         resultOutput.put(definition.getName(),
363                                 getBlobValue(row, definition.getName(), definition.getType()));
364                     } else {
365                         resultOutput.put(definition.getName(),
366                                     getColValue(row, definition.getName(), definition.getType()));
367                     }
368                 }
369             }
370             resultMap.put("row " + counter, resultOutput);
371             counter++;
372         }
373         return resultMap;
374     }
375
376
377     // Prepared Statements 1802 additions
378     
379     public boolean executePut(PreparedQueryObject queryObject, String consistency)
380             throws MusicServiceException, MusicQueryException {
381         return executePut(queryObject, consistency, 0);
382     }
383     /**
384      * This Method performs DDL and DML operations on Cassandra using specified consistency level
385      *
386      * @param queryObject Object containing cassandra prepared query and values.
387      * @param consistency Specify consistency level for data synchronization across cassandra
388      *        replicas
389      * @return Boolean Indicates operation success or failure
390      * @throws MusicServiceException
391      * @throws MusicQueryException
392      */
393     public boolean executePut(PreparedQueryObject queryObject, String consistency,long timeSlot)
394                     throws MusicServiceException, MusicQueryException {
395
396         boolean result = false;
397         long timeOfWrite = System.currentTimeMillis();
398         if (!MusicUtil.isValidQueryObject(!queryObject.getValues().isEmpty(), queryObject)) {
399             logger.error(EELFLoggerDelegate.errorLogger, queryObject.getQuery(),AppMessages.QUERYERROR, ErrorSeverity.ERROR, ErrorTypes.QUERYERROR);
400             throw new MusicQueryException("Ill formed queryObject for the request = " + "["
401                             + queryObject.getQuery() + "]");
402         }
403         logger.debug(EELFLoggerDelegate.applicationLogger,
404                         "In preprared Execute Put: the actual insert query:"
405                                         + queryObject.getQuery() + "; the values"
406                                         + queryObject.getValues());
407         SimpleStatement preparedInsert = null;
408
409         try {
410             preparedInsert = new SimpleStatement(queryObject.getQuery(), queryObject.getValues().toArray());
411             if (consistency.equalsIgnoreCase(MusicUtil.CRITICAL)) {
412                 logger.info(EELFLoggerDelegate.applicationLogger, "Executing critical put query");
413                 preparedInsert.setConsistencyLevel(ConsistencyLevel.QUORUM);
414             } else if (consistency.equalsIgnoreCase(MusicUtil.EVENTUAL)) {
415                 logger.info(EELFLoggerDelegate.applicationLogger, "Executing simple put query");
416                 if(queryObject.getConsistency() == null)
417                     preparedInsert.setConsistencyLevel(ConsistencyLevel.ONE);
418                 else
419                     preparedInsert.setConsistencyLevel(MusicUtil.getConsistencyLevel(queryObject.getConsistency()));
420             } else if (consistency.equalsIgnoreCase(MusicUtil.ONE)) {
421                 preparedInsert.setConsistencyLevel(ConsistencyLevel.ONE);
422             }  else if (consistency.equalsIgnoreCase(MusicUtil.QUORUM)) {
423                 preparedInsert.setConsistencyLevel(ConsistencyLevel.LOCAL_QUORUM);
424             } else if (consistency.equalsIgnoreCase(MusicUtil.ALL)) {
425                 preparedInsert.setConsistencyLevel(ConsistencyLevel.ALL);
426             }
427             long timestamp = MusicUtil.v2sTimeStampInMicroseconds(timeSlot, timeOfWrite);
428             preparedInsert.setDefaultTimestamp(timestamp);
429
430             ResultSet rs = session.execute(preparedInsert);
431             result = rs.wasApplied();
432
433         }
434         catch (AlreadyExistsException ae) {
435             // logger.error(EELFLoggerDelegate.errorLogger,"AlreadExistsException: " + ae.getMessage(),AppMessages.QUERYERROR,
436             // ErrorSeverity.ERROR, ErrorTypes.QUERYERROR);
437             throw new MusicQueryException("AlreadyExistsException: " + ae.getMessage(),ae);
438         } catch ( InvalidQueryException e ) {
439             // logger.error(EELFLoggerDelegate.errorLogger,"InvalidQueryException: " + e.getMessage(),AppMessages.SESSIONFAILED + " [" 
440             // + queryObject.getQuery() + "]", ErrorSeverity.ERROR, ErrorTypes.QUERYERROR);
441             throw new MusicQueryException("InvalidQueryException: " + e.getMessage(),e);
442         } catch (Exception e) {
443             // logger.error(EELFLoggerDelegate.errorLogger,e.getClass().toString() + ":" + e.getMessage(),AppMessages.SESSIONFAILED + " [" 
444             //     + queryObject.getQuery() + "]", ErrorSeverity.ERROR, ErrorTypes.QUERYERROR, e);
445             throw new MusicServiceException("Executing Session Failure for Request = " + "["
446                 + queryObject.getQuery() + "]" + " Reason = " + e.getMessage(),e);
447         }
448         return result;
449     }
450
451  /*   *//**
452      * This method performs DDL operations on Cassandra using consistency level ONE.
453      *
454      * @param queryObject Object containing cassandra prepared query and values.
455      * @return ResultSet
456      * @throws MusicServiceException
457      * @throws MusicQueryException
458      *//*
459     public ResultSet executeEventualGet(PreparedQueryObject queryObject)
460                     throws MusicServiceException, MusicQueryException {
461         CacheAccess<String, PreparedStatement> queryBank = CachingUtil.getStatementBank();
462         PreparedStatement preparedEventualGet = null;
463         if (!MusicUtil.isValidQueryObject(!queryObject.getValues().isEmpty(), queryObject)) {
464             logger.error(EELFLoggerDelegate.errorLogger, "",AppMessages.QUERYERROR+ " [" + queryObject.getQuery() + "]", ErrorSeverity.ERROR, ErrorTypes.QUERYERROR);
465             throw new MusicQueryException("Ill formed queryObject for the request = " + "["
466                             + queryObject.getQuery() + "]");
467         }
468         logger.info(EELFLoggerDelegate.applicationLogger,
469                         "Executing Eventual  get query:" + queryObject.getQuery());
470
471         ResultSet results = null;
472         try {
473             if(queryBank.get(queryObject.getQuery()) != null )
474                 preparedEventualGet=queryBank.get(queryObject.getQuery());
475             else {
476                 preparedEventualGet = session.prepare(queryObject.getQuery());
477                 CachingUtil.updateStatementBank(queryObject.getQuery(), preparedEventualGet);
478             }
479             if(queryObject.getConsistency() == null) {
480                 preparedEventualGet.setConsistencyLevel(ConsistencyLevel.ONE);
481             } else {
482                 preparedEventualGet.setConsistencyLevel(MusicUtil.getConsistencyLevel(queryObject.getConsistency()));
483             }
484             results = session.execute(preparedEventualGet.bind(queryObject.getValues().toArray()));
485
486         } catch (Exception ex) {
487             logger.error("Exception", ex);
488             logger.error(EELFLoggerDelegate.errorLogger, ex.getMessage(),AppMessages.UNKNOWNERROR+ "[" + queryObject.getQuery() + "]", ErrorSeverity.ERROR, ErrorTypes.QUERYERROR);
489             throw new MusicServiceException(ex.getMessage());
490         }
491         return results;
492     }
493
494     *//**
495      *
496      * This method performs DDL operation on Cassandra using consistency level QUORUM.
497      *
498      * @param queryObject Object containing cassandra prepared query and values.
499      * @return ResultSet
500      * @throws MusicServiceException
501      * @throws MusicQueryException
502      *//*
503     public ResultSet executeCriticalGet(PreparedQueryObject queryObject)
504                     throws MusicServiceException, MusicQueryException {
505         if (!MusicUtil.isValidQueryObject(!queryObject.getValues().isEmpty(), queryObject)) {
506             logger.error(EELFLoggerDelegate.errorLogger, "",AppMessages.QUERYERROR+ " [" + queryObject.getQuery() + "]", ErrorSeverity.ERROR, ErrorTypes.QUERYERROR);
507             throw new MusicQueryException("Error processing Prepared Query Object for the request = " + "["
508                             + queryObject.getQuery() + "]");
509         }
510         logger.info(EELFLoggerDelegate.applicationLogger,
511                         "Executing Critical get query:" + queryObject.getQuery());
512         PreparedStatement preparedEventualGet = session.prepare(queryObject.getQuery());
513         preparedEventualGet.setConsistencyLevel(ConsistencyLevel.QUORUM);
514         ResultSet results = null;
515         try {
516             results = session.execute(preparedEventualGet.bind(queryObject.getValues().toArray()));
517         } catch (Exception ex) {
518             logger.error("Exception", ex);
519             logger.error(EELFLoggerDelegate.errorLogger, ex.getMessage(),AppMessages.UNKNOWNERROR+ "[" + queryObject.getQuery() + "]", ErrorSeverity.ERROR, ErrorTypes.QUERYERROR);
520             throw new MusicServiceException(ex.getMessage());
521         }
522         return results;
523
524     }
525     */
526     public ResultSet executeGet(PreparedQueryObject queryObject,String consistencyLevel) throws MusicQueryException, MusicServiceException {
527         if (!MusicUtil.isValidQueryObject(!queryObject.getValues().isEmpty(), queryObject)) {
528             logger.error(EELFLoggerDelegate.errorLogger, "",AppMessages.QUERYERROR+ " [" + queryObject.getQuery() + "]", ErrorSeverity.ERROR, ErrorTypes.QUERYERROR);
529             throw new MusicQueryException("Error processing Prepared Query Object for the request = " + "["
530                             + queryObject.getQuery() + "]");
531         }
532         ResultSet results = null;
533         try {
534             SimpleStatement statement = new SimpleStatement(queryObject.getQuery(), queryObject.getValues().toArray());
535
536             if (consistencyLevel.equalsIgnoreCase(CONSISTENCY_LEVEL_ONE)) {
537                 if(queryObject.getConsistency() == null) {
538                     statement.setConsistencyLevel(ConsistencyLevel.ONE);
539                 } else {
540                     statement.setConsistencyLevel(MusicUtil.getConsistencyLevel(queryObject.getConsistency()));
541                 }
542             }
543             else if (consistencyLevel.equalsIgnoreCase(CONSISTENCY_LEVEL_QUORUM)) {
544                 statement.setConsistencyLevel(ConsistencyLevel.QUORUM);
545             }
546
547             results = session.execute(statement);
548
549         } catch (Exception ex) {
550             logger.error(EELFLoggerDelegate.errorLogger, "Execute Get Error" + ex.getMessage(),AppMessages.UNKNOWNERROR+ "[" + queryObject
551                 .getQuery() + "]", ErrorSeverity.ERROR, ErrorTypes.QUERYERROR, ex);
552             throw new MusicServiceException("Execute Get Error" + ex.getMessage());
553         }
554         
555         return results;
556         
557     }
558     
559     /**
560      * This method performs DDL operations on Cassandra using consistency level ONE.
561      * 
562      * @param queryObject Object containing cassandra prepared query and values.
563      */
564     public ResultSet executeOneConsistencyGet(PreparedQueryObject queryObject)
565                     throws MusicServiceException, MusicQueryException {
566         return executeGet(queryObject, CONSISTENCY_LEVEL_ONE);
567     }
568
569     /**
570      * 
571      * This method performs DDL operation on Cassandra using consistency level QUORUM.
572      * 
573      * @param queryObject Object containing cassandra prepared query and values.
574      */
575     public ResultSet executeQuorumConsistencyGet(PreparedQueryObject queryObject)
576                     throws MusicServiceException, MusicQueryException {
577         return executeGet(queryObject, CONSISTENCY_LEVEL_QUORUM);
578     }
579
580 }