コード例 #1
0
  private String getSlicesInfo(ColumnFamily container) {
    StringBuilder sb = new StringBuilder();
    CellNameType type = container.metadata().comparator;
    for (ColumnSlice sl : slices) {
      assert sl != null;

      sb.append('[');
      sb.append(type.getString(sl.start));
      sb.append('-');
      sb.append(type.getString(sl.finish));
      sb.append(']');
    }
    return sb.toString();
  }
コード例 #2
0
 public long serializedSize(NamesQueryFilter f, int version) {
   TypeSizes sizes = TypeSizes.NATIVE;
   int size = sizes.sizeof(f.columns.size());
   ISerializer<CellName> serializer = type.cellSerializer();
   for (CellName cName : f.columns) size += serializer.serializedSize(cName, sizes);
   size += sizes.sizeof(f.countCQL3Rows);
   return size;
 }
コード例 #3
0
 public NamesQueryFilter deserialize(DataInput in, int version) throws IOException {
   int size = in.readInt();
   SortedSet<CellName> columns = new TreeSet<CellName>(type);
   ISerializer<CellName> serializer = type.cellSerializer();
   for (int i = 0; i < size; ++i) columns.add(serializer.deserialize(in));
   boolean countCQL3Rows = in.readBoolean();
   return new NamesQueryFilter(columns, countCQL3Rows);
 }
コード例 #4
0
 public void serialize(NamesQueryFilter f, DataOutputPlus out, int version) throws IOException {
   out.writeInt(f.columns.size());
   ISerializer<CellName> serializer = type.cellSerializer();
   for (CellName cName : f.columns) {
     serializer.serialize(cName, out);
   }
   out.writeBoolean(f.countCQL3Rows);
 }
コード例 #5
0
 @Override
 public String getString(CellNameType comparator) {
   return String.format(
       "%s:%s@%d", comparator.getString(name()), ByteBufferUtil.toLong(value), timestamp());
 }
コード例 #6
0
 public boolean countCQL3Rows(CellNameType comparator) {
   // If comparator is dense a cell == a CQL3 rows so we're always counting CQL3 rows
   // in particular. Otherwise, we do so only if we group the cells into CQL rows.
   return comparator.isDense() || compositesToGroup >= 0;
 }
コード例 #7
0
 public Comparator<Cell> getColumnComparator(CellNameType comparator) {
   return reversed ? comparator.columnReverseComparator() : comparator.columnComparator(false);
 }
コード例 #8
0
 public Comparator<Cell> getColumnComparator(CellNameType comparator) {
   return comparator.columnComparator(false);
 }