private static AttributesBuilder builderFromContext(Context context) {
    final AttributesBuilder attributesBuilder = Attributes.builder();
    Optional.ofNullable(context)
      .map(val -> val.get(HFileContextAttributesBuilderConsumer.CONTEXT_KEY))
      .ifPresent(c -> c.accept(attributesBuilder));
    return attributesBuilder;
  }
Construct a fresh {@link AttributesBuilder} from the provided {@link Context}, populated with
relevant attributes populated by {@link HFileContextAttributesBuilderConsumer#CONTEXT_KEY}.
hbase-common/src/main/java/org/apache/hadoop/hbase/io/util/BlockIOUtils.java