Skip to content

Commit

Permalink
- We now use the id from HBase if no idField value is given, instead of
Browse files Browse the repository at this point in the history
having ElasticSearch generate one
  • Loading branch information
mallocator committed Mar 18, 2013
1 parent 78510da commit 452579a
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/main/java/org/elasticsearch/river/hbase/HBaseRiver.java
Original file line number Diff line number Diff line change
Expand Up @@ -309,6 +309,9 @@ private void parseBulkOfRows(final String timestamp, final ArrayList<ArrayList<K
final IndexRequestBuilder request = HBaseRiver.this.esClient.prepareIndex(HBaseRiver.this.index, HBaseRiver.this.type);
request.setTimestamp(timestamp);
request.setSource(readDataTree(row));
if (HBaseRiver.this.idField == null && row.size() > 0) {
request.setId(new String(row.get(0).key(), charset));
}
bulkRequest.add(request);
}
bulkRequest.execute().addListener((ActionListener<BulkResponse>) this);
Expand Down

0 comments on commit 452579a

Please sign in to comment.