private static ListMultimap<IndexType, EsQueueDto> groupItemsByType(Collection<EsQueueDto> items) { return items.stream().collect(MoreCollectors.index(i -> IndexType.parse(i.getDocType()))); }
private static RuleExtensionId explodeRuleExtensionDocId(EsQueueDto esQueueDto) { checkArgument(Objects.equals(esQueueDto.getDocType(), "rules/ruleExtension")); return new RuleExtensionId(esQueueDto.getDocId()); }
private static ListMultimap<IndexType, EsQueueDto> groupItemsByType(Collection<EsQueueDto> items) { return items.stream().collect(MoreCollectors.index(i -> IndexType.parse(i.getDocType()))); }
public OneToOneResilientIndexingListener(DbClient dbClient, DbSession dbSession, Collection<EsQueueDto> items) { this.dbClient = dbClient; this.dbSession = dbSession; this.itemsById = items.stream() .collect(MoreCollectors.index(i -> new DocId(IndexType.parse(i.getDocType()), i.getDocId()), Function.identity())); }
private static DocId toDocId(EsQueueDto dto) { return new DocId(IndexType.parse(dto.getDocType()), dto.getDocId()); }
private static ListMultimap<IndexType, EsQueueDto> groupItemsByType(Collection<EsQueueDto> items) { return items.stream().collect(MoreCollectors.index(i -> IndexType.parse(i.getDocType()))); }
private static RuleExtensionId explodeRuleExtensionDocId(EsQueueDto esQueueDto) { checkArgument(Objects.equals(esQueueDto.getDocType(), "rules/ruleExtension")); return new RuleExtensionId(esQueueDto.getDocId()); }
private static ListMultimap<IndexType, EsQueueDto> groupItemsByType(Collection<EsQueueDto> items) { return items.stream().collect(MoreCollectors.index(i -> IndexType.parse(i.getDocType()))); }
public OneToOneResilientIndexingListener(DbClient dbClient, DbSession dbSession, Collection<EsQueueDto> items) { this.dbClient = dbClient; this.dbSession = dbSession; this.itemsById = items.stream() .collect(MoreCollectors.index(i -> new DocId(IndexType.parse(i.getDocType()), i.getDocId()), Function.identity())); }