You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@hbase.apache.org by GitBox <gi...@apache.org> on 2022/02/26 10:00:48 UTC
[GitHub] [hbase] comnetwork commented on a change in pull request #4127: HBASE-26768 Avoid unnecessary replication suspending in RegionReplica…
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 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: issues-unsubscribe@hbase.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org