Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[improve][ml] Optimize BlobStoreManagedLedgerOffloader.getOffloadPolicies #23776

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -98,15 +98,16 @@ public class BlobStoreManagedLedgerOffloader implements LedgerOffloader {

private final OrderedScheduler scheduler;
private final TieredStorageConfiguration config;
private final OffloadPolicies policies;
private final Location writeLocation;

// metadata to be stored as part of the offloaded ledger metadata
private final Map<String, String> userMetadata;

private final ConcurrentMap<BlobStoreLocation, BlobStore> blobStores = new ConcurrentHashMap<>();
private OffloadSegmentInfoImpl segmentInfo;
private AtomicLong bufferLength = new AtomicLong(0);
private AtomicLong segmentLength = new AtomicLong(0);
private final AtomicLong bufferLength = new AtomicLong(0);
private final AtomicLong segmentLength = new AtomicLong(0);
private final long maxBufferLength;
private final OffsetsCache entryOffsetsCache;
private final ConcurrentLinkedQueue<Entry> offloadBuffer = new ConcurrentLinkedQueue<>();
Expand Down Expand Up @@ -138,6 +139,9 @@ public static BlobStoreManagedLedgerOffloader create(TieredStorageConfiguration
this.scheduler = scheduler;
this.userMetadata = userMetadata;
this.config = config;
Properties properties = new Properties();
properties.putAll(config.getConfigProperties());
this.policies = OffloadPoliciesImpl.create(properties);
this.streamingBlockSize = config.getMinBlockSizeInBytes();
this.maxSegmentCloseTime = Duration.ofSeconds(config.getMaxSegmentTimeInSecond());
this.maxSegmentLength = config.getMaxSegmentSizeInBytes();
Expand Down Expand Up @@ -658,9 +662,7 @@ public CompletableFuture<Void> deleteOffloaded(UUID uid, Map<String, String> off

@Override
public OffloadPolicies getOffloadPolicies() {
Properties properties = new Properties();
properties.putAll(config.getConfigProperties());
return OffloadPoliciesImpl.create(properties);
return this.policies;
}

@Override
Expand Down
Loading