MockMetadata(LedgerMetadata toCopy) { ensembleSize = toCopy.getEnsembleSize(); writeQuorumSize = toCopy.getWriteQuorumSize(); ackQuorumSize = toCopy.getAckQuorumSize(); lastEntryId = toCopy.getLastEntryId(); length = toCopy.getLength(); digestType = toCopy.getDigestType(); ctime = toCopy.getCtime(); isClosed = toCopy.isClosed(); customMetadata = ImmutableMap.copyOf(toCopy.getCustomMetadata()); }
/** * Get this ledger's customMetadata map. * * @return map containing user provided customMetadata. */ public Map<String, byte[]> getCustomMetadata() { return getLedgerMetadata().getCustomMetadata(); }
int writeQ = metadata.getWriteQuorumSize(); int ackQ = metadata.getAckQuorumSize(); Map<String, byte[]> customMetadata = metadata.getCustomMetadata();
lh.getLedgerMetadata().getWriteQuorumSize(), lh.getLedgerMetadata().getAckQuorumSize(), lh.getLedgerMetadata().getCustomMetadata(), ensemble, oldBookie,
public static LedgerMetadataBuilder from(LedgerMetadata other) { LedgerMetadataBuilder builder = new LedgerMetadataBuilder(); builder.metadataFormatVersion = other.getMetadataFormatVersion(); builder.ensembleSize = other.getEnsembleSize(); builder.writeQuorumSize = other.getWriteQuorumSize(); builder.ackQuorumSize = other.getAckQuorumSize(); builder.state = other.getState(); if (builder.state == State.CLOSED) { builder.lastEntryId = Optional.of(other.getLastEntryId()); builder.length = Optional.of(other.getLength()); } builder.ensembles.putAll(other.getAllEnsembles()); if (other.hasPassword()) { builder.password = Optional.of(other.getPassword()); builder.digestType = Optional.of(other.getDigestType()); } builder.ctime = other.getCtime(); /** Hack to get around fact that ctime was never versioned correctly */ builder.storeCtime = LedgerMetadataUtils.shouldStoreCtime(other); builder.customMetadata = ImmutableMap.copyOf(other.getCustomMetadata()); return builder; }
serializePassword(metadata.getPassword(), builder); Map<String, byte[]> customMetadata = metadata.getCustomMetadata(); if (customMetadata.size() > 0) { LedgerMetadataFormat.cMetadataMapEntry.Builder cMetadataBuilder =
Map<String, byte[]> customMetadata = metadata.getCustomMetadata(); if (customMetadata.size() > 0) { LedgerMetadataFormat.cMetadataMapEntry.Builder cMetadataBuilder =