@@ -1279,6 +1279,20 @@ struct BPPHandler
12791279 }
12801280 };
12811281
1282+ struct BloomFilter : public BPPHandlerFunctor
1283+ {
1284+ BloomFilter (boost::shared_ptr<BPPHandler> r, SBS b) : BPPHandlerFunctor(std::move(r), std::move(b))
1285+ {
1286+ }
1287+
1288+ int operator ()() override
1289+ {
1290+ utils::setThreadName (" PPHandBloomFilter" );
1291+ return rt->addBloomFiltersToBPP (*bs, dieTime);
1292+ }
1293+
1294+ };
1295+
12821296 int doAbort (ByteStream& bs, const posix_time::ptime& dieTime)
12831297 {
12841298 uint32_t key;
@@ -1486,6 +1500,37 @@ struct BPPHandler
14861500 }
14871501 }
14881502
1503+ int addBloomFiltersToBPP (ByteStream& bs, const posix_time::ptime& dieTime)
1504+ {
1505+ SBPPV bppv;
1506+ uint32_t uniqueID;
1507+ const uint8_t * buf;
1508+
1509+ buf = bs.buf ();
1510+ uniqueID = *((const uint32_t *)&buf[sizeof (ISMPacketHeader) + 3 * sizeof (uint32_t )]);
1511+
1512+ bppv = grabBPPs (uniqueID);
1513+
1514+ if (bppv)
1515+ {
1516+ boost::shared_lock<boost::shared_mutex> lk (getDJLock (uniqueID));
1517+ bppv->get ()[0 ]->addBloomFilters (bs);
1518+ return 0 ;
1519+ }
1520+ else
1521+ {
1522+ if (posix_time::second_clock::universal_time () > dieTime)
1523+ {
1524+ cout << " addBloomFilterToBPP: job for id " << uniqueID << " has been killed." << endl;
1525+ return 0 ;
1526+ }
1527+ else
1528+ {
1529+ return -1 ;
1530+ }
1531+ }
1532+ }
1533+
14891534 int lastJoinerMsg (ByteStream& bs, const posix_time::ptime& dieTime)
14901535 {
14911536 SBPPV bppv;
@@ -2024,6 +2069,30 @@ struct ReadThread
20242069 fBPPHandler ->doAck (*sbs);
20252070 break ;
20262071 }
2072+
2073+ case BATCH_PRIMITIVE_BLOOM_FILTER:
2074+ {
2075+ const uint8_t * buf = sbs->buf ();
2076+ uint32_t pos = sizeof (ISMPacketHeader);
2077+ const uint32_t txnId = *((uint32_t *)&buf[pos]);
2078+ [[maybe_unused]] const uint32_t sessionID = *((uint32_t *)&buf[pos + 4 ]);
2079+ const uint32_t stepID = *((uint32_t *)&buf[pos + 8 ]);
2080+ const uint32_t uniqueID = *((uint32_t *)&buf[pos + 12 ]);
2081+
2082+ const uint32_t id = 0 ;
2083+ const uint32_t weight = threadpool::MetaJobsInitialWeight;
2084+ const uint32_t priority = 0 ;
2085+
2086+ boost::shared_ptr<FairThreadPool::Functor> functor;
2087+ functor.reset (new BPPHandler::BloomFilter (fBPPHandler , sbs));
2088+
2089+ PriorityThreadPool::Job job (uniqueID, stepID, txnId, functor, outIos, weight, priority, id);
2090+ OOBProcPool->addJob (job);
2091+
2092+
2093+ break ;
2094+ }
2095+
20272096 default :
20282097 {
20292098 std::ostringstream os;
0 commit comments