mirror of
https://github.com/twitter/the-algorithm.git
synced 2024-06-01 00:38:46 +02:00
ef4c5eb65e
Please note we have force-pushed a new initial commit in order to remove some publicly-available Twitter user information. Note that this process may be required in the future.
42 lines
1.4 KiB
Java
42 lines
1.4 KiB
Java
package com.twitter.search.earlybird.archive.segmentbuilder;
|
|
|
|
import com.twitter.common.quantity.Amount;
|
|
import com.twitter.common.quantity.Time;
|
|
import com.twitter.search.common.util.zktrylock.ZooKeeperTryLockFactory;
|
|
import com.twitter.search.earlybird.archive.ArchiveOnDiskEarlybirdIndexConfig;
|
|
|
|
public class SegmentConfig {
|
|
private final ArchiveOnDiskEarlybirdIndexConfig earlybirdIndexConfig;
|
|
private final Amount<Long, Time> segmentZKLockExpirationTime;
|
|
private final int maxRetriesOnFailure;
|
|
private final ZooKeeperTryLockFactory tryLockFactory;
|
|
|
|
public SegmentConfig(
|
|
ArchiveOnDiskEarlybirdIndexConfig earlybirdIndexConfig,
|
|
Amount<Long, Time> segmentZKLockExpirationTime,
|
|
int maxRetriesOnFailure,
|
|
ZooKeeperTryLockFactory tryLockFactory) {
|
|
|
|
this.earlybirdIndexConfig = earlybirdIndexConfig;
|
|
this.segmentZKLockExpirationTime = segmentZKLockExpirationTime;
|
|
this.maxRetriesOnFailure = maxRetriesOnFailure;
|
|
this.tryLockFactory = tryLockFactory;
|
|
}
|
|
|
|
public ArchiveOnDiskEarlybirdIndexConfig getEarlybirdIndexConfig() {
|
|
return earlybirdIndexConfig;
|
|
}
|
|
|
|
public Amount<Long, Time> getSegmentZKLockExpirationTime() {
|
|
return segmentZKLockExpirationTime;
|
|
}
|
|
|
|
public int getMaxRetriesOnFailure() {
|
|
return maxRetriesOnFailure;
|
|
}
|
|
|
|
public ZooKeeperTryLockFactory getTryLockFactory() {
|
|
return tryLockFactory;
|
|
}
|
|
}
|