-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathChangeEvent.java
72 lines (62 loc) · 1.74 KB
/
ChangeEvent.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
package com.datastax.oss.cdc.cassandra;
import javax.validation.constraints.NotNull;
import java.time.Instant;
import java.util.UUID;
/**
* This interface represents a change made to certain row or deletion at certain timestamp.
*/
public interface ChangeEvent extends Comparable<ChangeEvent> {
@Override
default int compareTo(ChangeEvent o) {
return getEventTimestamp().compareTo(o.getEventTimestamp());
}
/**
* Returns timestamp associated with this event.
*
* Note that in Apache Cassandra, user can supply timestamp with query.
*
* @return timestamp of this event
*/
@NotNull
Instant getEventTimestamp();
/**
* Returns the name of keyspace where this event happened
*
* @return Name of keyspace
*/
@NotNull
String getKeyspaceName();
/**
* Returns the name of the table this event happened
*
* @return Name of the table this change is made
*/
@NotNull
String getTableName();
/**
* Returns the id of the table this event happened
*
* @return Table ID
*/
@NotNull
UUID getTableId();
/**
* Returns the type of this event
*
* @return Change event type: UPDATE or DELETE
*/
@NotNull
ChangeEventType getEventType();
/**
* Returns the deletion criteria if this event is for deletion.
*
* @return Deletion object when this event is {@link ChangeEventType#DELETE}, else null
*/
Deletion getDeletion();
/**
* Returns the row objects that contains columns that is inserted or updated if this event is for update.
*
* @return Row object containing changes when this event is {@link ChangeEventType#UPDATE}, else null
*/
Row getRow();
}