code: public int countColumns(K key, N start, N end, int max) {
      CountQuery<K, N> query = HFactory.createCountQuery(keyspace, keySerializer,
          topSerializer);
      query.setKey(key);
      query.setColumnFamily(columnFamily);
      query.setRange(start, end, max);
      return query.execute().get();
    }
docs: Counts columns in the specified range of a standard column family
  
  @param key
  @param start
  @param end
  @param max
  @return