if (tf.getColumnFamilyName().equals(metadata.getTableName()))
{
addRelationsToThriftRow(metadata, tf, rlHolders);
}
Mutator mutator = clientFactory.getMutator(pool);
if (metadata.isCounterColumnType())
{
if (log.isInfoEnabled())
{
log.info("Persisting counter column family record for row key {}", tf.getId());
}
List<CounterColumn> thriftCounterColumns = tf.getCounterColumns();
List<CounterSuperColumn> thriftCounterSuperColumns = tf.getCounterSuperColumns();
if (thriftCounterColumns != null && !thriftCounterColumns.isEmpty())
{
mutator.writeCounterColumns(tf.getColumnFamilyName(),
Bytes.fromByteBuffer(CassandraUtilities.toBytes(tf.getId(), tf.getId().getClass())),
Arrays.asList(tf.getCounterColumns().toArray(new CounterColumn[0])));
}
if (thriftCounterSuperColumns != null && !thriftCounterSuperColumns.isEmpty())
{
for (CounterSuperColumn sc : thriftCounterSuperColumns)
{
mutator.writeSubCounterColumns(
tf.getColumnFamilyName(),
Bytes.fromByteBuffer(CassandraUtilities.toBytes(tf.getId(), tf.getId().getClass())),
Bytes.fromByteArray(sc.getName()), sc.getColumns());
}
}
}
else
{
List<Column> thriftColumns = tf.getColumns();
List<SuperColumn> thriftSuperColumns = tf.getSuperColumns();
if (thriftColumns != null && !thriftColumns.isEmpty())
{
// Bytes.from
mutator.writeColumns(tf.getColumnFamilyName(),
Bytes.fromByteBuffer(CassandraUtilities.toBytes(tf.getId(), tf.getId().getClass())),
tf.getColumns());
}
if (thriftSuperColumns != null && !thriftSuperColumns.isEmpty())
{
for (SuperColumn sc : thriftSuperColumns)
{
if (log.isInfoEnabled())
{
log.info("Persisting super column family record for row key {}", tf.getId());
}
mutator.writeSubColumns(
tf.getColumnFamilyName(),
Bytes.fromByteBuffer(CassandraUtilities.toBytes(tf.getId(), tf.getId().getClass())),
Bytes.fromByteArray(sc.getName()), sc.getColumns());
}
}
}
mutator.execute(getConsistencyLevel());
}
tfRows = null;
if (isTtlPerRequest())
{
getTtlValues().clear();