delete useless code

This commit is contained in:
lnk
2025-04-29 15:05:36 +08:00
parent 2a8f2c996c
commit 59079da4be
22 changed files with 1140 additions and 12715 deletions

View File

@@ -33,12 +33,6 @@ public:
}
private:
//static inline unsigned int djb_hash (const char *str, size_t len) {
// unsigned int hash = 5381;
// for (size_t i = 0 ; i < len ; i++)
// hash = ((hash << 5) + hash) + str[i];
// return hash;
//}
};
class ProducerDeliveryReportCb : public RdKafka::DeliveryReportCb {
@@ -88,8 +82,6 @@ bool FeKafkaProducer::init(const std::string &brokerlist, const bool &async, con
}
#endif
//std::string broker(host);
//broker.append(":").append(std::to_string((long long)port));
conf_->set("metadata.broker.list", brokerlist, errstr);
if (strcmp(PROTOCOL, "sasl_plaintext") == 0) {
conf_->set("security.protocol", PROTOCOL, errstr);
@@ -114,17 +106,10 @@ bool FeKafkaProducer::init(const std::string &brokerlist, const bool &async, con
{
char size_str[256];
conf_->set("producer.type", "async", errstr);
//conf_->set("queue.buffering.max.messages", std::to_string((long long)size).c_str(), errstr);
memset(size_str,0,256);
apr_snprintf(size_str,sizeof(size_str),"%i",size);
conf_->set("queue.buffering.max.messages", size_str, errstr);
{
//const char* api_version_request = "false";
//const char* api_version_fallback = "0.8.2.0";
//conf_->set("api.version.request", api_version_request, errstr) ;
//conf_->set("broker.version.fallback", api_version_fallback, errstr);
}
}
else
{
@@ -146,7 +131,7 @@ int FeKafkaProducer::send(const char *data, const int &size, const std::string &
const int &partition, const std::string *key,const int &timeout)
{
RdKafka::Topic *tpk = get_topic(topic);
//std::cout<<"send data "<<data<<std::endl;
if (tpk == nullptr) {
printf("FIRST: get topic(%s) failed, to create at once \n",topic.c_str());
bool ret = create_topic(topic);
@@ -169,7 +154,6 @@ int FeKafkaProducer::send(const char *data, const int &size, const std::string &
RdKafka::Producer::RK_MSG_COPY /* Copy payload */,
const_cast<char*>(data), size,
key->c_str(),key->size(), NULL);
///*NULL*/ key, NULL);
if (resp != RdKafka::ERR_NO_ERROR)
{