priyankporwal commented on a change in pull request #469: PHOENIX-5156
Consistent Global Indexes for Non-Transactional Tables
URL: https://github.com/apache/phoenix/pull/469#discussion_r282163583
##########
File path:
phoenix-core/src/main/java/org/apache/phoenix/hbase/index/Indexer.java
##########
@@ -116,18 +110,67 @@
private static final Log LOG = LogFactory.getLog(Indexer.class);
private static final OperationStatus IGNORE = new
OperationStatus(OperationStatusCode.SUCCESS);
private static final OperationStatus NOWRITE = new
OperationStatus(OperationStatusCode.SUCCESS);
-
+
+ /**
+ * Class to represent pending data table rows
+ */
+ private static class PendingRow {
+ private long latestTimestamp;
+ private long count;
+ PendingRow(long latestTimestamp) {
+ count = 1;
+ this.latestTimestamp = latestTimestamp;
+ }
+
+ public void add(long timestamp) {
+ count++;
+ if (latestTimestamp < timestamp) {
+ latestTimestamp = timestamp;
+ }
+ }
+
+ public void remove() {
+ count--;
+ }
+
+ public long getCount() {
+ return count;
+ }
+
+ public long getLatestTimestamp() {
+ return latestTimestamp;
+ }
+ }
protected IndexWriter writer;
+ protected IndexWriter postWriter;
+
protected IndexBuildManager builder;
private LockManager lockManager;
+ // The collection of pending data table rows
+ private Map<ImmutableBytesPtr, PendingRow> pendingRows = new HashMap<>();
+
+ private static boolean skipPostIndexUpdatesForTesting = false;
Review comment:
Nit: Is there any existing naming convention for test hooks like these? That
would make it easy to locate them in thr code-base. If not, we can perhaps pick
a common prefix (e.g. testHook_ or testOnly_).
----------------------------------------------------------------
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