Package com.linkedin.databus2.ggParser.staxparser

Examples of com.linkedin.databus2.ggParser.staxparser.StaxBuilderTest


  public void missingTokensCheck()
      throws Exception
  {
    BasicOperationsCheckCallback callback = new BasicOperationsCheckCallback();
    try{
      StaxBuilderTest test = new StaxBuilderTest(actualXmlDataDir+"missingtokens.xml",service, callback);
      test.processXml();
      Assert.fail("Test has not detected failure on missing tokens");
    }
    catch(DatabusException e)
    {
      LOG.info("Caught databus exception, verifying if it's for missing tokens..");
View Full Code Here


  @Test
  public void nullFieldsCheck()
      throws Exception
  {
    NullFieldsCallback callback = new NullFieldsCallback();
    StaxBuilderTest test = new StaxBuilderTest(actualXmlDataDir+"nullfields.xml",service, callback);
    test.processXml();
  }
View Full Code Here

  @Test
  public void sortMultipleSourcesCheck()
      throws Exception
  {
    SortCheckCallback callback = new SortCheckCallback();
    StaxBuilderTest test = new StaxBuilderTest(actualXmlDataDir+"sortMultipleSources.xml",service, callback);
    test.processXml();
  }
View Full Code Here

  @Test
  public void nullTransactionsTest()
      throws Exception
  {
    BasicOperationsCheckCallback callback = new BasicOperationsCheckCallback();
    StaxBuilderTest test = new StaxBuilderTest(actualXmlDataDir+"nullTransactions.xml",service, callback);
    test.processXml();
  }
View Full Code Here

    // Create the event producer
    String uri = pConfig.getUri();
    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 !!");
View Full Code Here

    LOG.info("Starting. Producers are :" + _producers);

    for (Entry<PhysicalPartition, EventProducer> entry : _producers
        .entrySet()) {
      EventProducer producer = entry.getValue();
      // now start the default DB puller thread; depending on
      // configuration setting / cmd line
      if (this.getDbPullerStart()) {
        if (producer != null) {
          LOG.info("starting db puller: " + producer.getName());
          producer.start(-1L);
          LOG.info("db puller started: " + producer.getName());
        }
      }
    }
  }
View Full Code Here

  @Override
  public void pause() {
    for (Entry<PhysicalPartition, EventProducer> entry : _producers
        .entrySet()) {
      EventProducer producer = entry.getValue();

      if (null != producer) {
        if (producer.isRunning()) {
          producer.pause();
          LOG.info("EventProducer :" + producer.getName()
              + "  pause sent");
        } else if (producer.isPaused()) {
          LOG.info("EventProducer :" + producer.getName()
              + "  already paused");
        }
      }
    }
  }
View Full Code Here

  @Override
  public void resume() {
    for (Entry<PhysicalPartition, EventProducer> entry : _producers
        .entrySet()) {
      EventProducer producer = entry.getValue();
      if (null != producer) {
        if (producer.isPaused()) {
          producer.unpause();
          LOG.info("EventProducer :" + producer.getName()
              + "  resume sent");
        } else if (producer.isRunning()) {
          LOG.info("EventProducer :" + producer.getName()
              + "  already running");
        }
      }
    }
  }
View Full Code Here

  protected void doShutdown() {
    LOG.warn("Shutting down Relay!");
    for (Entry<PhysicalPartition, EventProducer> entry : _producers
        .entrySet()) {
      PhysicalPartition pPartition = entry.getKey();
      EventProducer producer = entry.getValue();

      if (null != producer
          && (producer.isRunning() || producer.isPaused())) {
        producer.shutdown();
        try {
          producer.waitForShutdown();
        } catch (InterruptedException ie) {
        }
        LOG.info("EventProducer is shutdown!");
      }
View Full Code Here

              .getStatsCollector(statsCollectorName),
          maxScnReaderWriters);
    } else if (uri.startsWith("mock")) {
      // Get all relevant pConfig attributes
      //TODO add real instantiation
      EventProducerServiceProvider mockProvider = _producersRegistry.getEventProducerServiceProvider("mock");
      if (null == mockProvider)
      {
        throw new DatabusRuntimeException("relay event producer not available: " + "mock");
      }
      producer = mockProvider.createProducer(pConfig, schemaRegistryService,
                                             dbusEventBuffer,
                                             _inBoundStatsCollectors
                                                     .getStatsCollector(statsCollectorName),
                                             maxScnReaderWriters);
    } else if (uri.startsWith("gg:")){
      producer = new GoldenGateEventProducer(pConfig,
                                             schemaRegistryService,
                                             dbusEventBuffer,
                                             _inBoundStatsCollectors
                                                 .getStatsCollector(statsCollectorName),
                                             maxScnReaderWriters);

    } else if (uri.startsWith("mysql:")){
       LOG.info("Adding OpenReplicatorEventProducer for uri :" + uri);
       final String serviceName = "or";
       EventProducerServiceProvider orProvider = _producersRegistry.getEventProducerServiceProvider(serviceName);
       if (null == orProvider)
       {
         throw new DatabusRuntimeException("relay event producer not available: " + serviceName);
       }
       producer = orProvider.createProducer(pConfig, schemaRegistryService,
                                            dbusEventBuffer,
                                            _inBoundStatsCollectors.getStatsCollector(statsCollectorName),
                                            maxScnReaderWriters);
    } else
     {
View Full Code Here

TOP

Related Classes of com.linkedin.databus2.ggParser.staxparser.StaxBuilderTest

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.