Search in sources :

Example 1 with LedgerAllocatorDelegator

use of com.twitter.distributedlog.bk.LedgerAllocatorDelegator in project distributedlog by twitter.

the class BKDistributedLogManager method createLedgerAllocator.

// Create Ledger Allocator
LedgerAllocator createLedgerAllocator(ZKLogMetadataForWriter logMetadata) throws IOException {
    LedgerAllocator ledgerAllocatorDelegator;
    if (!dynConf.getEnableLedgerAllocatorPool()) {
        QuorumConfigProvider quorumConfigProvider = new DynamicQuorumConfigProvider(dynConf);
        LedgerAllocator allocator = new SimpleLedgerAllocator(logMetadata.getAllocationPath(), logMetadata.getAllocationData(), quorumConfigProvider, writerZKC, writerBKC);
        ledgerAllocatorDelegator = new LedgerAllocatorDelegator(allocator, true);
    } else {
        ledgerAllocatorDelegator = ledgerAllocator;
    }
    return ledgerAllocatorDelegator;
}
Also used : SimpleLedgerAllocator(com.twitter.distributedlog.bk.SimpleLedgerAllocator) LedgerAllocator(com.twitter.distributedlog.bk.LedgerAllocator) SimpleLedgerAllocator(com.twitter.distributedlog.bk.SimpleLedgerAllocator) QuorumConfigProvider(com.twitter.distributedlog.bk.QuorumConfigProvider) DynamicQuorumConfigProvider(com.twitter.distributedlog.bk.DynamicQuorumConfigProvider) LedgerAllocatorDelegator(com.twitter.distributedlog.bk.LedgerAllocatorDelegator) DynamicQuorumConfigProvider(com.twitter.distributedlog.bk.DynamicQuorumConfigProvider)

Aggregations

DynamicQuorumConfigProvider (com.twitter.distributedlog.bk.DynamicQuorumConfigProvider)1 LedgerAllocator (com.twitter.distributedlog.bk.LedgerAllocator)1 LedgerAllocatorDelegator (com.twitter.distributedlog.bk.LedgerAllocatorDelegator)1 QuorumConfigProvider (com.twitter.distributedlog.bk.QuorumConfigProvider)1 SimpleLedgerAllocator (com.twitter.distributedlog.bk.SimpleLedgerAllocator)1