kadirozde 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_r282649822
##########
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:
I have not seen any convention on this. However, we do not use "_" on method
names. Given no convention, no uses of testHook or testOnly as far as I
searched, and ForTesting is very descriptive, I will keep it as it is.
----------------------------------------------------------------
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