public static Optional<String> getSyncReplicationPeerIdFromWALName(String name) {
    if (!name.endsWith(ReplicationUtils.SYNC_WAL_SUFFIX)) {
      // fast path to return earlier if the name is not for a sync replication peer.
      return Optional.empty();
    }
    String logPrefix = AbstractFSWALProvider.getWALPrefixFromWALName(name);
    Matcher matcher = LOG_PREFIX_PATTERN.matcher(logPrefix);
    if (matcher.matches()) {
      return Optional.of(matcher.group(1));
    } else {
      return Optional.empty();
    }
  }
<p>
Returns the peer id if the wal file name is in the special group for a sync replication peer.
</p>
<p>
The prefix format is &lt;factoryId&gt;-&lt;ts&gt;-&lt;peerId&gt;.
</p>
hbase-server/src/main/java/org/apache/hadoop/hbase/wal/AbstractWALProvider.java