org.elasticsearch.hadoop.serialization.Generator.writeString()方法的使用及代码示例

x33g5p2x  于2022-01-20 转载在 其他  
字(5.5k)|赞(0)|评价(0)|浏览(139)

本文整理了Java中org.elasticsearch.hadoop.serialization.Generator.writeString()方法的一些代码示例,展示了Generator.writeString()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Generator.writeString()方法的具体详情如下:
包路径:org.elasticsearch.hadoop.serialization.Generator
类名称:Generator
方法名:writeString

Generator.writeString介绍

暂无

代码示例

代码示例来源:origin: elastic/elasticsearch-hadoop

protected Result handleUnknown(Object value, Generator generator) {
    generator.writeString(value.toString());
    return Result.SUCCESFUL();
  }
}

代码示例来源:origin: elastic/elasticsearch-hadoop

private void writeNullable(Generator generator, String key, String value) {
    if (value != null) {
      generator.writeFieldName(key).writeString(value);
    }
  }
}

代码示例来源:origin: elastic/elasticsearch-hadoop

@Override
public void toJson(Generator out) {
  if (field == null) {
    throw new IllegalArgumentException("inner clause [field] cannot be null");
  }
  if (term == null) {
    throw new IllegalArgumentException("inner clause [term] cannot be null");
  }
  out.writeFieldName("term")
      .writeBeginObject()
        .writeFieldName(field)
        .writeString(term)
      .writeEndObject();
}

代码示例来源:origin: elastic/elasticsearch-hadoop

generator.writeString(writable.toString());
Calendar cal = Calendar.getInstance();
cal.setTimeInMillis(ts);
generator.writeString(DatatypeConverter.printDateTime(cal));
generator.writeString(DateWritableWriter.toES(writable));
generator.writeString(writable.toString());
generator.writeString(StringUtils.trim(writable.toString()));

代码示例来源:origin: elastic/elasticsearch-hadoop

out.writeBeginObject();
out.writeFieldName("query");
out.writeString(query);
if (defaultField != null) {
  out.writeFieldName("default_field");
  out.writeString(defaultField);
  out.writeString(analyzer);
  out.writeString(defaultOperator);

代码示例来源:origin: elastic/elasticsearch-hadoop

generator.writeString((String) value);
Calendar cal = Calendar.getInstance();
cal.setTime((Date) value);
generator.writeString(DatatypeConverter.printDateTime(cal));
generator.writeString(DatatypeConverter.printDateTime((Calendar) value));

代码示例来源:origin: elastic/elasticsearch-hadoop

generator.writeFieldName(FieldNames.FIELD_TIMESTAMP).writeString(ts);
  generator.writeFieldName(FieldNames.FIELD_LABELS).writeBeginObject();
  for (Map.Entry<String, String> label : labels.entrySet()) {
    generator.writeFieldName(label.getKey()).writeString(label.getValue());
generator.writeFieldName(FieldNames.FIELD_MESSAGE).writeString(message);
  generator.writeFieldName(FieldNames.FIELD_ERROR_CODE).writeString(exceptionType);
  generator.writeFieldName(FieldNames.FIELD_ERROR_MESSAGE).writeString(exceptionMessage);
  generator.writeFieldName(FieldNames.FIELD_EVENT_CATEGORY).writeString(eventCategory);
  generator.writeFieldName(FieldNames.FIELD_EVENT_TYPE).writeString(eventType);
  generator.writeFieldName(FieldNames.FIELD_EVENT_RAW).writeString(rawEvent);
  generator.writeFieldName(FieldNames.FIELD_EVENT_VERSION).writeString(schema.getVersion());

代码示例来源:origin: elastic/elasticsearch-hadoop

break;
case DataType.CHARARRAY:
  generator.writeString(object.toString());
  break;
case DataType.BYTEARRAY:
  generator.writeString(PigUtils.convertDateToES(object));
  break;

代码示例来源:origin: elastic/elasticsearch-hadoop

generator.writeString(writable.toString());

代码示例来源:origin: elastic/elasticsearch-hadoop

break;
case VALUE_STRING:
  generator.writeString(parser.text());
  parser.nextToken();
  break;

代码示例来源:origin: elastic/elasticsearch-hadoop

generator.writeString("value");
assertEquals("test.subfield", generator.getParentPath());

代码示例来源:origin: org.elasticsearch/elasticsearch-hadoop

protected Result handleUnknown(Object value, Generator generator) {
    generator.writeString(value.toString());
    return Result.SUCCESFUL();
  }
}

代码示例来源:origin: org.elasticsearch/elasticsearch-spark-13

private void writeNullable(Generator generator, String key, String value) {
    if (value != null) {
      generator.writeFieldName(key).writeString(value);
    }
  }
}

代码示例来源:origin: org.elasticsearch/elasticsearch-spark

protected Result handleUnknown(Object value, Generator generator) {
    generator.writeString(value.toString());
    return Result.SUCCESFUL();
  }
}

代码示例来源:origin: org.elasticsearch/elasticsearch-hadoop

private void writeNullable(Generator generator, String key, String value) {
    if (value != null) {
      generator.writeFieldName(key).writeString(value);
    }
  }
}

代码示例来源:origin: org.elasticsearch/elasticsearch-hadoop-mr

protected Result handleUnknown(Object value, Generator generator) {
    generator.writeString(value.toString());
    return Result.SUCCESFUL();
  }
}

代码示例来源:origin: org.elasticsearch/elasticsearch-spark-13

protected Result handleUnknown(Object value, Generator generator) {
    generator.writeString(value.toString());
    return Result.SUCCESFUL();
  }
}

代码示例来源:origin: org.elasticsearch/elasticsearch-hadoop-mr

private void writeNullable(Generator generator, String key, String value) {
    if (value != null) {
      generator.writeFieldName(key).writeString(value);
    }
  }
}

代码示例来源:origin: org.elasticsearch/elasticsearch-hadoop

@Override
public void toJson(Generator out) {
  if (field == null) {
    throw new IllegalArgumentException("inner clause [field] cannot be null");
  }
  if (term == null) {
    throw new IllegalArgumentException("inner clause [term] cannot be null");
  }
  out.writeFieldName("term")
      .writeBeginObject()
        .writeFieldName(field)
        .writeString(term)
      .writeEndObject();
}

代码示例来源:origin: org.elasticsearch/elasticsearch-hadoop-mr

@Override
public void toJson(Generator out) {
  if (field == null) {
    throw new IllegalArgumentException("inner clause [field] cannot be null");
  }
  if (term == null) {
    throw new IllegalArgumentException("inner clause [term] cannot be null");
  }
  out.writeFieldName("term")
      .writeBeginObject()
        .writeFieldName(field)
        .writeString(term)
      .writeEndObject();
}

相关文章