Skip to content

Commit

Permalink
Long id generation tracking (#22)
Browse files Browse the repository at this point in the history
* gen id tracking

* Improved log message
  • Loading branch information
denis256 authored Dec 21, 2023
1 parent f881268 commit b9cb8d2
Showing 1 changed file with 9 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,8 @@ public BasicPolyList insert(String dataset, InsertOptions insertOptions, Collect
}
});

Set<Long> genHashIds = new HashSet<>();

Connection connection = fetchConnection(dataset);
try {
connection.setAutoCommit(false);
Expand All @@ -168,6 +170,13 @@ public BasicPolyList insert(String dataset, InsertOptions insertOptions, Collect
for (InsertRequest request : toInsert) {
String id = request.getData()._id();
long id_n = genHash(id);

if (genHashIds.contains(id_n)) {
log.warn("Duplicate id {} => {} for poly {}", id, id_n, request.getData());
continue;
}
genHashIds.add(id_n);

Set<String> tags = buildTagIndex(request);
String tagString = buildTagIndexString(tags);
BasicPoly data = request.getData();
Expand Down

0 comments on commit b9cb8d2

Please sign in to comment.