Search in sources :

Example 1 with SimpleLedgerAllocator

use of org.apache.distributedlog.bk.SimpleLedgerAllocator in project bookkeeper by apache.

the class BKLogSegmentEntryStore method createLedgerAllocator.

// 
// Writers
// 
LedgerAllocator createLedgerAllocator(LogMetadataForWriter logMetadata, DynamicDistributedLogConfiguration dynConf) throws IOException {
    LedgerAllocator ledgerAllocatorDelegator;
    if (null == allocator || !dynConf.getEnableLedgerAllocatorPool()) {
        QuorumConfigProvider quorumConfigProvider = new DynamicQuorumConfigProvider(dynConf);
        LedgerAllocator allocator = new SimpleLedgerAllocator(logMetadata.getAllocationPath(), logMetadata.getAllocationData(), quorumConfigProvider, zkc, bkc);
        ledgerAllocatorDelegator = new LedgerAllocatorDelegator(allocator, true);
    } else {
        ledgerAllocatorDelegator = allocator;
    }
    return ledgerAllocatorDelegator;
}
Also used : SimpleLedgerAllocator(org.apache.distributedlog.bk.SimpleLedgerAllocator) LedgerAllocator(org.apache.distributedlog.bk.LedgerAllocator) SimpleLedgerAllocator(org.apache.distributedlog.bk.SimpleLedgerAllocator) QuorumConfigProvider(org.apache.distributedlog.bk.QuorumConfigProvider) DynamicQuorumConfigProvider(org.apache.distributedlog.bk.DynamicQuorumConfigProvider) LedgerAllocatorDelegator(org.apache.distributedlog.bk.LedgerAllocatorDelegator) DynamicQuorumConfigProvider(org.apache.distributedlog.bk.DynamicQuorumConfigProvider)

Aggregations

DynamicQuorumConfigProvider (org.apache.distributedlog.bk.DynamicQuorumConfigProvider)1 LedgerAllocator (org.apache.distributedlog.bk.LedgerAllocator)1 LedgerAllocatorDelegator (org.apache.distributedlog.bk.LedgerAllocatorDelegator)1 QuorumConfigProvider (org.apache.distributedlog.bk.QuorumConfigProvider)1 SimpleLedgerAllocator (org.apache.distributedlog.bk.SimpleLedgerAllocator)1