/** * Gets the Builder instance for the 'event' field and creates one if it doesn't exist yet. * The events the other events are correlated with */ public org.kitesdk.data.event.StandardEvent.Builder getEventBuilder() { if (eventBuilder == null) { if (hasEvent()) { setEventBuilder(org.kitesdk.data.event.StandardEvent.newBuilder(event)); } else { setEventBuilder(org.kitesdk.data.event.StandardEvent.newBuilder()); } } return eventBuilder; }
private StandardEvent standardEvent(long timestamp) { return StandardEvent.newBuilder(event).setTimestamp(timestamp).build(); }
/** Creates a Builder by copying an existing Builder */ private Builder(org.kitesdk.data.event.CorrelatedEvents.Builder other) { super(other); if (isValidValue(fields()[0], other.event)) { this.event = data().deepCopy(fields()[0].schema(), other.event); fieldSetFlags()[0] = true; } if (other.hasEventBuilder()) { this.eventBuilder = org.kitesdk.data.event.StandardEvent.newBuilder(other.getEventBuilder()); } if (isValidValue(fields()[1], other.correlated)) { this.correlated = data().deepCopy(fields()[1].schema(), other.correlated); fieldSetFlags()[1] = true; } }
public StandardEvent generateRandomEvent() { return StandardEvent.newBuilder() .setEventInitiator(new Utf8("client_user")) .setEventName(randomEventName()) .setUserId(randomUserId()) .setSessionId(randomSessionId()) .setIp(randomIp()) .setTimestamp(randomTimestamp()) .setEventDetails(randomEventDetails()) .build(); }