private V deserialize(RefCountedMemory mem) {
   try {
     return serializer.deserialize(new EncodedDataInputStream(new MemoryInputStream(mem)));
   } catch (IOException e) {
     logger.debug("Cannot fetch in memory data, we will failback to read from disk ", e);
     return null;
   }
 }
 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);
 }