conn = pool.borrowObject(keyspace); Cassandra.Client client = conn.getClient(); Map<ByteBuffer, List<ColumnOrSuperColumn>> rows = client.multiget_slice(CassandraHelper.convert(keys), parent, predicate,
@Override public Map<ByteBuffer, List<Column>> execute(Cassandra.Client cassandra) throws HectorException { try { Map<ByteBuffer, List<ColumnOrSuperColumn>> cfmap = cassandra.multiget_slice( keys, columnParent, predicate, getThriftCl(OperationType.READ)); Map<ByteBuffer, List<Column>> result = new HashMap<ByteBuffer, List<Column>>(); for (Map.Entry<ByteBuffer, List<ColumnOrSuperColumn>> entry : cfmap.entrySet()) { result.put(entry.getKey(), getColumnList(entry.getValue())); } return result; } catch (Exception e) { throw xtrans.translate(e); } } };
@Override public Map<ByteBuffer, List<CounterColumn>> execute(Cassandra.Client cassandra) throws HectorException { try { Map<ByteBuffer, List<ColumnOrSuperColumn>> cfmap = cassandra.multiget_slice( keys, columnParent, predicate, getThriftCl(OperationType.READ)); Map<ByteBuffer, List<CounterColumn>> result = new HashMap<ByteBuffer, List<CounterColumn>>(); for (Map.Entry<ByteBuffer, List<ColumnOrSuperColumn>> entry : cfmap.entrySet()) { result.put(entry.getKey(), getCounterColumnList(entry.getValue())); } return result; } catch (Exception e) { throw xtrans.translate(e); } } };
@Override public Map<ByteBuffer, List<CounterColumn>> execute(Cassandra.Client cassandra) throws HectorException { try { Map<ByteBuffer, List<ColumnOrSuperColumn>> cfmap = cassandra.multiget_slice( keys, columnParent, predicate, getThriftCl(OperationType.READ)); Map<ByteBuffer, List<CounterColumn>> result = new HashMap<ByteBuffer, List<CounterColumn>>(); for (Map.Entry<ByteBuffer, List<ColumnOrSuperColumn>> entry : cfmap.entrySet()) { result.put(entry.getKey(), getCounterColumnList(entry.getValue())); } return result; } catch (Exception e) { throw xtrans.translate(e); } } };
@Override public Map<ByteBuffer, List<Column>> execute(Cassandra.Client cassandra) throws HectorException { try { Map<ByteBuffer, List<ColumnOrSuperColumn>> cfmap = cassandra.multiget_slice( keys, columnParent, predicate, getThriftCl(OperationType.READ)); Map<ByteBuffer, List<Column>> result = new HashMap<ByteBuffer, List<Column>>(); for (Map.Entry<ByteBuffer, List<ColumnOrSuperColumn>> entry : cfmap.entrySet()) { result.put(entry.getKey(), getColumnList(entry.getValue())); } return result; } catch (Exception e) { throw xtrans.translate(e); } } };
@Override public Map<ByteBuffer, List<Column>> execute(Cassandra.Client cassandra) throws HectorException { try { Map<ByteBuffer, List<ColumnOrSuperColumn>> cfmap = cassandra.multiget_slice( keys, columnParent, predicate, getThriftCl(OperationType.READ)); Map<ByteBuffer, List<Column>> result = new HashMap<ByteBuffer, List<Column>>(); for (Map.Entry<ByteBuffer, List<ColumnOrSuperColumn>> entry : cfmap.entrySet()) { result.put(entry.getKey(), getColumnList(entry.getValue())); } return result; } catch (Exception e) { throw xtrans.translate(e); } } };
@Override public Map<ByteBuffer,List<ColumnOrSuperColumn>> execute(Cassandra.Client cassandra) throws HectorException { Map<ByteBuffer,List<ColumnOrSuperColumn>> cosc; try { List<ByteBuffer> sKeys = keySerializer.toBytesList(keys); cosc = cassandra.multiget_slice(sKeys, workingColumnParent, workingSlicePredicate.toThrift(), ThriftConverter.consistencyLevel(consistencyLevelPolicy.get(operationType))); } catch (Exception e) { throw exceptionsTranslator.translate(e); } return cosc; } });
@Override public Map<ByteBuffer,List<ColumnOrSuperColumn>> execute(Cassandra.Client cassandra) throws HectorException { try { List<K> keyList = new ArrayList<K>(); Iterators.addAll(keyList, keys.iterator()); return cassandra.multiget_slice(keySerializer.toBytesList(keyList), columnParent, (workingSlicePredicate == null ? activeSlicePredicate.setColumnNames(columnValueSerializers.keySet()).toThrift() : workingSlicePredicate.toThrift()), ThriftConverter.consistencyLevel(consistencyLevelPolicy.get(operationType, columnFamily))); } catch (Exception e) { throw exceptionsTranslator.translate(e); } } });
@Override public Map<ByteBuffer,List<ColumnOrSuperColumn>> execute(Cassandra.Client cassandra) throws HectorException { Map<ByteBuffer,List<ColumnOrSuperColumn>> cosc; try { List<ByteBuffer> sKeys = keySerializer.toBytesList(keys); cosc = cassandra.multiget_slice(sKeys, workingColumnParent, workingSlicePredicate.toThrift(), ThriftConverter.consistencyLevel(consistencyLevelPolicy.get(operationType))); } catch (Exception e) { throw exceptionsTranslator.translate(e); } return cosc; } });
@Override public Map<ByteBuffer,List<ColumnOrSuperColumn>> execute(Cassandra.Client cassandra) throws HectorException { try { List<K> keyList = new ArrayList<K>(); Iterators.addAll(keyList, keys.iterator()); return cassandra.multiget_slice(keySerializer.toBytesList(keyList), columnParent, (workingSlicePredicate == null ? activeSlicePredicate.setColumnNames(columnValueSerializers.keySet()).toThrift() : workingSlicePredicate.toThrift()), ThriftConverter.consistencyLevel(consistencyLevelPolicy.get(operationType, columnFamily))); } catch (Exception e) { throw exceptionsTranslator.translate(e); } } });
@Override public Map<ByteBuffer, List<ColumnOrSuperColumn>> multiget_slice( List<ByteBuffer> keys, ColumnParent column_parent, SlicePredicate predicate, ConsistencyLevel consistency_level) throws InvalidRequestException, UnavailableException, TimedOutException, TException { return client.multiget_slice(keys, column_parent, predicate, consistency_level); }
@Override public Map<ByteBuffer, List<ColumnOrSuperColumn>> multiget_slice( String kvsMethodName, TableReference tableRef, List<ByteBuffer> keys, SlicePredicate predicate, ConsistencyLevel consistency_level) throws InvalidRequestException, UnavailableException, TimedOutException, TException { ColumnParent colFam = getColumnParent(tableRef); return executeHandlingExceptions(() -> client.multiget_slice(keys, colFam, predicate, consistency_level)); }
@Override public Map<ByteBuffer, List<ColumnOrSuperColumn>> multiget_slice( List<ByteBuffer> keys, ColumnParent column_parent, SlicePredicate predicate, ConsistencyLevel consistency_level) throws InvalidRequestException, UnavailableException, TimedOutException, TException { return client.multiget_slice(keys, column_parent, predicate, consistency_level); }
throws HectorException { try { Map<ByteBuffer, List<ColumnOrSuperColumn>> cfmap = cassandra.multiget_slice( keys, columnParent, predicate, getThriftCl(OperationType.READ));
throws HectorException { try { Map<ByteBuffer, List<ColumnOrSuperColumn>> cfmap = cassandra.multiget_slice( keys, columnParent, predicate, getThriftCl(OperationType.READ));
@Override public Column execute(Cassandra.Client cassandra) throws HectorException { try { if ( queryLogger.isDebugEnabled() ) { queryLogger.debug("---------\nColumnFamily multiget: {} slicePredicate: {}", columnFamilyName, activeSlicePredicate.toString()); } rows = cassandra.multiget_slice(keySerializer.toBytesList(_keys), columnParent, activeSlicePredicate.toThrift(), ThriftConverter.consistencyLevel(consistencyLevelPolicy.get(operationType))); applyResultStatus(execTime, getCassandraHost()); if ( queryLogger.isDebugEnabled() ) { queryLogger.debug("Execution took {} microseconds on host {}\n----------", lastExecutionTime, lastHostUsed); } } catch (Exception e) { throw exceptionsTranslator.translate(e); } hasValues = true; return null; } });
@Override public Map<ByteBuffer,List<ColumnOrSuperColumn>> execute(Cassandra.Client cassandra) throws HectorException { Map<ByteBuffer,List<ColumnOrSuperColumn>> cosc; try { List<ByteBuffer> sKeys = keySerializer.toBytesList(keys); cosc = cassandra.multiget_slice(sKeys, workingColumnParent, workingSlicePredicate.toThrift(), ThriftConverter.consistencyLevel(consistencyLevelPolicy.get(operationType))); } catch (Exception e) { throw exceptionsTranslator.translate(e); } return cosc; } });
@Override public Map<ByteBuffer,List<ColumnOrSuperColumn>> execute(Cassandra.Client cassandra) throws HectorException { try { List<K> keyList = new ArrayList<K>(); Iterators.addAll(keyList, keys.iterator()); return cassandra.multiget_slice(keySerializer.toBytesList(keyList), columnParent, (workingSlicePredicate == null ? activeSlicePredicate.setColumnNames(columnValueSerializers.keySet()).toThrift() : workingSlicePredicate.toThrift()), ThriftConverter.consistencyLevel(consistencyLevelPolicy.get(operationType, columnFamily))); } catch (Exception e) { throw exceptionsTranslator.translate(e); } } });
@Override public Map<ByteBuffer, List<ColumnOrSuperColumn>> multiget_slice( List<ByteBuffer> keys, ColumnParent column_parent, SlicePredicate predicate, ConsistencyLevel consistency_level) throws InvalidRequestException, UnavailableException, TimedOutException, TException { return client.multiget_slice(keys, column_parent, predicate, consistency_level); }
@Override public Map<ByteBuffer, List<ColumnOrSuperColumn>> multiget_slice( String kvsMethodName, TableReference tableRef, List<ByteBuffer> keys, SlicePredicate predicate, ConsistencyLevel consistency_level) throws InvalidRequestException, UnavailableException, TimedOutException, TException { ColumnParent colFam = getColumnParent(tableRef); return executeHandlingExceptions(() -> client.multiget_slice(keys, colFam, predicate, consistency_level)); }