SuperRow<String, String, String, String> row = rows.getList().get(0); assertNotNull(row); assertEquals("testRangeSuperSlicesQuery2", row.getKey()); SuperSlice<String, String, String> slice = row.getSuperSlice(); assertNotNull(slice); for (SuperRow<String, String, String, String> row2 : rows) { assertNotNull(row2); slice = row2.getSuperSlice(); assertNotNull(slice); assertEquals(2, slice.getSuperColumns().size());
r.get().getByKey(mailbox).getSuperSlice();
.getByKey("testSuperMultigetSliceQueryKey0"); assertNotNull(row); assertEquals("testSuperMultigetSliceQueryKey0", row.getKey()); SuperSlice<String, String, String> slice = row.getSuperSlice(); assertNotNull(slice);
/** * When we add supercolumns, Gora keys are mapped to Cassandra partition keys only. * This is because we follow the Cassandra logic where column family data is * partitioned across nodes based on row Key. */ private void addSuperColumns(String family, CassandraQuery<K, T> cassandraQuery, CassandraResultSet<K> cassandraResultSet) { List<SuperRow<K, String, ByteBuffer, ByteBuffer>> superRows = this.cassandraClient.executeSuper(cassandraQuery, family); for (SuperRow<K, String, ByteBuffer, ByteBuffer> superRow: superRows) { K key = superRow.getKey(); CassandraRow<K> cassandraRow = cassandraResultSet.getRow(key); if (cassandraRow == null) { cassandraRow = new CassandraRow<K>(); cassandraResultSet.putRow(key, cassandraRow); cassandraRow.setKey(key); } SuperSlice<String, ByteBuffer, ByteBuffer> superSlice = superRow.getSuperSlice(); for (HSuperColumn<String, ByteBuffer, ByteBuffer> hSuperColumn: superSlice.getSuperColumns()) { CassandraSuperColumn cassandraSuperColumn = new CassandraSuperColumn(); cassandraSuperColumn.setValue(hSuperColumn); cassandraSuperColumn.setFamily(family); cassandraRow.add(cassandraSuperColumn); } } }