public static void insertPostPopular(Post post, String type, Integer position) { try { String postId = post.getId(); IdNameEntity idNameEntity = post.getFrom(); String userId = idNameEntity.getId(); String userName = idNameEntity.getName(); String columnFamily = COLUMN_FAMILY_FACEBOOK_POST_POPULAR; String rowKey = (type + "-" + position); Clock clock = new Clock(System.nanoTime()); Column column = new Column(); String columnName = (postId + "-" + userId + "-" + userName); column.setName(columnName.getBytes(UTF8)); String columnValue = post.getMessage(); column.setValue(columnValue.getBytes(UTF8)); column.setTimestamp(clock.timestamp); cassandra.insertColumn(columnFamily, rowKey, column); } catch (UnsupportedEncodingException e) { logger.error("[Info: encoding invalid] - [Error: {}]", e.toString()); } }