Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -557,16 +557,27 @@ void lookupManagementLoop()

try {
List<ListenableFuture<Map.Entry>> futures = new ArrayList<>();
for (Map.Entry<String, Map<String, LookupExtractorFactoryMapContainer>> tierEntry : allLookupTiers.entrySet()) {

LOG.debug("Starting lookup mgmt for tier [%s].", tierEntry.getKey());
Set<String> discoveredLookupTiers = lookupNodeDiscovery.getAllTiers();

final Map<String, LookupExtractorFactoryMapContainer> tierLookups = tierEntry.getValue();
for (final HostAndPortWithScheme node : lookupNodeDiscovery.getNodesInTier(tierEntry.getKey())) {
// Check and Log warnings about lookups configured by user in DB but no nodes discovered to load those.
for (String tierInDB : allLookupTiers.keySet()) {
if (!discoveredLookupTiers.contains(tierInDB) &&
!allLookupTiers.getOrDefault(tierInDB, ImmutableMap.of()).isEmpty()) {
LOG.warn("Found lookups for tier [%s] in DB, but no nodes discovered for it", tierInDB);
}
}

for (String tier : discoveredLookupTiers) {

LOG.debug("Starting lookup mgmt for tier [%s].", tier);

final Map<String, LookupExtractorFactoryMapContainer> tierLookups = allLookupTiers.getOrDefault(tier, ImmutableMap.of());
for (final HostAndPortWithScheme node : lookupNodeDiscovery.getNodesInTier(tier)) {

LOG.debug(
"Starting lookup mgmt for tier [%s] and host [%s:%s:%s].",
tierEntry.getKey(),
tier,
node.getScheme(),
node.getHostText(),
node.getPort()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1138,6 +1138,10 @@ public void testLookupManagementLoop() throws Exception
HostAndPortWithScheme host2 = HostAndPortWithScheme.fromParts("http", "host2", 3456);

EasyMock.reset(lookupNodeDiscovery);
EasyMock
.expect(lookupNodeDiscovery.getAllTiers())
.andReturn(ImmutableSet.of("tier1"))
.once();
EasyMock
.expect(lookupNodeDiscovery.getNodesInTier("tier1"))
.andReturn(ImmutableList.of(host1, host2))
Expand Down