Lines Matching full:if

102   // check if current file is still open  in resetOutputFile()
103 if (fd_ > 0) { in resetOutputFile()
107 if (-1 == ::THRIFT_CLOSE(fd_)) { in resetOutputFile()
119 if (fd) { in resetOutputFile()
122 // open file if the input fd is 0 in resetOutputFile()
128 // flush the buffer if a writer thread is active in ~TFileTransport()
129 if (writerThread_.get()) { in ~TFileTransport()
141 if (dequeueBuffer_) { in ~TFileTransport()
146 if (enqueueBuffer_) { in ~TFileTransport()
151 if (readBuff_) { in ~TFileTransport()
156 if (currentEvent_) { in ~TFileTransport()
162 if (fd_ > 0) { in ~TFileTransport()
163 if (-1 == ::THRIFT_CLOSE(fd_)) { in ~TFileTransport()
173 if (bufferAndThreadInitialized_) { in initBufferAndWriteThread()
178 if (!writerThread_.get()) { in initBufferAndWriteThread()
192 if (readOnly_) { in write()
206 // can't enqueue more events if file is going to close in enqueueEvent()
207 if (closing_) { in enqueueEvent()
212 if ((maxEventSize_ > 0) && (eventLen > maxEventSize_)) { in enqueueEvent()
217 if (eventLen == 0) { in enqueueEvent()
235 if (!bufferAndThreadInitialized_) { in enqueueEvent()
236 if (!initBufferAndWriteThread()) { in enqueueEvent()
248 // the flush if more data keeps being enqueued.) in enqueueEvent()
253 if (!enqueueBuffer_->addEvent(pEvent)) { in enqueueEvent()
270 if (!enqueueBuffer_->isEmpty()) { in swapEventBuffers()
272 } else if (closing_) { in swapEventBuffers()
274 // return immediately if the transport is closing in swapEventBuffers()
277 if (deadline != nullptr) { in swapEventBuffers()
278 // if we were handed a deadline time struct, do a timed wait in swapEventBuffers()
285 // could be empty if we timed out in swapEventBuffers()
289 if (swap) { in swapEventBuffers()
295 if (swap) { in swapEventBuffers()
305 // open file if it is not open in writerThread()
306 if (!fd_) { in writerThread()
318 if (!hasIOError) { in writerThread()
323 if (0 == THRIFT_FTRUNCATE(fd_, offset_)) { in writerThread()
343 if (closing_) { in writerThread()
344 if (hasIOError) { in writerThread()
349 if (enqueueBuffer_->isEmpty() && dequeueBuffer_->isEmpty()) { in writerThread()
351 if (-1 == ::THRIFT_CLOSE(fd_)) { in writerThread()
362 if (swapEventBuffers(&ts_next_flush)) { in writerThread()
365 // Remove an event from the buffer and write it out to disk. If there is any IO error, for in writerThread()
369 // will: (1) sleep for a short while; (2) try to reopen the file; (3) if successful then in writerThread()
378 if (closing_) { in writerThread()
381 if (!fd_) { in writerThread()
400 if ((maxEventSize_ > 0) && (outEvent->eventSize_ > maxEventSize_)) { in writerThread()
407 // If chunking is required, then make sure that msg does not cross chunk boundary in writerThread()
408 if ((outEvent->eventSize_ > 0) && (chunkSize_ != 0)) { in writerThread()
410 if (outEvent->eventSize_ > chunkSize_) { in writerThread()
420 // if adding this event will cross a chunk boundary, pad the chunk with zeros in writerThread()
421 if (chunk1 != chunk2) { in writerThread()
429 if (-1 == ::THRIFT_WRITE(fd_, zeros, padding)) { in writerThread()
442 if (outEvent->eventSize_ > 0) { in writerThread()
443 if (-1 == ::THRIFT_WRITE(fd_, outEvent->eventBuff_, outEvent->eventSize_)) { in writerThread()
456 if (hasIOError) { in writerThread()
463 // loop. If we check it more than once without holding the lock the entire in writerThread()
469 if (forceFlush_) { in writerThread()
470 if (!enqueueBuffer_->isEmpty()) { in writerThread()
471 // If forceFlush_ is true, we need to flush all available data. in writerThread()
472 // If enqueueBuffer_ is not empty, go back to the start of the loop to in writerThread()
486 // determine if we need to perform an fsync in writerThread()
488 if (forced_flush || unflushed > flushMaxBytes_) { in writerThread()
491 if (std::chrono::steady_clock::now() > ts_next_flush) { in writerThread()
492 if (unflushed > 0) { in writerThread()
495 // If there is no new data since the last fsync, in writerThread()
502 if (flush) { in writerThread()
509 if (forced_flush) { in writerThread()
523 if (!writerThread_.get()) { in flush()
546 if (get <= 0) { in readAll()
556 // check if there is an event ready to be read in peek()
557 if (!currentEvent_) { in peek()
562 // if the timeout expired or there was some other error in peek()
563 if (!currentEvent_) { in peek()
567 // check if there is anything to read in peek()
573 // check if there an event is ready to be read in read()
574 if (!currentEvent_) { in read()
579 // if the timeout expired or there was some other error in read()
580 if (!currentEvent_) { in read()
586 if (remaining <= (int32_t)len) { in read()
588 if (remaining > 0) { in read()
606 if (!readBuff_) { in readEvent()
611 // read from the file if read buffer is exhausted in readEvent()
612 if (readState_.bufferPtr_ == readState_.bufferLen_) { in readEvent()
616 // if (readState_.bufferLen_) { in readEvent()
623 if (readState_.bufferLen_ == -1) { in readEvent()
627 } else if (readState_.bufferLen_ == 0) { // EOF in readEvent()
628 // wait indefinitely if there is no timeout in readEvent()
629 if (readTimeout_ == TAIL_READ_TIMEOUT) { in readEvent()
632 } else if (readTimeout_ == NO_TAIL_READ_TIMEOUT) { in readEvent()
636 } else if (readTimeout_ > 0) { in readEvent()
638 if (readTries > 0) { in readEvent()
654 if (readState_.readingSize_) { in readEvent()
655 if (readState_.eventSizeBuffPos_ == 0) { in readEvent()
656 if ((offset_ + readState_.bufferPtr_) / chunkSize_ in readEvent()
668 if (readState_.eventSizeBuffPos_ == 4) { in readEvent()
669 if (readState_.getEventSize() == 0) { in readEvent()
677 if (readState_.event_) { in readEvent()
683 // check if the event is corrupted and perform recovery if required in readEvent()
684 if (isEventCorrupted()) { in readEvent()
691 if (!readState_.event_->eventBuff_) { in readEvent()
708 // check if the event has been read in full in readEvent()
709 if (readState_.event_->eventBuffPos_ == readState_.event_->eventSize_) { in readEvent()
726 // an error is triggered if: in isEventCorrupted()
727 if ((maxEventSize_ > 0) && (readState_.event_->eventSize_ > maxEventSize_)) { in isEventCorrupted()
733 } else if (readState_.event_->eventSize_ > chunkSize_) { in isEventCorrupted()
739 } else if (((offset_ + readState_.bufferPtr_ - 4) / chunkSize_) in isEventCorrupted()
756 if (lastBadChunk_ == curChunk) { in performRecovery()
763 if (numCorruptedEventsInChunk_ < maxCorruptedEvents_) { in performRecovery()
769 // just skip ahead to the next chunk if we not already at the last chunk in performRecovery()
770 if (curChunk != (getNumChunks() - 1)) { in performRecovery()
772 } else if (readTimeout_ == TAIL_READ_TIMEOUT) { in performRecovery()
773 // if tailing the file, wait until there is enough data to start in performRecovery()
796 if (fd_ <= 0) { in seekToChunk()
803 if (numChunks == 0) { in seekToChunk()
808 if (chunk < 0) { in seekToChunk()
813 if (chunk < 0) { in seekToChunk()
821 if (chunk >= numChunks) { in seekToChunk()
833 if (offset_ == -1) { in seekToChunk()
838 // seek to EOF if user wanted to go to last chunk in seekToChunk()
839 if (seekToEnd) { in seekToChunk()
846 if (event.get() == nullptr) { in seekToChunk()
859 if (fd_ <= 0) { in getNumChunks()
866 if (rv < 0) { in getNumChunks()
873 if (f_info.st_size > 0) { in getNumChunks()
875 if (numChunks > (std::numeric_limits<uint32_t>::max)()) in getNumChunks()
901 if (fd_ == -1) { in openLogFile()
918 if (buffer_) { in ~TFileTransportBuffer()
928 if (bufferMode_ == READ) { in addEvent()
931 if (writePoint_ < size_) { in addEvent()
941 if (bufferMode_ == WRITE) { in getNext()
944 if (readPoint_ < writePoint_) { in getNext()
953 if (bufferMode_ == WRITE || writePoint_ > readPoint_) { in reset()
1013 // set the read timeout to 0 if tailing is required in process()
1015 if (tail) { in process()
1027 if ((numEvents > 0) && (numProcessed == numEvents)) { in process()
1031 if (!tail) { in process()
1041 if (tail) { in process()
1057 if (curChunk != inputTransport_->getCurChunk()) { in processChunk()