Package com.linkedin.databus.core

Examples of com.linkedin.databus.core.DbusEventKey


    byte[] serializedValue = serializeEvent(record, scn, timestamp, row, eventBuffer, enableTracing, dbusEventsStatisticsCollector);

    // Append the event to the databus event buffer
    //DbusEventKey eventKey = new DbusEventKey(record.get("key"));
    DbusEventKey eventKey = new DbusEventKey(record.get(keyColumnName));

    DbusEventKey seederChunkKey = new DbusEventKey(record.get(_seederChunkKeyName));

    short lPartitionId = _partitionFunction.getPartition(eventKey);
    //short pPartitionId = PhysicalSourceConfig.DEFAULT_PHYSICAL_PARTITION.shortValue();
    bEvb.appendEvent(eventKey, seederChunkKey,_pSourceId, lPartitionId, timestamp * 1000000, _sourceId,
        _schemaId, serializedValue, enableTracing, isReplicated, dbusEventsStatisticsCollector);
View Full Code Here


  @Override
  public ConsumerCallbackResult onDataEvent(DbusEvent e,
      DbusEventDecoder eventDecoder)
  {
    DbusEventKey k;
    if (e.isKeyNumber())
    {
      k = new DbusEventKey(e.key());
    }
    else
    {
      k = new DbusEventKey(e.keyBytes());
    }
    ByteBuffer payload = e.value();
    byte[] value = new byte[payload.limit()];
    payload.get(value,0,value.length);
    payload.position(0);
View Full Code Here

      {
        DbUpdateState.DBUpdateImage dbUpdate =  dbUpdateIterator.next();

        //Construct the Databus Event key, determine the key type and construct the key
        Object keyObj = obtainKey(dbUpdate);
        DbusEventKey eventKey = new DbusEventKey(keyObj);

        //Get the logicalparition id
        PartitionFunction partitionFunction = _partitionFunctionHashMap.get((int)sourceId);
        short lPartitionId = partitionFunction.getPartition(eventKey);
View Full Code Here

      public Object answer()
      {
        return null;
      }
    });
    DbusEventKey dek = EasyMock.createNiceMock(DbusEventKey.class);
    EasyMock.expect(
        deba.appendEvent(dek, EasyMock.createNiceMock(DbusEventInfo.class),
            null)).andReturn(Boolean.TRUE);

    deba.endEvents(EasyMock.eq(scn), null);
View Full Code Here

              {
                LOG.error("Could not generate record for source: "
                    + lconf.getName());
                continue;
              }
              DbusEventKey eventKey = null;
              try
              {
                Object key = record.get(_schemaKeys.get(lconf
                    .getName()));
                eventKey = new DbusEventKey(key);
              }
              catch (UnsupportedKeyException e)
              {
                LOG.error("Unable to get key for "
                    + lconf.getName());
View Full Code Here


      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);
      eventInfo.setEventSerializationVersion(DbusEventFactory.DBUS_EVENT_V2);
View Full Code Here

   * @return - buffer with serialized events
   * @throws KeyTypeNotImplementedException
   */
  private ByteBuffer addEvent(long scn, short srcId, byte[] schemaId,short pId, byte ver) throws KeyTypeNotImplementedException
  {
    DbusEventKey key = new DbusEventKey(123L);
    byte[] payload = RngUtils.randomString(100).getBytes(Charset.defaultCharset());
    DbusEventInfo eventInfo = new DbusEventInfo(DbusOpcode.UPSERT, scn, pId, pId, 897L,
                                                srcId, schemaId, payload, false, true);
    eventInfo.setEventSerializationVersion(ver);

View Full Code Here

          throws EventCreationException, UnsupportedKeyException, DatabusException
  {
    Object keyObj = obtainKey(changeEntry);

    //Construct the Databus Event key, determine the key type and construct the key
    DbusEventKey eventKey = new DbusEventKey(keyObj);

    short lPartitionId = _partitionFunction.getPartition(eventKey);

    //Get the md5 for the schema
    SchemaId schemaId = SchemaId.createWithMd5(changeEntry.getSchema());
View Full Code Here

    byte[] serializedValue = serializeEvent(record, scn, timestamp, row, eventBuffer, enableTracing,
                                            dbusEventsStatisticsCollector);

    // Append the event to the databus event buffer
    //DbusEventKey eventKey = new DbusEventKey(record.get("key"));
    DbusEventKey eventKey = new DbusEventKey(record.get(keyColumnName));

    short lPartitionId = _partitionFunction.getPartition(eventKey);
    //short pPartitionId = PhysicalSourceConfig.DEFAULT_PHYSICAL_PARTITION.shortValue();
    eventBuffer.appendEvent(eventKey, _pSourceId, lPartitionId, timestamp * 1000000, _sourceId,
                            _schemaId, serializedValue, enableTracing, isReplicated, dbusEventsStatisticsCollector);
View Full Code Here

                                                    RngUtils.schemaMd5,
                                                    RngUtils.randomString(payloadSize).getBytes(Charset.defaultCharset()),
                                                    false,
                                                    false /*autoCommit */);
        eventInfo.setEventSerializationVersion(DbusEventFactory.DBUS_EVENT_V1)// make this explicit
        DbusEventFactory.serializeEvent(new DbusEventKey(RngUtils.randomLong()), buf, eventInfo);
        lastScn = (useLastEventAsScn) ? _startScn + ((i/windowSize) + 1) * (long)windowSize
                                      : _startScn + (i/windowSize) + 1;
        eventVector.add((DbusEvent)
            DbusEventFactoryForTesting.createReadOnlyDbusEventFromBuffer(buf, 0, lastScn, DbusEventFactory.DBUS_EVENT_V1));
      }
View Full Code Here

TOP

Related Classes of com.linkedin.databus.core.DbusEventKey

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.