code: private StreamBlock pollPersistentDeque(boolean actuallyPoll) {
          BBContainer cont = null;
          BBContainer schemaCont = null;
          try {
              // Start to read a new segment
              if (m_reader.isStartOfSegment()) {
                  schemaCont = m_reader.getExtraHeader(-1);
              }
              cont = m_reader.poll(PersistentBinaryDeque.UNSAFE_CONTAINER_FACTORY);
          } catch (IOException e) {
              exportLog.error("Failed to poll from persistent binary deque:" + e);
          }
  
          if (cont == null) {
              if (schemaCont != null) {
                  schemaCont.discard();
              }
              return null;
          } else {
              long segmentIndex = m_reader.getSegmentIndex();
              cont.b().order(ByteOrder.LITTLE_ENDIAN);
              //If the container is not null, unpack it.
              final BBContainer fcont = cont;
              long seqNo = cont.b().getLong(StreamBlock.SEQUENCE_NUMBER_OFFSET);
              long committedSeqNo = cont.b().getLong(StreamBlock.COMMIT_SEQUENCE_NUMBER_OFFSET);
              int tupleCount = cont.b().getInt(StreamBlock.ROW_NUMBER_OFFSET);
              long uniqueId = cont.b().getLong(StreamBlock.UNIQUE_ID_OFFSET);
  
              //Pass the stream block a subset of the bytes, provide
              //a container that discards the original returned by the persistent deque
              StreamBlock block = new StreamBlock( fcont,
                  schemaCont,
                  seqNo,
                  committedSeqNo,
                  tupleCount,
                  uniqueId,
                  segmentIndex,
                  true);
  
              //Optionally store a reference to the block in the in memory deque
              if (!actuallyPoll) {
                  m_memoryDeque.offer(block);
              }
              return block;
          }
      }
docs: Wrapper around the common operation of pulling an element out of the persistent deque.
  The behavior is complicated (and might change) since the persistent deque can throw an IOException.
  The poll always removes the element from the persistent queue
  (although not necessarily removing the file backing, that happens at deleteContents) and will add
  a reference to the block to the in memory deque unless actuallyPoll is true.
  @param actuallyPoll
  @return