use of com.linkedin.databus2.core.BackoffTimerStaticConfigBuilder in project databus by linkedin.
the class DatabusRelayTestUtil method createPhysicalConfigBuilder.
public static PhysicalSourceConfig createPhysicalConfigBuilder(short id, String name, String uri, long pollIntervalMs, int eventRatePerSec, long restartScnOffset, int largestEventSize, long largestWindowSize, LogicalSourceConfig[] lSourceConfigs) {
PhysicalSourceConfig pConfig = new PhysicalSourceConfig();
pConfig.setId(id);
pConfig.setName(name);
pConfig.setUri(uri);
pConfig.setEventRatePerSec(eventRatePerSec);
pConfig.setRestartScnOffset(restartScnOffset);
pConfig.setLargestEventSizeInBytes(largestEventSize);
pConfig.setLargestWindowSizeInBytes(largestWindowSize);
BackoffTimerStaticConfigBuilder retriesConf = new BackoffTimerStaticConfigBuilder();
retriesConf.setInitSleep(pollIntervalMs);
pConfig.setRetries(retriesConf);
for (LogicalSourceConfig lConf : lSourceConfigs) {
pConfig.addSource(lConf);
}
return pConfig;
}
use of com.linkedin.databus2.core.BackoffTimerStaticConfigBuilder in project databus by linkedin.
the class TestGoldenGateEventProducer method buildPssc.
private PhysicalSourceStaticConfig buildPssc(long rate, long throttleDuration) throws InvalidConfigException {
String name = "anet";
short id = 505, partition = 0;
String uri = "gg:///mnt/dbext/x1";
String resourceKey = "test";
String partitionFunction = "constant:1";
boolean skipInfinityScn = false;
String queryHints = null;
LogicalSourceStaticConfig[] sources = new LogicalSourceStaticConfig[1];
LogicalSourceStaticConfig lssc = new LogicalSourceStaticConfig(id, name, uri, partitionFunction, partition, skipInfinityScn, queryHints, queryHints, queryHints);
sources[0] = lssc;
String role = "MASTER";
long slowSourceQueryThreshold = 0L;
long restartScnOffset = 0L;
BackoffTimerStaticConfigBuilder bsc = new BackoffTimerStaticConfigBuilder();
ChunkingType ct = ChunkingType.NO_CHUNKING;
long txnsPerChunk = 0L;
long scnChunkSize = 0L;
long chunkedScnThreshold = 0L;
long maxScnDelayMs = 0L;
long eventRatePerSec = rate;
long eventRateThrottleDuration = throttleDuration;
int largestEventSizeInBytes = 10240;
long largestWindowSizeInBytes = 10240;
DbusEventBuffer.Config cfgBuilder = new DbusEventBuffer.Config();
cfgBuilder.setMaxSize(10 * 1024 * 1024);
cfgBuilder.setScnIndexSize(2 * 1024 * 1024);
cfgBuilder.setAllocationPolicy("MMAPPED_MEMORY");
DbusEventBuffer.StaticConfig dbusEventBuffer = cfgBuilder.build();
boolean errorOnMissingFields = true;
String xmlVersion = "1.0";
String xmlEncoding = "";
String fieldName = "";
String regex = "";
ReplicationBitSetterStaticConfig replicationBitSetter = new ReplicationBitSetterStaticConfig(ReplicationBitSetterStaticConfig.SourceType.NONE, fieldName, regex, MissingValueBehavior.STOP_WITH_ERROR);
PhysicalSourceStaticConfig pssc = new PhysicalSourceStaticConfig(name, id, uri, resourceKey, sources, role, slowSourceQueryThreshold, restartScnOffset, bsc.build(), ct, txnsPerChunk, scnChunkSize, chunkedScnThreshold, maxScnDelayMs, eventRatePerSec, eventRateThrottleDuration, dbusEventBuffer, largestEventSizeInBytes, largestWindowSizeInBytes, errorOnMissingFields, xmlVersion, xmlEncoding, replicationBitSetter);
return pssc;
}
Aggregations