Skip to content

请问在put函数的实现中为什么要调用两次getLeastBlockPosition函数呢? #1

Description

@Wide-Sui

blockPosition = getLeastBlockPosition(getLeastBlockPosition(fileChannel.size())); //position()方法获取FileChannel的当前位置 Block block = new Block(blockPosition, dataCache.dataBuffer.position()); block.size = 10; blockMap.get(queueName).add(block); dataCache.dataBuffer.flip(); fileChannel.position(blockPosition); fileChannel.write(dataCache.dataBuffer); dataCache.dataBuffer.clear();

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions