public static QuotaProtos.SpaceViolationPolicy
    toProtoViolationPolicy(final SpaceViolationPolicy policy) {
    switch (policy) {
      case DISABLE:
        return QuotaProtos.SpaceViolationPolicy.DISABLE;
      case NO_WRITES_COMPACTIONS:
        return QuotaProtos.SpaceViolationPolicy.NO_WRITES_COMPACTIONS;
      case NO_WRITES:
        return QuotaProtos.SpaceViolationPolicy.NO_WRITES;
      case NO_INSERTS:
        return QuotaProtos.SpaceViolationPolicy.NO_INSERTS;
    }
    throw new RuntimeException("Invalid SpaceViolationPolicy " + policy);
  }
Converts a client SpaceViolationPolicy to a protocol buffer SpaceViolationPolicy.
@param policy The client SpaceViolationPolicy object.
@return The corresponding protocol buffer SpaceViolationPolicy.
hbase-client/src/main/java/org/apache/hadoop/hbase/shaded/protobuf/ProtobufUtil.java