Реализация собственного алгоритма хеширования в ArangoDB - PullRequest
0 голосов
/ 26 декабря 2018

Запись двойных данных [] (GeoIndexed), если одно из значений повторяется, генерирует исключение.

Импорт файла KML (Google Maps) в ArangoDb

  • arangodb-spring-boot-starter = 1.0.1
  • arangodb-spring-data = 3.2.1
  public District saveAsNew(District district) {
    final District savedDistrict = dr.save(district);
    district.locations().forEach(location -> {
        log.debug("Saving location {} for {}", location, district.name());
        final Location savedLocation = lr.save(location);
        dlr.save(new LocationOf().district(savedDistrict).location(savedLocation));
    });
    return savedDistrict;
}
2018-12-26 11:39:36.846 DEBUG 21762 --- [           main] p.s.p.service.DistanceService            : Saving location Location(id=null, location=[50.9104016, 17.408695]) for Jaz w Lipki
2018-12-26 11:39:36.847 DEBUG 21762 --- [           main] p.s.p.service.DistanceService            : Saving location Location(id=null, location=[50.9112675, 17.4056051]) for Jaz w Lipki
2018-12-26 11:39:36.849 DEBUG 21762 --- [           main] p.s.p.service.DistanceService            : Saving location Location(id=null, location=[50.9143521, 17.4028585]) for Jaz w Lipki
2018-12-26 11:39:36.850 DEBUG 21762 --- [           main] p.s.p.service.DistanceService            : Saving location Location(id=null, location=[50.9188975, 17.402601]) for Jaz w Lipki
2018-12-26 11:39:36.851 DEBUG 21762 --- [           main] p.s.p.service.DistanceService            : Saving location Location(id=null, location=[50.9203043, 17.4002836]) for Jaz w Lipki
2018-12-26 11:39:36.852 DEBUG 21762 --- [           main] p.s.p.service.DistanceService            : Saving location Location(id=null, location=[50.9210618, 17.3966787]) for Jaz w Lipki
2018-12-26 11:39:36.853 DEBUG 21762 --- [           main] p.s.p.service.DistanceService            : Saving location Location(id=null, location=[50.9220358, 17.3896406]) for Jaz w Lipki
2018-12-26 11:39:36.854 DEBUG 21762 --- [           main] p.s.p.service.DistanceService            : Saving location Location(id=null, location=[50.9239294, 17.3832891]) for Jaz w Lipki
2018-12-26 11:39:36.855 DEBUG 21762 --- [           main] p.s.p.service.DistanceService            : Saving location Location(id=null, location=[50.9254443, 17.3788259]) for Jaz w Lipki
2018-12-26 11:39:36.856 DEBUG 21762 --- [           main] p.s.p.service.DistanceService            : Saving location Location(id=null, location=[50.9254984, 17.3710153]) for Jaz w Lipki
2018-12-26 11:39:36.857 DEBUG 21762 --- [           main] p.s.p.service.DistanceService            : Saving location Location(id=null, location=[50.9257689, 17.3685262]) for Jaz w Lipki
2018-12-26 11:39:36.859 DEBUG 21762 --- [           main] p.s.p.service.DistanceService            : Saving location Location(id=null, location=[50.9284739, 17.3632047]) for Jaz w Lipki
2018-12-26 11:39:36.860 DEBUG 21762 --- [           main] p.s.p.service.DistanceService            : Saving location Location(id=null, location=[50.9303673, 17.3558233]) for Jaz w Lipki
2018-12-26 11:39:36.861 DEBUG 21762 --- [           main] p.s.p.service.DistanceService            : Saving location Location(id=null, location=[50.9313951, 17.3455236]) for Jaz w Lipki
2018-12-26 11:39:36.862 DEBUG 21762 --- [           main] p.s.p.service.DistanceService            : Saving location Location(id=null, location=[50.9339375, 17.3389146]) for Jaz w Lipki
2018-12-26 11:39:36.863 DEBUG 21762 --- [           main] p.s.p.service.DistanceService            : Saving location Location(id=null, location=[50.9393464, 17.3383996]) for Jaz w Lipki
2018-12-26 11:39:36.864 DEBUG 21762 --- [           main] p.s.p.service.DistanceService            : Saving location Location(id=null, location=[50.9415638, 17.337198]) for Jaz w Lipki
2018-12-26 11:39:36.865 DEBUG 21762 --- [           main] p.s.p.service.DistanceService            : Saving location Location(id=null, location=[50.9431863, 17.3367688]) for Jaz w Lipki
2018-12-26 11:39:36.867 DEBUG 21762 --- [           main] p.s.p.service.DistanceService            : Saving location Location(id=null, location=[50.9448628, 17.3347947]) for Jaz w Lipki
2018-12-26 11:39:36.868 DEBUG 21762 --- [           main] p.s.p.service.DistanceService            : Saving location Location(id=null, location=[50.9447546, 17.3305032]) for Jaz w Lipki
2018-12-26 11:39:36.869 DEBUG 21762 --- [           main] p.s.p.service.DistanceService            : Saving location Location(id=null, location=[50.9439975, 17.3269842]) for Jaz w Lipki
2018-12-26 11:39:36.870 DEBUG 21762 --- [           main] p.s.p.service.DistanceService            : Saving location Location(id=null, location=[50.9437812, 17.3235509]) for Jaz w Lipki
2018-12-26 11:39:36.871 DEBUG 21762 --- [           main] p.s.p.service.DistanceService            : Saving location Location(id=null, location=[50.9453495, 17.3171995]) for Jaz w Lipki
2018-12-26 11:39:36.872 DEBUG 21762 --- [           main] p.s.p.service.DistanceService            : Saving location Location(id=null, location=[50.9443761, 17.3115346]) for Jaz w Lipki
2018-12-26 11:39:36.874 DEBUG 21762 --- [           main] p.s.p.service.DistanceService            : Saving location Location(id=null, location=[50.945025, 17.3080156]) for Jaz w Lipki
2018-12-26 11:39:36.877 DEBUG 21762 --- [           main] p.s.p.service.DistanceService            : Saving location Location(id=null, location=[50.9462017, **17.3070084**]) for Jaz w Lipki
2018-12-26 11:39:36.879 DEBUG 21762 --- [           main] p.s.p.service.DistanceService            : Saving location Location(id=null, location=[50.9481958, 17.3063861]) for Jaz w Lipki
2018-12-26 11:39:36.880 DEBUG 21762 --- [           main] p.s.p.service.DistanceService            : Saving location Location(id=null, location=[50.9530285, **17.3070084**]) for Jaz w Lipki

org.springframework.dao.DataIntegrityViolationException: Response: 409, Error: 1210 - unique constraint violated - in index 3063030 of type hash over ["location[*]"]; conflicting key: 3133664; nested exception is com.arangodb.ArangoDBException: Response: 409, Error: 1210 - unique constraint violated - in index 3063030 of type hash over ["location[*]"]; conflicting key: 3133664

Превышено число генераторов хеша.

1 Ответ

0 голосов
/ 04 марта 2019

Проблема решена.Потому что я много комбинировал с доменом.

Я сохранил много конфликтующих конфигураций "HashIndex".

Решение удалить ключи вручную из панели администратора, которое нам не интересноили удалить всю коллекцию.

...