Commit 29c4b4e1 authored by Brian Long's avatar Brian Long
Browse files

increased debug/trace logging during shard discovery

parent 2c3fc849
Loading
Loading
Loading
Loading
+10 −3
Original line number Diff line number Diff line
@@ -50,12 +50,15 @@ public class ShardDiscoveryService implements com.inteligr8.alfresco.asie.spi.Sh
			for (Entry<Shard, Set<ShardState>> flocShard : floc.getValue().entrySet()) {
				for (ShardState shardState : flocShard.getValue()) {
					ShardSet shardSet = ShardSet.from(floc.getKey(), shardState);
					if (shardSet.getCore().equals(core))
					if (shardSet.getCore().equals(core)) {
						this.logger.debug("Found matching shard set: {}: {}", core, shardSet);
						return shardSet;
					}
				}
			}
		}

		this.logger.trace("Did not find matching shard set: {}", core);
		return null;
    }
    
@@ -97,6 +100,7 @@ public class ShardDiscoveryService implements com.inteligr8.alfresco.asie.spi.Sh
			}
		}

		this.logger.trace("Did not find matching node: {}:{}", nodeHostname, nodePort);
		return null;
    }
    
@@ -127,6 +131,7 @@ public class ShardDiscoveryService implements com.inteligr8.alfresco.asie.spi.Sh
				
				ShardInstance shardInstance = shardState.getShardInstance();
				if (node.equals(SolrHost.from(shardInstance))) {
					this.logger.trace("Found shard on node: {}: {}", node, shardInstance.getShard().getInstance());
					Map<Integer, ShardInstanceState> shardStates = setShardStates.get(shardSet);
					if (shardStates == null)
						setShardStates.put(shardSet, shardStates = new HashMap<>());
@@ -152,7 +157,9 @@ public class ShardDiscoveryService implements com.inteligr8.alfresco.asie.spi.Sh
		
		for (Entry<Floc, Map<Shard, Set<ShardState>>> floc : flocs.entrySet()) {
			if (shardMethodSet.contains(floc.getKey().getShardMethod())) {
				this.logger.trace("Found qualifying shard method: {}", floc.getKey().getShardMethod());
				ShardState shardState = this.extractAnyShardState(floc.getValue());
				this.logger.trace("Found single shard state representing shard method: {}: {}", floc.getKey().getShardMethod(), shardState);
				shardSets.add(ShardSet.from(floc.getKey(), shardState));
			}
		}