@Override
  public void addAttributes(final Map<String, String> attributesMap, final PartialPath fullPath)
      throws MetadataException, IOException {
    final IMeasurementMNode<IMemMNode> leafMNode = mTree.getMeasurementMNode(fullPath);

    // no tag or attribute, we need to add a new record in log
    if (leafMNode.getOffset() < 0) {
      long offset = tagManager.writeTagFile(Collections.emptyMap(), attributesMap);
      writeToMLog(SchemaRegionWritePlanFactory.getChangeTagOffsetPlan(fullPath, offset));
      leafMNode.setOffset(offset);
      return;
    }

    tagManager.addAttributes(attributesMap, fullPath, leafMNode);
  }
Add new attributes key-value for the timeseries

@param attributesMap newly added attributes map
@param fullPath timeseries
@throws MetadataException tagLogFile write error or attributes already exist
iotdb-core/datanode/src/main/java/org/apache/iotdb/db/schemaengine/schemaregion/impl/SchemaRegionMemoryImpl.java