@Override public <T> T execute(final String query, Object connection) { Session session = factory.getConnection(); try { Statement queryStmt = new SimpleStatement(query); KunderaCoreUtils.printQuery(query, showQuery); queryStmt.setConsistencyLevel(ConsistencyLevel.valueOf(this.consistencyLevel.name())); return (T) session.execute(queryStmt); } catch (Exception e) { log.error("Error while executing query {}.", query); throw new KunderaException(e); } finally { // factory.releaseConnection(session); } }
boundStatement.setConsistencyLevel(ConsistencyLevel.valueOf(this.consistencyLevel.name()));
Joiner.on(";").withKeyValueSeparator(":").join(mutationEntry.getValue())); traceParameters.put("consistency_level", consistency_level.name()); Tracing.instance.begin("batch_mutate", traceParameters);
Joiner.on(";").withKeyValueSeparator(":").join(mutationEntry.getValue())); traceParameters.put("consistency_level", consistency_level.name()); Tracing.instance.begin("atomic_batch_mutate", traceParameters);
Joiner.on(";").withKeyValueSeparator(":").join(mutationEntry.getValue())); traceParameters.put("consistency_level", consistency_level.name()); Tracing.instance.begin("atomic_batch_mutate", traceParameters);
public void remove(ByteBuffer key, ColumnPath column_path, long timestamp, ConsistencyLevel consistency_level) throws InvalidRequestException, UnavailableException, TimedOutException { long queryStartNanoTime = System.nanoTime(); if (startSessionIfRequested()) { Map<String, String> traceParameters = ImmutableMap.of("key", ByteBufferUtil.bytesToHex(key), "column_path", column_path.toString(), "timestamp", timestamp + "", "consistency_level", consistency_level.name()); Tracing.instance.begin("remove", traceParameters); } else { logger.trace("remove"); } try { internal_remove(key, column_path, timestamp, consistency_level, false, queryStartNanoTime); } catch (RequestValidationException e) { throw ThriftConversion.toThrift(e); } finally { Tracing.instance.stopSession(); } }
public void remove(ByteBuffer key, ColumnPath column_path, long timestamp, ConsistencyLevel consistency_level) throws InvalidRequestException, UnavailableException, TimedOutException { long queryStartNanoTime = System.nanoTime(); if (startSessionIfRequested()) { Map<String, String> traceParameters = ImmutableMap.of("key", ByteBufferUtil.bytesToHex(key), "column_path", column_path.toString(), "timestamp", timestamp + "", "consistency_level", consistency_level.name()); Tracing.instance.begin("remove", traceParameters); } else { logger.trace("remove"); } try { internal_remove(key, column_path, timestamp, consistency_level, false, queryStartNanoTime); } catch (RequestValidationException e) { throw ThriftConversion.toThrift(e); } finally { Tracing.instance.stopSession(); } }
Joiner.on(";").withKeyValueSeparator(":").join(mutationEntry.getValue())); traceParameters.put("consistency_level", consistency_level.name()); Tracing.instance.begin("atomic_batch_mutate", traceParameters);
public void remove_counter(ByteBuffer key, ColumnPath path, ConsistencyLevel consistency_level) throws InvalidRequestException, UnavailableException, TimedOutException, TException { long queryStartNanoTime = System.nanoTime(); if (startSessionIfRequested()) { Map<String, String> traceParameters = ImmutableMap.of("key", ByteBufferUtil.bytesToHex(key), "column_path", path.toString(), "consistency_level", consistency_level.name()); Tracing.instance.begin("remove_counter", traceParameters); } else { logger.trace("remove_counter"); } try { internal_remove(key, path, FBUtilities.timestampMicros(), consistency_level, true, queryStartNanoTime); } catch (RequestValidationException e) { throw ThriftConversion.toThrift(e); } finally { Tracing.instance.stopSession(); } }
public void insert(ByteBuffer key, ColumnParent column_parent, Column column, ConsistencyLevel consistency_level) throws InvalidRequestException, UnavailableException, TimedOutException { long queryStartNanoTime = System.nanoTime(); if (startSessionIfRequested()) { Map<String, String> traceParameters = ImmutableMap.of("key", ByteBufferUtil.bytesToHex(key), "column_parent", column_parent.toString(), "column", column.toString(), "consistency_level", consistency_level.name()); Tracing.instance.begin("insert", traceParameters); } else { logger.trace("insert"); } try { internal_insert(key, column_parent, column, consistency_level, queryStartNanoTime); } catch (RequestValidationException e) { throw ThriftConversion.toThrift(e); } finally { Tracing.instance.stopSession(); } }
public void insert(ByteBuffer key, ColumnParent column_parent, Column column, ConsistencyLevel consistency_level) throws InvalidRequestException, UnavailableException, TimedOutException { long queryStartNanoTime = System.nanoTime(); if (startSessionIfRequested()) { Map<String, String> traceParameters = ImmutableMap.of("key", ByteBufferUtil.bytesToHex(key), "column_parent", column_parent.toString(), "column", column.toString(), "consistency_level", consistency_level.name()); Tracing.instance.begin("insert", traceParameters); } else { logger.trace("insert"); } try { internal_insert(key, column_parent, column, consistency_level, queryStartNanoTime); } catch (RequestValidationException e) { throw ThriftConversion.toThrift(e); } finally { Tracing.instance.stopSession(); } }
public void remove_counter(ByteBuffer key, ColumnPath path, ConsistencyLevel consistency_level) throws InvalidRequestException, UnavailableException, TimedOutException, TException { long queryStartNanoTime = System.nanoTime(); if (startSessionIfRequested()) { Map<String, String> traceParameters = ImmutableMap.of("key", ByteBufferUtil.bytesToHex(key), "column_path", path.toString(), "consistency_level", consistency_level.name()); Tracing.instance.begin("remove_counter", traceParameters); } else { logger.trace("remove_counter"); } try { internal_remove(key, path, FBUtilities.timestampMicros(), consistency_level, true, queryStartNanoTime); } catch (RequestValidationException e) { throw ThriftConversion.toThrift(e); } finally { Tracing.instance.stopSession(); } }
"column_parent", column_parent.toString(), "predicate", predicate.toString(), "consistency_level", consistency_level.name()); Tracing.instance.begin("multiget_slice", traceParameters);
"column_parent", column_parent.toString(), "predicate", predicate.toString(), "consistency_level", consistency_level.name()); Tracing.instance.begin("multiget_slice", traceParameters);
public void remove_counter(ByteBuffer key, ColumnPath path, ConsistencyLevel consistency_level) throws InvalidRequestException, UnavailableException, TimedOutException, TException { if (startSessionIfRequested()) { Map<String, String> traceParameters = ImmutableMap.of("key", ByteBufferUtil.bytesToHex(key), "column_path", path.toString(), "consistency_level", consistency_level.name()); Tracing.instance.begin("remove_counter", traceParameters); } else { logger.debug("remove_counter"); } try { internal_remove(key, path, System.currentTimeMillis(), consistency_level, true); } catch (RequestValidationException e) { throw ThriftConversion.toThrift(e); } finally { Tracing.instance.stopSession(); } }
"column_parent", column_parent.toString(), "predicate", predicate.toString(), "consistency_level", consistency_level.name()); Tracing.instance.begin("get_slice", traceParameters);
"column_parent", column_parent.toString(), "predicate", predicate.toString(), "consistency_level", consistency_level.name()); Tracing.instance.begin("get_slice", traceParameters);
public void remove(ByteBuffer key, ColumnPath column_path, long timestamp, ConsistencyLevel consistency_level) throws InvalidRequestException, UnavailableException, TimedOutException { if (startSessionIfRequested()) { Map<String, String> traceParameters = ImmutableMap.of("key", ByteBufferUtil.bytesToHex(key), "column_path", column_path.toString(), "timestamp", timestamp + "", "consistency_level", consistency_level.name()); Tracing.instance.begin("remove", traceParameters); } else { logger.debug("remove"); } try { internal_remove(key, column_path, timestamp, consistency_level, false); } catch (RequestValidationException e) { throw ThriftConversion.toThrift(e); } finally { Tracing.instance.stopSession(); } }
public void insert(ByteBuffer key, ColumnParent column_parent, Column column, ConsistencyLevel consistency_level) throws InvalidRequestException, UnavailableException, TimedOutException { if (startSessionIfRequested()) { Map<String, String> traceParameters = ImmutableMap.of("key", ByteBufferUtil.bytesToHex(key), "column_parent", column_parent.toString(), "column", column.toString(), "consistency_level", consistency_level.name()); Tracing.instance.begin("insert", traceParameters); } else { logger.debug("insert"); } try { internal_insert(key, column_parent, column, consistency_level); } catch (RequestValidationException e) { throw ThriftConversion.toThrift(e); } finally { Tracing.instance.stopSession(); } }
"consistency_level", cLevel.name()));