default String getMemberName() {
    DistributedMember member = getCache().getDistributedSystem().getDistributedMember();

    // if this member has name, use it, otherwise, use the id
    String memberName = member.getName();
    if (!Strings.isBlank(memberName)) {
      return memberName;
    }

    return member.getId();
  }
a convenience method to get the name of the member this function executes on. call this
function once in your function execution to avoid performance issues.

@return member name or id if name is blank
geode-core/src/main/java/org/apache/geode/cache/execute/FunctionContext.java