예제 #1
0
    public void serialize(SliceQueryFilter f, DataOutputPlus out, int version) throws IOException {
      out.writeInt(f.slices.length);
      for (ColumnSlice slice : f.slices) type.sliceSerializer().serialize(slice, out, version);
      out.writeBoolean(f.reversed);
      int count = f.count;
      out.writeInt(count);

      out.writeInt(f.compositesToGroup);
    }
예제 #2
0
    public SliceQueryFilter deserialize(DataInput in, int version) throws IOException {
      ColumnSlice[] slices;
      slices = new ColumnSlice[in.readInt()];
      for (int i = 0; i < slices.length; i++)
        slices[i] = type.sliceSerializer().deserialize(in, version);
      boolean reversed = in.readBoolean();
      int count = in.readInt();
      int compositesToGroup = in.readInt();

      return new SliceQueryFilter(slices, reversed, count, compositesToGroup);
    }
예제 #3
0
    public long serializedSize(SliceQueryFilter f, int version) {
      TypeSizes sizes = TypeSizes.NATIVE;

      int size = 0;
      size += sizes.sizeof(f.slices.length);
      for (ColumnSlice slice : f.slices)
        size += type.sliceSerializer().serializedSize(slice, version);
      size += sizes.sizeof(f.reversed);
      size += sizes.sizeof(f.count);

      size += sizes.sizeof(f.compositesToGroup);
      return size;
    }