hadoop-ozone/client/src/main/java/org/apache/hadoop/ozone/client/io/ChunkGroupOutputStream.java
public void addPreallocateBlocks(KsmKeyLocationInfoGroup version,
      long openVersion) throws IOException {
    // server may return any number of blocks, (0 to any)
    // only the blocks allocated in this open session (block createVersion
    // equals to open session version)
    for (KsmKeyLocationInfo subKeyInfo : version.getLocationList()) {
      if (subKeyInfo.getCreateVersion() == openVersion) {
        checkKeyLocationInfo(subKeyInfo);
      }
    }
  }
/**
   * When a key is opened, it is possible that there are some blocks already
   * allocated to it for this open session. In this case, to make use of these
   * blocks, we need to add these blocks to stream entries. But, a key's version
   * also includes blocks from previous versions, we need to avoid adding these
   * old blocks to stream entries, because these old blocks should not be picked
   * for write. To do this, the following method checks that, only those
   * blocks created in this particular open version are added to stream entries.
   *
   * @param version the set of blocks that are pre-allocated.
   * @param openVersion the version corresponding to the pre-allocation.
   * @throws IOException
   */
When a key is opened, it is possible that there are some blocks already
allocated to it for this open session. In this case, to make use of these
blocks, we need to add these blocks to stream entries. But, a key's version
also includes blocks from previous versions, we need to avoid adding these
old blocks to stream entries, because these old blocks should not be picked
for write. To do this, the following method checks that, only those
blocks created in this particular open version are added to stream entries.

@param version the set of blocks that are pre-allocated.
@param openVersion the version corresponding to the pre-allocation.
When a key is opened it is possible that there are some blocks already allocated to it for this open session . In this case to make use of these blocks we need to add these blocks to stream entries . But a key ' s version also includes blocks from previous versions we need to avoid adding these old blocks to stream entries because these old blocks should not be picked for write . To do this the following method checks that only those blocks created in this particular open version are added to stream entries . @param version the set of blocks that are pre - allocated . @param openVersion the version corresponding to the pre - allocation .
public void addPreallocateBlocks(KsmKeyLocationInfoGroup version,
      long openVersion) throws IOException {
    for (KsmKeyLocationInfo subKeyInfo : version.getLocationList()) {
      if (subKeyInfo.getCreateVersion() == openVersion) {
        checkKeyLocationInfo(subKeyInfo);
      }
    }
  }
public void addPreallocateBlocks ( KsmKeyLocationInfoGroup version , long openVersion ) throws IOException { for ( KsmKeyLocationInfo subKeyInfo : version . getLocationList ( ) ) { if ( subKeyInfo . getCreateVersion ( ) == openVersion ) { checkKeyLocationInfo ( subKeyInfo ) ; } } }
When a key is opened, it is possible that there are some blocks already
 allocated to it for this open session.
When a key is opened it is possible that there are some blocks already allocated to it for this open session .
// server may return any number of blocks, (0 to any) // only the blocks allocated in this open session (block createVersion // equals to open session version)