public static Pair<SyncReplicationState, SyncReplicationState>
    parseStateAndNewStateFrom(byte[] bytes) throws IOException {
    ByteArrayInputStream in = new ByteArrayInputStream(bytes);
    ByteStreams.skipFully(in, ProtobufMagic.lengthOfPBMagic());
    SyncReplicationState state = ReplicationPeerConfigUtil
      .toSyncReplicationState(ReplicationProtos.SyncReplicationState.parseDelimitedFrom(in));
    SyncReplicationState newState = ReplicationPeerConfigUtil
      .toSyncReplicationState(ReplicationProtos.SyncReplicationState.parseDelimitedFrom(in));
    return Pair.newPair(state, newState);
  }
Used by synchronous replication. Indicate the state of the current cluster in a synchronous
replication peer. The state may be one of {@link SyncReplicationState#ACTIVE},
{@link SyncReplicationState#DOWNGRADE_ACTIVE} or {@link SyncReplicationState#STANDBY}.
<p>
For asynchronous replication, the state is {@link SyncReplicationState#NONE}.
hbase-client/src/main/java/org/apache/hadoop/hbase/replication/SyncReplicationState.java