Package com.linkedin.databus2.test.container

Examples of com.linkedin.databus2.test.container.SimpleTestClientConnection


          UnsupportedKeyException, DatabusException, IllegalArgumentException,
          InstantiationException, IllegalAccessException, InvocationTargetException, SecurityException, NoSuchMethodException
  {
    short[] sourceIds = new short[] { 505, 506 };
    String[] sourceNames = new String[] { "source1", "source2" };
    PhysicalSourceStaticConfig pssc =
        buildSimplePssc(sourceIds, sourceNames, "gg:///tmp:xxx");
    long scn = 10;

    DbusEventBufferAppendable mb = createBufMult(pssc);
View Full Code Here


    // 1 event per second required. Send 5 events. Must have 4 sleeps.
    long rate = 1;
    int numEvents = 5;

    PhysicalSourceStaticConfig pssc = buildPssc(rate, throttleDurationInSecs);
    long scn = 10;
    DbusEventBufferAppendable mb = createBufMult(pssc);

    GoldenGateEventProducer gg = new GoldenGateEventProducer(pssc, null, mb,
        null, null);
View Full Code Here

    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

    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

{
  private final SourceIdNameRegistry _sourcesIdNameRegistry;

  public AbstractRelayFactory()
  {
    this(new SourceIdNameRegistry());
  }
View Full Code Here

  }

  public AbstractRelayFactory(SourceIdNameRegistry sourcesIdNameRegistry)
  {
    if(sourcesIdNameRegistry == null)
      sourcesIdNameRegistry = new SourceIdNameRegistry();
    _sourcesIdNameRegistry = sourcesIdNameRegistry;
  }
View Full Code Here

                     srcidCounts.get((short)2).intValue());

        //check metadata schemas

        EventCountingConsumer myCons = (EventCountingConsumer) mockConsumer;
        VersionedSchema metadataSchema = myCons.getMetadataSchema();
        Assert.assertTrue(null != metadataSchema);

        log.info("Metadata VersionedSchema = " + metadataSchema);
        Assert.assertEquals(metadataSchema.getVersion(),2);
        Assert.assertEquals(metadataSchema.getSchemaBaseName(), SchemaRegistryService.DEFAULT_METADATA_SCHEMA_SOURCE);

        verifyNoLocks(log, eventsBuf);
        log.info("end\n");
    }
View Full Code Here

        //It seems that there is a race condition between the writeFuture succeeding
        //and the writeComplete message getting to the handler. Make sure that the
        //writeComplete has got to the handler before we do anything else with
        //the channel.
        final GenericHttpResponseHandler handler = getResponseHandler(channel);
        TestUtil.assertWithBackoff(new ConditionCheck()
        {
          @Override
          public boolean check()
          {
            return handler._messageState.hasSentRequest();
          }
        }, "request sent", 1000, log);

        HttpResponse resp = new DefaultHttpResponse(HttpVersion.HTTP_1_1, HttpResponseStatus.SERVICE_UNAVAILABLE);
        resp.setHeader(HttpHeaders.Names.TRANSFER_ENCODING, HttpHeaders.Values.CHUNKED);
        sendServerResponse(clientAddr, resp, 2000);

        HttpChunk chunk1 = new DefaultHttpChunk(ChannelBuffers.wrappedBuffer("chunk1".getBytes(Charset.defaultCharset())));
        sendServerResponse(clientAddr, chunk1, 1000);

        sendServerResponse(clientAddr, new DefaultHttpChunkTrailer(), 1000);

        final List<String> callbacks = respProcessor.getCallbacks();
        TestUtil.assertWithBackoff(new ConditionCheck()
        {
          @Override
          public boolean check()
          {
            return 4 == callbacks.size();
View Full Code Here

TOP

Related Classes of com.linkedin.databus2.test.container.SimpleTestClientConnection

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.