| 168 | } |
| 169 | |
| 170 | bool TFileTransport::initBufferAndWriteThread() { |
| 171 | if (bufferAndThreadInitialized_) { |
| 172 | T_ERROR("%s", "Trying to double-init TFileTransport"); |
| 173 | return false; |
| 174 | } |
| 175 | |
| 176 | if (!writerThread_.get()) { |
| 177 | writerThread_ = threadFactory_.newThread( |
| 178 | apache::thrift::concurrency::FunctionRunner::create(startWriterThread, this)); |
| 179 | writerThread_->start(); |
| 180 | } |
| 181 | |
| 182 | dequeueBuffer_ = new TFileTransportBuffer(eventBufferSize_); |
| 183 | enqueueBuffer_ = new TFileTransportBuffer(eventBufferSize_); |
| 184 | bufferAndThreadInitialized_ = true; |
| 185 | |
| 186 | return true; |
| 187 | } |
| 188 | |
| 189 | void TFileTransport::write(const uint8_t* buf, uint32_t len) { |
| 190 | if (readOnly_) { |