use of org.elasticsearch.action.admin.indices.flush.FlushRequest in project zipkin by openzipkin.
the class ElasticsearchDependenciesTest method writeDependencyLinks.
protected void writeDependencyLinks(List<DependencyLink> links, long timestampMillis) {
long midnight = Util.midnightUTC(timestampMillis);
TransportClient client = ((NativeClient) storage().client()).client;
BulkRequestBuilder request = client.prepareBulk();
for (DependencyLink link : links) {
request.add(client.prepareIndex(storage().indexNameFormatter.indexNameForTimestamp(midnight), ElasticsearchConstants.DEPENDENCY_LINK).setId(// Unique constraint
link.parent + "|" + link.child).setSource("parent", link.parent, "child", link.child, "callCount", link.callCount));
}
request.execute().actionGet();
client.admin().indices().flush(new FlushRequest()).actionGet();
}
use of org.elasticsearch.action.admin.indices.flush.FlushRequest in project graylog2-server by Graylog2.
the class Indices method flush.
public void flush(String index) {
FlushRequest flush = new FlushRequest(index);
// Just flushes. Even if it is not necessary.
flush.force(true);
c.admin().indices().flush(new FlushRequest(index).force(true)).actionGet();
}
Aggregations