kezhenxu94 commented on code in PR #9689:
URL: https://github.com/apache/skywalking/pull/9689#discussion_r980090617
##########
oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/query/input/Duration.java:
##########
@@ -27,45 +27,50 @@
@Getter
@Setter
+/**
+ * To optimize the query, the range of start and end times will be trimmed to
[TTL_deadLine < time <= CurrentTime].
+ */
public class Duration {
private String start;
private String end;
private Step step;
/**
- * See {@link DurationUtils#convertToTimeBucket(Step, String)}
+ * See {@link DurationUtils#trimToStartTimeBucket(Step, String, boolean)}
*/
- public long getStartTimeBucket() {
- return DurationUtils.INSTANCE.convertToTimeBucket(step, start);
+ public long getStartTimeBucket(boolean isRecord) {
Review Comment:
> When I review and read this method, I am wondering, whether we separate
this method as two, is that better for reading?
Aggree, when adding a `boolean` argument to a method, it's usually better in
terms of readability to split the method into two, like
`getRecordStartTimeBucket` and `getXXXStartTimeBucket`
##########
oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/storage/annotation/SQLDatabase.java:
##########
@@ -135,4 +136,12 @@
@interface MultipleExtraColumn4AdditionalEntity {
ExtraColumn4AdditionalEntity[] value();
}
+
+ @Target({ElementType.TYPE})
+ @Retention(RetentionPolicy.RUNTIME)
+ @interface Sharding {
+ ShardingAlgorithm shardingAlgorithm();
+ String dsShardingColumn();
Review Comment:
In such case I'd rather write the full name, `dataSourceShardingColumn`,
with IDE autocompletion it's the same key strokes but it is more clear
--
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]