@SuppressWarnings("unchecked")
  public static Filter toFilter(FilterProtos.Filter proto) throws IOException {
    String type = proto.getName();
    final byte[] value = proto.getSerializedFilter().toByteArray();

    try {
      Filter result = FILTERS.getAndCallByName(type, value);
      if (result != null) {
        return result;
      }

      if (!ALLOW_FAST_REFLECTION_FALLTHROUGH) {
        throw new IllegalStateException("Failed to deserialize comparator " + type
          + " because fast reflection returned null and fallthrough is disabled");
      }

      Class<?> c = Class.forName(type, true, ClassLoaderHolder.CLASS_LOADER);
      Method parseFrom = c.getMethod(PARSE_FROM, byte[].class);
      if (parseFrom == null) {
        throw new IOException("Unable to locate function: " + PARSE_FROM + " in type: " + type);
      }
      return (Filter) parseFrom.invoke(c, value);
    } catch (Exception e) {
      // Either we couldn't instantiate the method object, or "parseFrom" failed.
      // In either case, let's not retry.
      throw new DoNotRetryIOException(e);
    }
  }
Convert a protocol buffer Filter to a client Filter
@param proto the protocol buffer Filter to convert
@return the converted Filter
hbase-client/src/main/java/org/apache/hadoop/hbase/shaded/protobuf/ProtobufUtil.java