DbusEvent { public abstract long timestampInNanos();  abstract boolean isExtReplicatedEvent(); abstract boolean isValid(); abstract boolean isControlMessage(); abstract boolean isPrivateControlMessage(); abstract boolean isCheckpointMessage(); abstract boolean isKeyNumber(); abstract boolean isKeyString(); abstract boolean isKeySchema(); abstract boolean isSCNRegressMessage(); abstract boolean isTraceEnabled(); abstract boolean isEndOfPeriodMarker(); abstract DbusOpcode getOpcode(); abstract long timestampInNanos(); abstract int size(); abstract long sequence(); abstract long key(); @Deprecated abstract int keyLength(); abstract byte[] keyBytes(); @Deprecated abstract short srcId(); abstract int getSourceId(); @Deprecated abstract short physicalPartitionId(); @Deprecated abstract short logicalPartitionId(); abstract short getPartitionId(); abstract byte[] schemaId(); abstract void schemaId(byte[] md5); abstract int valueLength(); abstract ByteBuffer value(); abstract ByteBuffer getRawBytes(); abstract DbusEventPart getPayloadPart(); abstract DbusEventPart getPayloadMetadataPart(); abstract DbusEventPart getKeyPart(); final static int MD5_DIGEST_LEN; final static int CRC32_DIGEST_LEN; }
@Test public void testTimestamp() throws KeyTypeNotImplementedException { String randomValue = RngUtils.randomString(20); ByteBuffer serializationBuffer = ByteBuffer.allocate(1000).order(_eventV1Factory.getByteOrder()); DbusEventInfo eventInfo = new DbusEventInfo(DbusOpcode.UPSERT, 0L, (short)0, partitionId, timeStamp, srcId, schemaId, randomValue.getBytes(Charset.defaultCharset()), false, false); eventInfo.setEventSerializationVersion(DbusEventFactory.DBUS_EVENT_V1); DbusEventFactory.serializeEvent(new DbusEventKey(key), serializationBuffer, eventInfo); DbusEventInternalReadable e = _eventV1Factory.createReadOnlyDbusEventFromBuffer(serializationBuffer, 0); assertEquals("Timestamp matches", timeStamp,e.timestampInNanos()); }