小编Ram*_*mar的帖子

理解方法注释java 8中HashMap类的hash()方法

 /**
     * Computes key.hashCode() and spreads (XORs) higher bits of hash
     * to lower.  Because the table uses power-of-two masking, sets of
     * hashes that vary only in bits above the current mask will
     * always collide. (Among known examples are sets of Float keys
     * holding consecutive whole numbers in small tables.)  So we
     * apply a transform that spreads the impact of higher bits
     * downward. There is a tradeoff between speed, utility, and
     * quality of bit-spreading. …
Run Code Online (Sandbox Code Playgroud)

java hash hashmap data-structures

10
推荐指数
1
解决办法
600
查看次数

Spring-Boot和Kafka:如何处理不可用的经纪人?

在spring-boot应用程序运行时,如果我完全关闭了代理(kafka和zookeeper),我会在控制台中看到此警告时间很长。

[org.springframework.kafka.KafkaListenerEndpointContainer#0-0-C-1]警告o.apache.kafka.clients.NetworkClient-[Consumer clientId = consumer-1,groupId = ResponseReceiveConsumerGroup]无法建立与节点2147483647的连接。经纪人可能不可用。

Spring Boot中是否有一种方法可以优雅地处理此问题,而不是在控制台上无限处理日志?

java spring apache-kafka spring-boot spring-kafka

5
推荐指数
1
解决办法
2775
查看次数