@Test(groups={"unit"}, expectedExceptions = HectorTransportException.class) public void testReadColumnValueAndTranslateHectorException() { when(executionResult.get()).thenThrow(new HectorTransportException("test hector exception")); superColumnFamilyTestDao.readColumnValue(rowKey, superColumnName, columnName); }
@Override public V readColumnValue(K rowKey, SN superColumnName, N columnName) { SubColumnQuery<K,SN,N,V> query = HFactory.createSubColumnQuery(getKeyspace(), getKeySerializer(), getSuperColumnNameSerializer(), getSubcolumnNameSerializer(), getValueSerializer()); QueryResult<HColumn<N,V>> result = query. setKey(rowKey). setColumnFamily(getColumnFamily()). setSuperColumn(superColumnName). setColumn(columnName). execute(); HColumn<N,V> column = result.get(); return column != null ? column.getValue() : null; }
SuperColumnFamilyTemplate extends AbstractColumnFamilyTemplate<K,SN,V> implements SuperColumnFamilyOperations<K,SN,N,V> { @Override public V readColumnValue(K rowKey, SN superColumnName, N columnName) { SubColumnQuery<K,SN,N,V> query = HFactory.createSubColumnQuery(getKeyspace(), getKeySerializer(), getSuperColumnNameSerializer(), getSubcolumnNameSerializer(), getValueSerializer()); QueryResult<HColumn<N,V>> result = query. setKey(rowKey). setColumnFamily(getColumnFamily()). setSuperColumn(superColumnName). setColumn(columnName). execute(); HColumn<N,V> column = result.get(); return column != null ? column.getValue() : null; } }
SuperColumnFamilyTemplate extends AbstractColumnFamilyTemplate<K,SN,V> implements SuperColumnFamilyOperations<K,SN,N,V> { @Override public V readColumnValue(K rowKey, SN superColumnName, N columnName) { SubColumnQuery<K,SN,N,V> query = HFactory.createSubColumnQuery(getKeyspace(), getKeySerializer(), getSuperColumnNameSerializer(), getSubcolumnNameSerializer(), getValueSerializer()); QueryResult<HColumn<N,V>> result = query. setKey(rowKey). setColumnFamily(getColumnFamily()). setSuperColumn(superColumnName). setColumn(columnName). execute(); HColumn<N,V> column = result.get(); return column != null ? column.getValue() : null; } SuperColumnFamilyTemplate(Keyspace keyspace,
                                     @Nullable String columnFamily,
                                     Serializer<K> keySerializer,
                                     Serializer<SN> supercolumnNameSerializer,
                                     Serializer<N> subcolumnNameSerializer,
                                     Serializer<V> valueSerializer); }
