wankai123 commented on code in PR #13668:
URL: https://github.com/apache/skywalking/pull/13668#discussion_r2693350934
##########
oap-server/server-library/library-banyandb-client/src/main/java/org/apache/skywalking/library/banyandb/v1/client/PropertyQuery.java:
##########
@@ -95,7 +98,32 @@ public BanyandbProperty.QueryRequest build() throws
BanyanDBException {
if (!this.ids.isEmpty()) {
builder.addAllIds(this.ids);
}
-
+ if (this.orderBy != null) {
+ builder.setOrderBy(orderBy.build());
+ }
return builder.build();
}
+
+ public static class OrderBy {
+ private final String tagName;
+ private final Sort type;
+
+ /**
+ * Create an orderBy condition with given tag name and sort type
+ */
+ public OrderBy(final String tagName, final Sort type) {
+ this.tagName = tagName;
+ this.type = type;
+ }
+
+ BanyandbProperty.QueryOrder build() {
+ final BanyandbProperty.QueryOrder.Builder builder =
BanyandbProperty.QueryOrder.newBuilder();
+ if (tagName != null) {
+ builder.setTagName(tagName);
+ }
+ builder.setSort(
+ Sort.DESC.equals(type) ? BanyandbModel.Sort.SORT_DESC :
BanyandbModel.Sort.SORT_ASC);
Review Comment:
There are not same.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]