HBASE-13703 ReplicateContext should not be a member of ReplicationSource.
This commit is contained in:
parent
b886bac53c
commit
f8893e0012
|
@ -134,7 +134,7 @@ public interface ReplicationEndpoint extends Service {
|
||||||
* A context for {@link ReplicationEndpoint#replicate(ReplicateContext)} method.
|
* A context for {@link ReplicationEndpoint#replicate(ReplicateContext)} method.
|
||||||
*/
|
*/
|
||||||
@InterfaceAudience.LimitedPrivate(HBaseInterfaceAudience.REPLICATION)
|
@InterfaceAudience.LimitedPrivate(HBaseInterfaceAudience.REPLICATION)
|
||||||
class ReplicateContext {
|
static class ReplicateContext {
|
||||||
List<Entry> entries;
|
List<Entry> entries;
|
||||||
int size;
|
int size;
|
||||||
@InterfaceAudience.Private
|
@InterfaceAudience.Private
|
||||||
|
|
|
@ -131,8 +131,6 @@ public class ReplicationSource extends Thread
|
||||||
private ReplicationEndpoint replicationEndpoint;
|
private ReplicationEndpoint replicationEndpoint;
|
||||||
// A filter (or a chain of filters) for the WAL entries.
|
// A filter (or a chain of filters) for the WAL entries.
|
||||||
private WALEntryFilter walEntryFilter;
|
private WALEntryFilter walEntryFilter;
|
||||||
// Context for ReplicationEndpoint#replicate()
|
|
||||||
private ReplicationEndpoint.ReplicateContext replicateContext;
|
|
||||||
// throttler
|
// throttler
|
||||||
private ReplicationThrottler throttler;
|
private ReplicationThrottler throttler;
|
||||||
|
|
||||||
|
@ -187,8 +185,6 @@ public class ReplicationSource extends Thread
|
||||||
this.peerId = this.replicationQueueInfo.getPeerId();
|
this.peerId = this.replicationQueueInfo.getPeerId();
|
||||||
this.logQueueWarnThreshold = this.conf.getInt("replication.source.log.queue.warn", 2);
|
this.logQueueWarnThreshold = this.conf.getInt("replication.source.log.queue.warn", 2);
|
||||||
this.replicationEndpoint = replicationEndpoint;
|
this.replicationEndpoint = replicationEndpoint;
|
||||||
|
|
||||||
this.replicateContext = new ReplicationEndpoint.ReplicateContext();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void decorateConf() {
|
private void decorateConf() {
|
||||||
|
@ -689,6 +685,8 @@ public class ReplicationSource extends Thread
|
||||||
this.throttler.resetStartTick();
|
this.throttler.resetStartTick();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
// create replicateContext here, so the entries can be GC'd upon return from this call stack
|
||||||
|
ReplicationEndpoint.ReplicateContext replicateContext = new ReplicationEndpoint.ReplicateContext();
|
||||||
replicateContext.setEntries(entries).setSize(currentSize);
|
replicateContext.setEntries(entries).setSize(currentSize);
|
||||||
|
|
||||||
long startTimeNs = System.nanoTime();
|
long startTimeNs = System.nanoTime();
|
||||||
|
|
Loading…
Reference in New Issue