public static WALProtos.BulkLoadDescriptor toBulkLoadDescriptor(TableName tableName,
    ByteString encodedRegionName, Map<byte[], List<Path>> storeFiles,
    Map<String, Long> storeFilesSize, long bulkloadSeqId, List<String> clusterIds,
    boolean replicate) {
    BulkLoadDescriptor.Builder desc =
      BulkLoadDescriptor.newBuilder().setTableName(ProtobufUtil.toProtoTableName(tableName))
        .setEncodedRegionName(encodedRegionName).setBulkloadSeqNum(bulkloadSeqId)
        .setReplicate(replicate);
    if (clusterIds != null) {
      desc.addAllClusterIds(clusterIds);
    }

    for (Map.Entry<byte[], List<Path>> entry : storeFiles.entrySet()) {
      WALProtos.StoreDescriptor.Builder builder =
        StoreDescriptor.newBuilder().setFamilyName(UnsafeByteOperations.unsafeWrap(entry.getKey()))
          .setStoreHomeDir(Bytes.toString(entry.getKey())); // relative to region
      for (Path path : entry.getValue()) {
        String name = path.getName();
        builder.addStoreFile(name);
        Long size = storeFilesSize.get(name) == null ? (Long) 0L : storeFilesSize.get(name);
        builder.setStoreFileSizeBytes(size);
      }
      desc.addStores(builder);
    }

    return desc.build();
  }
Generates a marker for the WAL so that we propagate the notion of a bulk region load throughout
the WAL.
@param tableName         The tableName into which the bulk load is being imported into.
@param encodedRegionName Encoded region name of the region which is being bulk loaded.
@param storeFiles        A set of store files of a column family are bulk loaded.
@param storeFilesSize    Map of store files and their lengths
@param bulkloadSeqId     sequence ID (by a force flush) used to create bulk load hfile name
@return The WAL log marker for bulk loads.
hbase-client/src/main/java/org/apache/hadoop/hbase/shaded/protobuf/ProtobufUtil.java