Examples of DbusEventBufferMult


Examples of com.linkedin.databus.core.DbusEventBufferMult

    }

    PhysicalSourceStaticConfig [] pConfigs = new PhysicalSourceStaticConfig[1];
    pConfigs[0] = pssc;

    DbusEventBufferMult eventBufferMult = new DbusEventBufferMult(pConfigs, config, new DbusEventV2Factory());
    for(DbusEventBuffer b : eventBufferMult.bufIterable()) {
      b.start(1);
    }
    DbusEventBufferAppendable buf = eventBufferMult.getDbusEventBufferAppendable(505);
    return buf;
  }
View Full Code Here

Examples of com.linkedin.databus.core.DbusEventBufferMult

      final DatabusRelayMain relay1 = createRelay(relayPort, pId, srcs);
      Assert.assertNotNull(relay1);
      r1 = new DatabusRelayTestUtil.RelayRunner(relay1);
      log.info("Relay created");

      DbusEventBufferMult bufMult = relay1.getEventBuffer();


      String pSourceName = DatabusRelayTestUtil.getPhysicalSrcName(srcs[0]);
      PhysicalPartition pPartition = new PhysicalPartition(pId, pSourceName);
      DbusEventBufferAppendable buf = bufMult.getDbusEventBufferAppendable(pPartition);
      DbusEventKey key = new DbusEventKey(123L);
      byte[] schemaId = relay1.getSchemaRegistryService().fetchSchemaIdForSourceNameAndVersion(srcs[0], 2).getByteArray();
      byte[] payload = RngUtils.randomString(100).getBytes(Charset.defaultCharset());
      DbusEventInfo eventInfo = new DbusEventInfo(DbusOpcode.UPSERT, 100L, (short)pId, (short)pId, 897L,
                                                  (short)srcId, schemaId, payload, false, true);
View Full Code Here

Examples of com.linkedin.databus.core.DbusEventBufferMult

    {
      //EventProducer[] producers = relay1.getProducers();
      r1 = new DatabusRelayTestUtil.RelayRunner(relay1);
      log.info("Relay created");

      DbusEventBufferMult bufMult = relay1.getEventBuffer();
      PhysicalPartition pPartition = new PhysicalPartition((int)pId, pSourceName);
      DbusEventBuffer buf = (DbusEventBuffer)bufMult.getDbusEventBufferAppendable(pPartition);

      log.info("create some events");
      long windowScn = 100L;
      ByteBuffer serializationBuffer = addEvent(windowScn, srcId, relay1.getSchemaRegistryService().fetchSchemaIdForSourceNameAndVersion(srcs[0], 2).getByteArray(),
          pId, DbusEventFactory.DBUS_EVENT_V2);
View Full Code Here

Examples of com.linkedin.databus.core.DbusEventBufferMult

     }

      if(_eventBufferMult == null) {
        PhysicalSourceStaticConfig[] psscArr = new PhysicalSourceStaticConfig[_pConfigs.size()];
        _pConfigs.toArray(psscArr);
        _eventBufferMult = new DbusEventBufferMult(psscArr,  config.getEventBuffer(), _eventFactory);
      }
      _eventBufferMult.setDropOldEvents(true);
      _dbInboundStatsCollectors = new DbusEventStatsCollectorsPartitioner(getContainerStaticConfig().getId(),
                                                                          ".inbound",
                                                                          getMbeanServer());
View Full Code Here

Examples of com.linkedin.databus.core.DbusEventBufferMult

     * @throws Exception
     */
    public DbusEventBuffer addNewBuffer(PhysicalSourceStaticConfig pConfig, HttpRelay.StaticConfig config)
        throws DatabusException
    {
      DbusEventBufferMult eventMult = getEventBuffer();
      DbusEventBuffer buf = eventMult.addNewBuffer(pConfig, config.getEventBuffer());
      return buf;
    }
View Full Code Here

Examples of com.linkedin.databus.core.DbusEventBufferMult

      // do nothing by default
    }

    /** remove a new buffer - usually invoked by Helix */
    public void removeBuffer(PhysicalSourceStaticConfig pConfig) {
      DbusEventBufferMult eventMult = getEventBuffer();
      eventMult.removeBuffer(pConfig);
    }
View Full Code Here

Examples of com.linkedin.databus.core.DbusEventBufferMult

    public void dropDatabase(String dbName)
    throws DatabusException
    {
      _schemaRegistryService.dropDatabase(dbName);

      DbusEventBufferMult eventMult = getEventBuffer();

      /*
       * Close the buffers
       */
      for (DbusEventBuffer dBuf : eventMult.bufIterable())
      {

        PhysicalPartition pp = dBuf.getPhysicalPartition();
        if (pp.getName().equals(dbName))
        {
          dBuf.closeBuffer(false);
          dBuf.removeMMapFiles();
          PhysicalPartitionKey pKey = new PhysicalPartitionKey(pp);
          eventMult.removeBuffer(pKey, null);
        }
      }
    eventMult.deallocateRemovedBuffers(true);
      return;
    }
View Full Code Here

Examples of com.linkedin.databus.core.DbusEventBufferMult


    public void resetBuffer(PhysicalPartition p, long prevScn, long binlogOffset)
    throws BufferNotFoundException
    {
      DbusEventBufferMult eventMult = getEventBuffer();
      eventMult.resetBuffer(p, prevScn);
      // TODO Set binlogOffset of the server
    }
View Full Code Here

Examples of com.linkedin.databus.core.DbusEventBufferMult

   
    // create pretty or regular writer
    ObjectWriter writer = pretty ? mapper.defaultPrettyPrintingWriter() : mapper.writer();
    StringWriter out = new StringWriter(10240);
   
    DbusEventBufferMult multBuf = _relay.getEventBuffer();
    Set<PhysicalPartitionKey> keys = multBuf.getAllPhysicalPartitionKeys();
    // creat map to output partId=>PhysicalSources...
    Map<PhysicalPartition, Set<PhysicalSource>> map =
        new HashMap<PhysicalPartition, Set<PhysicalSource>>(keys.size());
    for(PhysicalPartitionKey key: keys) {
      Set<PhysicalSource> set = multBuf.getPhysicalSourcesForPartition(key.getPhysicalPartition());
      map.put(key.getPhysicalPartition(), set);
    }
   
    if(keys.isEmpty()) {
      writer.writeValue(out, new HashSet<PhysicalPartition>());
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.