Package com.linkedin.databus2.relay.config

Examples of com.linkedin.databus2.relay.config.PhysicalSourceStaticConfig


    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);
View Full Code Here


  @BeforeTest
  public void setUpTest () throws IOException, InvalidConfigException {
    LOG.info("Setting up Test");

    PhysicalSourceStaticConfig pStatConf1 = convertToPhysicalSourceConfig(_configSource1).build();
    PhysicalSourceStaticConfig pStatConf2 = convertToPhysicalSourceConfig(_configSource2).build();
    PhysicalSourceStaticConfig pStatConf3 = convertToPhysicalSourceConfig(_configSource3).build();

    _pConfigs =  new PhysicalSourceStaticConfig [] {pStatConf1, pStatConf2, pStatConf3};

    // generate testData
    int scn = 100;
View Full Code Here

  @Test
  public void verifyReadingLogicalPartitionWildcard() throws IOException, ScnNotFoundException, InvalidConfigException, DatabusException, OffsetNotFoundException {
     createBufMult();

     PhysicalSourceStaticConfig pStatConf1 = convertToPhysicalSourceConfig(_configSource1).build();
     PhysicalSourceStaticConfig pStatConf2 = convertToPhysicalSourceConfig(_configSource2).build();

     PhysicalPartition pP = pStatConf1.getPhysicalPartition();
     DbusEventBufferAppendable buf = _eventBufferMult.getDbusEventBufferAppendable(pP);

     buf.startEvents();
     byte [] schema = "abcdefghijklmnop".getBytes(Charset.defaultCharset());
     assertTrue(buf.appendEvent(new DbusEventKey(1), (short)100, (short)0,
                                   System.currentTimeMillis() * 1000000, (short)2,
                                   schema, new byte[100], false, null));

     assertTrue(buf.appendEvent(new DbusEventKey(1), (short)100, (short)1,
         System.currentTimeMillis() * 1000000, (short)2,
         schema, new byte[100], false, null));
     buf.endEvents(100, null);

     pP = pStatConf2.getPhysicalPartition();
     buf = _eventBufferMult.getDbusEventBufferAppendable(pP);
     buf.startEvents();

     assertTrue(buf.appendEvent(new DbusEventKey(1), (short)101, (short)2,
         System.currentTimeMillis() * 1000000, (short)2,
View Full Code Here

    Set<Integer> srcIds = new HashSet<Integer>(2);
    srcIds.add(1);

    // total expected events from source 1 is 5
    batchReading(srcIds, 5);
    PhysicalSourceStaticConfig pConfig = convertToPhysicalSourceConfig(_configSource3).build();
    LOG.info("one more buffer for " + pConfig);
    DbusEventBuffer buf = _eventBufferMult.addNewBuffer(pConfig, _config);
    buf.start(100);

    // add events to the new buffer
    byte [] schema = "ABCDEFGHIJKLMNOP".getBytes(Charset.defaultCharset());
    for(int i=100; i<110; i++) {
      if(i%2 == 0)
        buf.startEvents();
      assertTrue(buf.appendEvent(new DbusEventKey(i),
                                 pConfig.getPhysicalPartition().getId().shortValue(),
                                 (short)0, // logical source id
                                 System.currentTimeMillis(),
                                 (short)(i<105?21:22),
                                 schema,
                                 (""+i).getBytes(Charset.defaultCharset()), false, null));
View Full Code Here

  @Test
  public void addRemoveBufferMapping() throws InvalidConfigException, DatabusException {
    createBufMult();

    PhysicalSourceStaticConfig pConfig = convertToPhysicalSourceConfig(_configSource2).build();
    PhysicalPartition pPart = _eventBufferMult.getPhysicalPartition(11);
    Assert.assertNotNull(pPart);
    DbusEventBuffer buf = _eventBufferMult.getDbusEventBuffer(pConfig.getSources()[0].getLogicalSource());
    Assert.assertNotNull(buf);
    DbusEventBuffer buf1 = _eventBufferMult.getOneBuffer(pPart);
    Assert.assertNotNull(buf1);
    Assert.assertTrue(buf == buf1, "same references to the buffer");

    // now remove the buffer and the mapping
    _eventBufferMult.removeBuffer(pConfig);
    _eventBufferMult.deallocateRemovedBuffers(true);

    // same should fail
    pPart = _eventBufferMult.getPhysicalPartition(11);
    Assert.assertNull(pPart);
    buf = _eventBufferMult.getDbusEventBuffer(pConfig.getSources()[0].getLogicalSource());
    Assert.assertNull(buf);
    buf1 = _eventBufferMult.getOneBuffer(pPart);
    Assert.assertNull(buf1);

View Full Code Here

      isr.close();
      isr = new InputStreamReader(IOUtils.toInputStream(_configSource2));
      PhysicalSourceConfig pConfig2 = mapper.readValue(isr, PhysicalSourceConfig.class);

      PhysicalSourceStaticConfig pStatConf1 = pConfig1.build();
      PhysicalSourceStaticConfig pStatConf2 = pConfig2.build();

      _physConfigs =  new PhysicalSourceStaticConfig [] {pStatConf1, pStatConf2};

      DbusEventBuffer.Config conf = new DbusEventBuffer.Config();
      conf.setAllocationPolicy("MMAPPED_MEMORY");
View Full Code Here

    isr.close();
    isr = new InputStreamReader(IOUtils.toInputStream(TestDbusEventBufferMult._configSource2));
    PhysicalSourceConfig pConfig2 = mapper.readValue(isr, PhysicalSourceConfig.class);

    PhysicalSourceStaticConfig pStatConf1 = pConfig1.build();
    PhysicalSourceStaticConfig pStatConf2 = pConfig2.build();

    PhysicalSourceStaticConfig[] _physConfigs =  new PhysicalSourceStaticConfig [] {pStatConf1, pStatConf2};

    return new DbusEventBufferMult(_physConfigs, config, new DbusEventV2Factory());
  }
View Full Code Here

    if(uri == null)
      throw new DatabusException("Uri is required to start the relay");
    uri = uri.trim();
    EventProducer producer = null;
    if (uri.startsWith("jdbc:")) {
      SourceType sourceType = pConfig.getReplBitSetter().getSourceType();
          if (SourceType.TOKEN.equals(sourceType))
            throw new DatabusException("Token Source-type for Replication bit setter config cannot be set for trigger-based Databus relay !!");

      // if a buffer for this partiton exists - we are overwri
      producer = new OracleEventProducerFactory().buildEventProducer(
View Full Code Here

          break;

        default:
          break;
      }
      SchemaId schemaId = schemaStr != null ? SchemaId.createWithMd5(schemaStr) : null;
      byte[] schemaBytes = schemaId != null? schemaId.getByteArray(): new byte[16];
      initBufferWithEvents(eventsBuf, keyBase, numEvents, srcId,schemaBytes, keyCounts, srcidCounts);
    }
View Full Code Here

    // Get the event buffer
    DbusEventBufferAppendable dbusEventBuffer = getEventBuffer()
        .getDbusEventBufferAppendable(pPartition);

    // Get the schema registry service
    SchemaRegistryService schemaRegistryService = getSchemaRegistryService();

    // Get a stats collector per physical source
    addPhysicalPartitionCollectors(pPartition);
    String statsCollectorName = pPartition.toSimpleString();
    /*
 
View Full Code Here

TOP

Related Classes of com.linkedin.databus2.relay.config.PhysicalSourceStaticConfig

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.