SuperColumnFamilyTemplate extends AbstractColumnFamilyTemplate<K,SN,V> implements SuperColumnFamilyOperations<K,SN,N,V> { @Override public V readColumnValue(K rowKey, SN superColumnName, N columnName) { SubColumnQuery<K,SN,N,V> query = HFactory.createSubColumnQuery(getKeyspace(), getKeySerializer(), getSuperColumnNameSerializer(), getSubcolumnNameSerializer(), getValueSerializer()); QueryResult<HColumn<N,V>> result = query. setKey(rowKey). setColumnFamily(getColumnFamily()). setSuperColumn(superColumnName). setColumn(columnName). execute(); HColumn<N,V> column = result.get(); return column != null ? column.getValue() : null; } SuperColumnFamilyTemplate(Keyspace keyspace,
                                     @Nullable String columnFamily,
                                     Serializer<K> keySerializer,
                                     Serializer<SN> supercolumnNameSerializer,
                                     Serializer<N> subcolumnNameSerializer,
                                     Serializer<V> valueSerializer); @Override V readColumnValue(K rowKey, SN superColumnName, N columnName); @Override Map<N,V> readColumnsAsMap(K rowKey, SN superColumnName, N... columnNames); @Override Map<N,V> readColumnsAsMap(K rowKey,
                                     SN superColumnName,
                                     N start,
                                     N finish,
                                     int count,
                                     boolean reversed); @Override List<T> readColumns(K rowKey, SN superColumnName, ColumnMapper<T,N,V> columnMapper); @Override List<T> readColumns(K rowKey,
                                   SN superColumnName,
                                   N start,
                                   N finish,
                                   int count,
                                   boolean reversed,
                                   ColumnMapper<T,N,V> columnMapper); @Override List<T> readColumnsWithTimestamps(K rowKey,
                                                 SN superColumnName,
                                                 N start,
                                                 N finish,
                                                 int count,
                                                 boolean reversed,
                                                 ColumnMapperWithTimestamps<T,N,V> columnMapper); @Override void visitColumns(K rowKey,
                                SN superColumnName,
                                N start,
                                N finish,
                                int count,
                                boolean reversed,
                                ColumnVisitor<N, V> columnVisitor); @Override Map<K,Map<N,V>> multiGetAsMap(Collection<K> rowKeys, SN superColumnName); @Override Map<K,Map<N,V>> multiGetColumnsAsMap(Collection<K> rowKeys, SN superColumnName, N... columnNames); @Override Map<K,List<T>> multiGetColumnRange(Iterable<K> rowKeys,
                                                   SN supercolumnName,
                                                   N start,
                                                   N finish,
                                                   int count,
                                                   boolean reversed,
                                                   ColumnMapper<T,N,V> columnMapper); @Override List<T> multiGetSuperColumn(Collection<K> rowKeys,
                                                 SN superColumnName,
                                                 SuperColumnMapper<T,K,SN,N,V> superColumnMapper); @Override List<T> multiGetAllSuperColumns(Collection<K> rowKeys, SuperColumnFamilyRowMapper<T,K,SN,N,V>
            superColumnFamilyRowMapper); @Override List<T> multiGetColumns(Collection<K> rowKeys,
                                             SN superColumnName,
                                             SuperColumnMapper<T,K,SN,N,V> superColumnMapper,
                                             N... columnNames); @Override Map<SN,Map<N,V>> readRowAsMap(K key); @Override List<T> readRow(K key, SuperColumnMapper<T,K,SN,N,V> superColumnMapper); @Override void writeColumns(K rowKey, SN superColumnName, Map<N,V> columnMap); @Override void writeColumns(K rowKey,
                                   SN superColumnName,
                                   Map<N,V> columnMap,
                                   @Nonnull BatchContext txnContext); @Override void writeColumn(K rowKey, SN superColumnName, N columnName, V columnValue); @Override void writeColumn(K rowKey,
                                  SN superColumnName,
                                  N columnName,
                                  V columnValue,
                                  @Nonnull BatchContext txnContext); @Override void deleteColumns(K rowKey, SN superColumnName, Iterable<N> subcolumnNames); @Override void deleteColumns(K rowKey,
                                    SN superColumnName,
                                    Iterable<N> subcolumnNames,
                                    @Nonnull BatchContext txnContext); @Override void deleteColumns(K rowKey, SN superColumnName, N start, N finish); @Override void deleteColumns(K rowKey, SN superColumnName, N start, N finish, @Nullable BatchContext batchContext); @Override void deleteSuperColumn(K rowKey, SN superColumnName); @Override void deleteSuperColumn(K rowKey, SN superColumnName, @Nonnull BatchContext txnContext); }
