public List<T> read() {
        lock.lock();
        try {
            // Switch the read and write pointers, when there is no writing.
            BufferedData<T> tempPointer = writeBufferPointer;
            writeBufferPointer = readBufferPointer;
            readBufferPointer = tempPointer;
        } finally {
            lock.unlock();
        }
        // Call read method outside of write lock for concurrency read-write.
        return readBufferPointer.read();
    }
Write the collection of data into the {@link #writeBufferPointer} buffer.

@param data to enqueue.
oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/analysis/data/ReadWriteSafeCache.java