List<CounterColumn> thriftCounterColumns = tf.getCounterColumns();
List<CounterSuperColumn> thriftCounterSuperColumns = tf.getCounterSuperColumns();
if (thriftCounterColumns != null && !thriftCounterColumns.isEmpty()) {
for (CounterColumn column : thriftCounterColumns) {
Mutation mut = new Mutation();
mut.setColumn_or_supercolumn(new ColumnOrSuperColumn().setCounter_column(column));
mutationList.add(mut);
}
}
if (thriftCounterSuperColumns != null && !thriftCounterSuperColumns.isEmpty()) {
for (CounterSuperColumn sc : thriftCounterSuperColumns) {
Mutation mut = new Mutation();
mut.setColumn_or_supercolumn(new ColumnOrSuperColumn().setCounter_super_column(sc));
mutationList.add(mut);
}
}
} else
/********* Handling for column family and super column family *********/
{
List<Column> thriftColumns = tf.getColumns();
List<SuperColumn> thriftSuperColumns = tf.getSuperColumns();
// Populate Insertion list for columns
if (thriftColumns != null && !thriftColumns.isEmpty()) {
for (Column column : thriftColumns) {
Mutation mut = new Mutation();
mut.setColumn_or_supercolumn(new ColumnOrSuperColumn().setColumn(column));
mutationList.add(mut);
}
}
// Populate Insertion list for super columns
if (thriftSuperColumns != null && !thriftSuperColumns.isEmpty()) {
for (SuperColumn superColumn : thriftSuperColumns) {
Mutation mut = new Mutation();
mut.setColumn_or_supercolumn(new ColumnOrSuperColumn().setSuper_column(superColumn));
mutationList.add(mut);
}
}
}
columnFamilyValues.put(columnFamily, mutationList);