return parseVersion1Config(lc, reader);
}
LedgerMetadataFormat.Builder builder = LedgerMetadataFormat.newBuilder();
TextFormat.merge(reader, builder);
LedgerMetadataFormat data = builder.build();
lc.writeQuorumSize = data.getQuorumSize();
if (data.hasAckQuorumSize()) {
lc.ackQuorumSize = data.getAckQuorumSize();
} else {
lc.ackQuorumSize = lc.writeQuorumSize;
}
lc.ensembleSize = data.getEnsembleSize();
lc.length = data.getLength();
lc.state = data.getState();
lc.lastEntryId = data.getLastEntryId();
if (data.hasPassword()) {
lc.digestType = data.getDigestType();
lc.password = data.getPassword().toByteArray();
lc.hasPassword = true;
}
for (LedgerMetadataFormat.Segment s : data.getSegmentList()) {
ArrayList<InetSocketAddress> addrs = new ArrayList<InetSocketAddress>();
for (String member : s.getEnsembleMemberList()) {
addrs.add(StringUtils.parseAddr(member));
}
lc.addEnsemble(s.getFirstEntryId(), addrs);