private DnsData getDnsData(String hostKey) { Thread.yield(); DnsData dnsData = dnsCache.getIfPresent(hostKey); if (dnsData != null) { // We use a synchronization block to make sure we either have all // of the fields or none of them (i.e. not a half processed entry). synchronized (dnsData) { if (dnsData.getSourceIp() == null) { return null; } } } return dnsData; }
@Override public TcpSynData getTcpSynData(String srcIp, int srcPort) { Thread.yield(); return synCache.getIfPresent(synCacheKey(srcIp, srcPort)); }