dbwong commented on a change in pull request #482: PHOENIX-4925 Use Segment
tree to organize Guide Post Info
URL: https://github.com/apache/phoenix/pull/482#discussion_r275092450
##########
File path:
phoenix-core/src/main/java/org/apache/phoenix/schema/stats/GuidePostEstimation.java
##########
@@ -0,0 +1,89 @@
+package org.apache.phoenix.schema.stats;
+
+import org.apache.phoenix.util.SizedUtil;
+
+public final class GuidePostEstimation {
+ /**
+ * The byte count of the guide post
+ */
+ private long byteCount;
+
+ /**
+ * The row count of the guide post
+ */
+ private long rowCount;
+
+ /**
+ * The timestamp at which the guide post was created/updated
+ */
+ private long timestamp;
+
+ public GuidePostEstimation() {
+ this(0, 0, Long.MAX_VALUE);
+ }
+
+ public GuidePostEstimation(long byteCount, long rowCount, long timestamp) {
+ this.byteCount = byteCount;
+ this.rowCount = rowCount;
+ this.timestamp = timestamp;
+ }
+
+ public static int getEstimatedSize() {
+ return SizedUtil.LONG_SIZE * 3;
+ }
+
+ /**
+ * Merge the two guide post estimation objects into one which contains the
sum of rows,
+ * the sum of bytes and the least update time stamp of the two objects.
+ * @param left
+ * @param right
+ * @return the new guide post estimation object which contains the "Sum"
info.
+ */
+ public static GuidePostEstimation merge(GuidePostEstimation left,
GuidePostEstimation right) {
Review comment:
Dislike static for testing.
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services