comnetwork commented on a change in pull request #4127:
URL: https://github.com/apache/hbase/pull/4127#discussion_r815293507
##########
File path:
hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/regionreplication/RegionReplicationSink.java
##########
@@ -448,4 +458,35 @@ public void waitUntilStopped() throws InterruptedException
{
}
}
}
+
+ @RestrictedApi(explanation = "Should only be called in tests", link = "",
+ allowedOnPath = ".*/src/test/.*")
+ RegionReplicationFlushRequester getFlushRequester() {
+ return this.flushRequester;
+ }
+
+ @RestrictedApi(explanation = "Should only be called in tests", link = "",
+ allowedOnPath = ".*/src/test/.*")
+ IntHashSet getFailedReplicas() {
+ synchronized (entries) {
+ return this.failedReplicas;
+ }
+ }
+
+ @RestrictedApi(explanation = "Should only be called in tests", link = "",
+ allowedOnPath = ".*/src/test/.*")
+ boolean isSending() {
+ synchronized (entries) {
+ return this.sending;
+ }
+ }
+
+ @RestrictedApi(explanation = "Should only be called in tests", link = "",
+ allowedOnPath = ".*/src/test/.*")
+ Queue<SinkEntry> getEntries() {
+ synchronized (entries) {
Review comment:
> We just return the entries out so I do not get the point on 'synchronized
(entries)' here...
That method is only for test, because `entries` is mutated under
synchronized, so here I get `entries` to check it size also synchronized, but
remove the synchronized is also ok, because when I check `entries` in the UTs,
there is no operations, use synchronized here just for absolute safety, I could
remove it.
--
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]