File tree Expand file tree Collapse file tree 1 file changed +19
-2
lines changed
src/main/java/org/apache/skywalking/banyandb/v1/client Expand file tree Collapse file tree 1 file changed +19
-2
lines changed Original file line number Diff line number Diff line change @@ -165,7 +165,6 @@ protected BanyandbModel.TagProjection buildTagProjections(MetadataCache.EntityMe
165165 return b .build ();
166166 }
167167
168- @ RequiredArgsConstructor
169168 public static class OrderBy {
170169 /**
171170 * The field name for ordering.
@@ -176,9 +175,27 @@ public static class OrderBy {
176175 */
177176 private final Sort type ;
178177
178+ /**
179+ * Create an orderBy condition with given rule name and sort type
180+ */
181+ public OrderBy (final String indexRuleName , final Sort type ) {
182+ this .indexRuleName = indexRuleName ;
183+ this .type = type ;
184+ }
185+
186+ /**
187+ * Create an orderBy condition with timestamp and sort type
188+ */
189+ public OrderBy (final Sort type ) {
190+ this .indexRuleName = null ;
191+ this .type = type ;
192+ }
193+
179194 BanyandbModel .QueryOrder build () {
180195 final BanyandbModel .QueryOrder .Builder builder = BanyandbModel .QueryOrder .newBuilder ();
181- builder .setIndexRuleName (indexRuleName );
196+ if (indexRuleName != null ) {
197+ builder .setIndexRuleName (indexRuleName );
198+ }
182199 builder .setSort (
183200 Sort .DESC .equals (type ) ? BanyandbModel .Sort .SORT_DESC : BanyandbModel .Sort .SORT_ASC );
184201 return builder .build ();
You can’t perform that action at this time.
0 commit comments