use of io.pravega.segmentstore.storage.ReadOnlyLogMetadata in project pravega by pravega.
the class DebugBookKeeperLogWrapper method forceMetadataOverWrite.
/**
* Allows to overwrite the metadata of a BookkeeperLog. CAUTION: This is a destructive operation and should be
* used wisely for administration purposes (e.g., repair a damaged BookkeeperLog).
*
* @param metadata New metadata to set in the original BookkeeperLog metadata path.
* @throws DurableDataLogException in case there is a problem managing metadata from Zookeeper.
*/
@Override
public void forceMetadataOverWrite(ReadOnlyLogMetadata metadata) throws DurableDataLogException {
try {
byte[] serializedMetadata = LogMetadata.SERIALIZER.serialize((LogMetadata) metadata).getCopy();
this.log.getZkClient().setData().forPath(this.log.getLogNodePath(), serializedMetadata);
} catch (Exception e) {
throw new DurableDataLogException("Problem overwriting Bookkeeper Log metadata.", e);
}
}
Aggregations