SuperColumnFamilyTemplate extends AbstractColumnFamilyTemplate<K,SN,V> implements SuperColumnFamilyOperations<K,SN,N,V> { @Override public V readColumnValue(K rowKey, SN superColumnName, N columnName) { SubColumnQuery<K,SN,N,V> query = HFactory.createSubColumnQuery(getKeyspace(), getKeySerializer(), getSuperColumnNameSerializer(), getSubcolumnNameSerializer(), getValueSerializer()); QueryResult<HColumn<N,V>> result = query. setKey(rowKey). setColumnFamily(getColumnFamily()). setSuperColumn(superColumnName). setColumn(columnName). execute(); HColumn<N,V> column = result.get(); return column != null ? column.getValue() : null; } SuperColumnFamilyTemplate(Keyspace keyspace,
                                     @Nullable String columnFamily,
                                     Serializer<K> keySerializer,
                                     Serializer<SN> supercolumnNameSerializer,
                                     Serializer<N> subcolumnNameSerializer,
                                     Serializer<V> valueSerializer); @Override V readColumnValue(K rowKey, SN superColumnName, N columnName); @Override Map<N,V> readColumnsAsMap(K rowKey, SN superColumnName, N... columnNames); @Override Map<N,V> readColumnsAsMap(K rowKey,
                                     SN superColumnName,
                                     N start,
                                     N finish,
                                     int count,
                                     boolean reversed); @Override List<T> readColumns(K rowKey, SN superColumnName, ColumnMapper<T,N,V> columnMapper); @Override List<T> readColumns(K rowKey,
                                   SN superColumnName,
                                   N start,
                                   N finish,
                                   int count,
                                   boolean reversed,
                                   ColumnMapper<T,N,V> columnMapper); @Override List<T> readColumnsWithTimestamps(K rowKey,
                                                 SN superColumnName,
                                                 N start,
                                                 N finish,
                                                 int count,
                                                 boolean reversed,
                                                 ColumnMapperWithTimestamps<T,N,V> columnMapper); @Override void visitColumns(K rowKey,
                                SN superColumnName,
                                N start,
                                N finish,
                                int count,
                                boolean reversed,
                                ColumnVisitor<N, V> columnVisitor); @Override Map<K,Map<N,V>> multiGetAsMap(Collection<K> rowKeys, SN superColumnName); @Override Map<K,Map<N,V>> multiGetColumnsAsMap(Collection<K> rowKeys, SN superColumnName, N... columnNames); @Override Map<K,List<T>> multiGetColumnRange(Iterable<K> rowKeys,
                                                   SN supercolumnName,
                                                   N start,
                                                   N finish,
                                                   int count,
                                                   boolean reversed,
                                                   ColumnMapper<T,N,V> columnMapper); @Override List<T> multiGetSuperColumn(Collection<K> rowKeys,
                                                 SN superColumnName,
                                                 SuperColumnMapper<T,K,SN,N,V> superColumnMapper); @Override List<T> multiGetAllSuperColumns(Collection<K> rowKeys, SuperColumnFamilyRowMapper<T,K,SN,N,V>
            superColumnFamilyRowMapper); @Override List<T> multiGetColumns(Collection<K> rowKeys,
                                             SN superColumnName,
                                             SuperColumnMapper<T,K,SN,N,V> superColumnMapper,
                                             N... columnNames); @Override Map<SN,Map<N,V>> readRowAsMap(K key); @Override List<T> readRow(K key, SuperColumnMapper<T,K,SN,N,V> superColumnMapper); @Override void writeColumns(K rowKey, SN superColumnName, Map<N,V> columnMap); @Override void writeColumns(K rowKey,
                                   SN superColumnName,
                                   Map<N,V> columnMap,
                                   @Nonnull BatchContext txnContext); @Override void writeColumn(K rowKey, SN superColumnName, N columnName, V columnValue); @Override void writeColumn(K rowKey,
                                  SN superColumnName,
                                  N columnName,
                                  V columnValue,
                                  @Nonnull BatchContext txnContext); @Override void deleteColumns(K rowKey, SN superColumnName, Iterable<N> subcolumnNames); @Override void deleteColumns(K rowKey,
                                    SN superColumnName,
                                    Iterable<N> subcolumnNames,
                                    @Nonnull BatchContext txnContext); @Override void deleteColumns(K rowKey, SN superColumnName, N start, N finish); @Override void deleteColumns(K rowKey, SN superColumnName, N start, N finish, @Nullable BatchContext batchContext); @Override void deleteSuperColumn(K rowKey, SN superColumnName); @Override void deleteSuperColumn(K rowKey, SN superColumnName, @Nonnull BatchContext txnContext);  }