Example #1
0
folly::fbstring
ZkClient::createEphemeralSequence(
    const folly::fbstring& path,
    const folly::fbstring& data) {
    zhandle_t* zhandle = zHandle_.get();
    CHECK(nullptr != zhandle) << "zhandle is NULL";
    folly::fbstring newPath;
    newPath.resize(path.size() * 3);
    int code = zoo_create(
                   zhandle,
                   path.c_str(),
                   data.data(),
                   data.length(),
                   &ZOO_READ_ACL_UNSAFE,
                   ZOO_EPHEMERAL | ZOO_SEQUENCE,
                   (char*) newPath.data(),
                   newPath.size()
               );
    CHECK(ZOK == code)
            << "zoo_acreate() failed with error: "
            << zooErrorCodeToString(code);
    return std::move(newPath);
}
Example #2
0
void HPACKCodec::onHeader(const folly::fbstring& name,
                          const folly::fbstring& value) {
  assert(streamingCb_ != nullptr);
  decodedSize_.uncompressed += name.size() + value.size() + 2;
  streamingCb_->onHeader(name, value);
}