SingleFieldValueFilter.java 文件源码

java
阅读 21 收藏 0 点赞 0 评论 0

项目:gora-boot 作者:
@Override
public void write(DataOutput out) throws IOException {
  Text.writeString(out, fieldName);
  WritableUtils.writeEnum(out, filterOp);
  WritableUtils.writeVInt(out, operands.size());
  for (Object operand : operands) {
    if (operand instanceof String) {
      throw new IllegalStateException("Use Utf8 instead of String for operands");
    }
    if (operand instanceof Utf8) {
      operand = operand.toString();
    }
    if (operand instanceof Boolean) {
      ObjectWritable.writeObject(out, operand, Boolean.TYPE, conf);
    } else if (operand instanceof Character) {
      ObjectWritable.writeObject(out, operand, Character.TYPE, conf);
    } else if (operand instanceof Byte) {
      ObjectWritable.writeObject(out, operand, Byte.TYPE, conf);
    } else if (operand instanceof Short) {
      ObjectWritable.writeObject(out, operand, Short.TYPE, conf);
    } else if (operand instanceof Integer) {
      ObjectWritable.writeObject(out, operand, Integer.TYPE, conf);
    } else if (operand instanceof Long) {
      ObjectWritable.writeObject(out, operand, Long.TYPE, conf);
    } else if (operand instanceof Float) {
      ObjectWritable.writeObject(out, operand, Float.TYPE, conf);
    } else if (operand instanceof Double) {
      ObjectWritable.writeObject(out, operand, Double.TYPE, conf);
    } else if (operand instanceof Void) {
      ObjectWritable.writeObject(out, operand, Void.TYPE, conf);
    } else {
      ObjectWritable.writeObject(out, operand, operand.getClass(), conf);
    }
  }
  out.writeBoolean(filterIfMissing);
}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号