use of io.pravega.segmentstore.contracts.tables.TableSegmentConfig in project pravega by pravega.
the class ContainerTableExtensionImpl method createSegment.
// endregion
// region TableStore Implementation
@Override
public CompletableFuture<Void> createSegment(@NonNull String segmentName, SegmentType segmentType, TableSegmentConfig config, Duration timeout) {
Exceptions.checkNotClosed(this.closed.get(), this);
// Ensure at least a TableSegment type.
segmentType = SegmentType.builder(segmentType).tableSegment().build();
val attributes = new HashMap<>(TableAttributes.DEFAULT_VALUES);
attributes.putAll(selectLayout(segmentName, segmentType).getNewSegmentAttributes(config));
val attributeUpdates = attributes.entrySet().stream().map(e -> new AttributeUpdate(e.getKey(), AttributeUpdateType.None, e.getValue())).collect(Collectors.toList());
logRequest("createSegment", segmentName, segmentType, config);
return this.segmentContainer.createStreamSegment(segmentName, segmentType, attributeUpdates, timeout);
}
Aggregations