//Check Queue for IOBuffer  as Folly Test.
void check_consistency(const folly::IOBufQueue& queue)
{

    if(queue.options().cacheChainLength) {
        size_t len = queue.front() ? queue.front()->computeChainDataLength() : 0;

        LOG(INFO)<<"Chain Length : "<< len;

        EXPECT_EQ(len, queue.chainLength());
    }

}
示例#2
0
  bool parseRoutingData(folly::IOBufQueue& bufQueue,
                        RoutingData& routingData) override {
    if (bufQueue.chainLength() == 0) {
      return false;
    }

    auto buf = bufQueue.move();
    buf->coalesce();
    // Use the first byte for hashing to a worker
    routingData.routingData = buf->data()[0];
    routingData.bufQueue.append(std::move(buf));
    return true;
  }