how can I used a customized Java comparator inside by()?
a vertex has timestamp with this format
Tue Oct 03 16:39:34 GMT 2023
I want use java comparator to sort it by UTC long value.
But got the follwoing exception
Caused by: io.grpc.StatusRuntimeException: INVALID_ARGUMENT: error in handleRequest(), message=Could not locate exact method given the supplied arguments: DefaultGraphTraversal.by(LinkedHashMap), code=ILLEGAL_INPUT
at io.grpc.Status.asRuntimeException(Status.java:535)
... 13 common frames omitted
my comparator is
Comparator<Vertex> timestampComparator2 = new Comparator<Vertex>() {
SimpleDateFormat dateFormat = new SimpleDateFormat("EEE MMM dd HH:mm:ss zzz yyyy");
@Override
public int compare(Vertex o1, Vertex o2) {
String timestampString1 = o1.values(P.TIMESTAMP).next().toString();
String timestampString2 = o2.values(P.TIMESTAMP).next().toString();
Date timestamp1 = null;
Date timestamp2 = null;
try {
timestamp1 = dateFormat.parse(timestampString1);
timestamp2 = dateFormat.parse(timestampString2);
return timestamp1.compareTo(timestamp2);
} catch (ParseException e) {
e.printStackTrace();
}
return 0;
}
};