ReplicationInfo.fromMap constructor

ReplicationInfo.fromMap(
  1. Map<String, String> map
)

Implementation

factory ReplicationInfo.fromMap(Map<String, String> map) {
  List<SlaveInfo> slaves = [];
  for (int i = 0; i < int.parse(map['connected_slaves'] ?? '0'); i++) {
    slaves.add(SlaveInfo.fromMap(map, i));
  }
  return ReplicationInfo(
    role: map['role'] ?? '',
    connectedSlaves: int.parse(map['connected_slaves'] ?? '0'),
    slaves: slaves,
    masterReplid: map['master_replid'] ?? '',
    masterReplid2: map['master_replid2'] ?? '',
    masterReplOffset: int.parse(map['master_repl_offset'] ?? '0'),
    secondReplOffset: int.parse(map['second_repl_offset'] ?? '0'),
    replBacklogActive: int.parse(map['repl_backlog_active'] ?? '0'),
    replBacklogSize: int.parse(map['repl_backlog_size'] ?? '0'),
    replBacklogFirstByteOffset:
        int.parse(map['repl_backlog_first_byte_offset'] ?? '0'),
    replBacklogHistlen: int.parse(map['repl_backlog_histlen'] ?? '0'),
  );
}