@Override
    protected void releaseSource() {
        while (running) {
            AgentUtils.silenceSleepInMs(1);
        }
        if (cosClient != null) {
            FileStatic data = new FileStatic();
            data.setTaskId(taskId);
            data.setRetry(String.valueOf(profile.isRetry()));
            data.setContentType(profile.get(COS_CONTENT_STYLE));
            data.setGroupId(profile.getInlongGroupId());
            data.setStreamId(profile.getInlongStreamId());
            data.setDataTime(format.format(profile.getSinkDataTime()));
            data.setFileName(profile.getInstanceId());
            data.setFileLen(String.valueOf(metadata.getContentLength()));
            data.setReadBytes(String.valueOf(bytePosition));
            data.setReadLines(String.valueOf(linePosition));
            OffsetProfile offsetProfile = OffsetManager.getInstance().getOffset(taskId, instanceId);
            if (offsetProfile != null) {
                data.setSendLines(offsetProfile.getOffset());
            }
            FileStaticManager.putStaticMsg(data);
            cosClient.shutdown();
        }
        while (!queue.isEmpty()) {
            MemoryManager.getInstance().release(AGENT_GLOBAL_COS_SOURCE_PERMIT, queue.poll().getData().length);
        }
    }
Read new lines.

@return The new position after the lines have been read
@throws IOException if an I/O error occurs.
inlong-agent/agent-plugins/src/main/java/org/apache/inlong/agent/plugin/sources/COSSource.java