use of org.apache.bookkeeper.stream.proto.StreamMetadata in project bookkeeper by apache.
the class MetaRangeImpl method loadStreamMetadata.
private void loadStreamMetadata(long streamId, byte[] streamMetadataBytes) {
this.streamId = streamId;
StreamMetadata metadata;
try {
metadata = StreamMetadata.parseFrom(streamMetadataBytes);
} catch (InvalidProtocolBufferException e) {
throw new RuntimeException("Invalid stream metadata of stream " + streamId, e);
}
this.streamProps = metadata.getProps();
this.lifecycleState = metadata.getLifecycleState();
this.servingState = metadata.getServingState();
this.currentRanges.clear();
this.currentRanges.addAll(metadata.getCurrentRangesList());
this.nextRangeId = metadata.getNextRangeId();
this.cTime = metadata.getCTime();
this.mTime = metadata.getMTime();
}
Aggregations