Beispiel #1
0
  public void serialize(RangeSliceCommand sliceCommand, DataOutput dos, int version)
      throws IOException {
    dos.writeUTF(sliceCommand.keyspace);
    dos.writeUTF(sliceCommand.column_family);
    ByteBuffer sc = sliceCommand.super_column;
    dos.writeInt(sc == null ? 0 : sc.remaining());
    if (sc != null) ByteBufferUtil.write(sc, dos);

    TSerializer ser = new TSerializer(new TBinaryProtocol.Factory());
    FBUtilities.serialize(ser, sliceCommand.predicate, dos);

    if (version >= MessagingService.VERSION_11) {
      if (sliceCommand.row_filter == null) {
        dos.writeInt(0);
      } else {
        dos.writeInt(sliceCommand.row_filter.size());
        for (IndexExpression expr : sliceCommand.row_filter) FBUtilities.serialize(ser, expr, dos);
      }
    }
    AbstractBounds.serializer().serialize(sliceCommand.range, dos, version);
    dos.writeInt(sliceCommand.maxResults);
    if (version >= MessagingService.VERSION_11) {
      dos.writeBoolean(sliceCommand.maxIsColumns);
      dos.writeBoolean(sliceCommand.isPaging);
    }
  }
Beispiel #2
0
 public void serialize(IndexScanCommand o, DataOutput out, int version) throws IOException {
   out.writeUTF(o.keyspace);
   out.writeUTF(o.column_family);
   TSerializer ser = new TSerializer(new TBinaryProtocol.Factory());
   FBUtilities.serialize(ser, o.index_clause, out);
   FBUtilities.serialize(ser, o.predicate, out);
   AbstractBounds.serializer().serialize(o.range, out, version);
 }