Skip to content

Commit 2f89b2e

Browse files
committed
Changed knows comparator to include the edge creation date in the comparison
1 parent 70ba975 commit 2f89b2e

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/main/java/ldbc/snb/datagen/objects/Knows.java

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,11 @@ public void write(DataOutput arg0) throws IOException {
103103
}
104104

105105
public int compareTo(Knows k) {
106-
return (int)(to_.accountId() - k.to().accountId());
106+
int res = (int)(to_.accountId() - k.to().accountId());
107+
if( res != 0 ) return res;
108+
long res2 = creationDate_ - k.creationDate();
109+
if( res2 > 0 ) return 1;
110+
if( res2 < 0 ) return -1;
111+
return 0;
107112
}
108113
}

0 commit comments

Comments
 (0)