the-algorithm/src/java/com/twitter/search/earlybird/archive/segmentbuilder/SegmentConfig.java
twitter-team ef4c5eb65e Twitter Recommendation Algorithm
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.
2023-03-31 17:36:31 -05:00

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;
}
}