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

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

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

Generator.close介绍

暂无

代码示例

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

public void close() {
    generator.close();
  }
}

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

static QueryBuilder randomRawQueryStringQuery(Random rand, int level) {
  QueryBuilder query = randomQuery(rand);
  FastByteArrayOutputStream out = new FastByteArrayOutputStream(256);
  Generator generator = new JacksonJsonGenerator(out);
  generator.writeBeginObject();
  query.toJson(generator);
  generator.writeEndObject();
  generator.close();
  try {
    return new RawQueryBuilder(out.toString().trim(), false);
  } catch (IOException e) {
    throw new IllegalArgumentException("failed to parse raw query", e);
  }
}

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

public static String printQueryBuilder(QueryBuilder builder, boolean addQuery) {
    FastByteArrayOutputStream out = new FastByteArrayOutputStream(256);
    Generator generator = new JacksonJsonGenerator(out);
    if (addQuery) {
      generator.writeBeginObject().writeFieldName("query");
    }
    generator.writeBeginObject();
    builder.toJson(generator);
    generator.writeEndObject();
    if (addQuery) {
      generator.writeEndObject();
    }
    generator.close();
    return out.toString();
  }
}

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

public void close() {
    generator.close();
  }
}

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

public void close() {
    generator.close();
  }
}

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

public void close() {
    generator.close();
  }
}

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

public void close() {
    generator.close();
  }
}

相关文章