Github user ramkrish86 commented on a diff in the pull request:
https://github.com/apache/phoenix/pull/8#discussion_r16699399
--- Diff:
phoenix-core/src/main/java/org/apache/phoenix/schema/stat/PTableStats.java ---
@@ -22,23 +22,116 @@
import org.apache.hadoop.hbase.HRegionInfo;
-/**
- * Interface for Phoenix table statistics. Statistics is collected on the
server
- * side and can be used for various purpose like splitting region for
scanning, etc.
- *
- * The table is defined on the client side, but it is populated on the
server side. The client
- * should not populate any data to the statistics object.
+/*
+ * The table is defined on the client side, but it is populated on the
server side. The client should not populate any data to the
+ * statistics object.
*/
public interface PTableStats {
/**
- * Given the region info, returns an array of bytes that is the
current estimate of key
- * distribution inside that region. The keys should split that region
into equal chunks.
+ * Given the region info, returns an array of bytes that is the
current estimate of key distribution inside that region. The keys should
+ * split that region into equal chunks.
*
* @param region
* @return array of keys
*/
- byte[][] getRegionGuidePosts(HRegionInfo region);
+ byte[] getRegionGuidePostsOfARegion(HRegionInfo region);
+
+ /**
+ * Returns a map of with key as the regions of the table and the guide
posts collected as byte[] created from VARBINARY ARRAY
+ *
+ * @return map of region and the guide posts as VARBINARY array
+ */
+ Map<String, byte[]> getGuidePosts();
+
+ /**
+ * Returns the max key of a region
+ *
+ * @param region
+ * @return maxkey of a region
+ */
+ byte[] getMaxKeyOfARegion(HRegionInfo region);
+
+ /**
+ * Returns the min key of a region
+ *
+ * @param region
+ * @return min key of a region
+ */
+ byte[] getMinKeyOfARegion(HRegionInfo region);
+
+ /**
+ * Returns a map with key as the regions of the table and the max key
in that region
+ *
+ * @return
+ */
+ Map<String, byte[]> getMaxKey();
+
+ /**
+ * Returns a map with key as the regions of the table and the min key
in that region
+ *
+ * @return
+ */
+ Map<String, byte[]> getMinKey();
+
+ /**
+ * Set the min key of a region
+ *
+ * @param region
+ * @param minKey
+ * @param offset
+ * @param length
+ */
+ void setMinKey(HRegionInfo region, byte[] minKey, int offset, int
length);
+
+ /**
+ * Set the min key of the region. Here the region name is represented
as the Bytes.toBytes(region.getRegionNameAsString).
--- End diff --
I think it may be possible. Let me see.
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---