You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: platform-sdk/swirlds-common/src/main/java/com/swirlds/common/merkle/synchronization/TeachingSynchronizer.java
+33Lines changed: 33 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -111,6 +111,39 @@ public TeachingSynchronizer(
111
111
this.reconnectConfig = Objects.requireNonNull(reconnectConfig, "reconnectConfig must not be null");
112
112
}
113
113
114
+
/**
115
+
* Create a new teaching synchronizer.
116
+
*
117
+
* @param threadManager responsible for managing thread lifecycles
118
+
* @param in the input stream
119
+
* @param out the output stream
120
+
* @param view the teacher tree view, used to access all tree nodes
121
+
* @param breakConnection a method that breaks the connection. Used iff an exception is encountered. Prevents
122
+
* deadlock if there is a thread stuck on a blocking IO operation that will never finish due
123
+
* to a failure.
124
+
* @param reconnectConfig reconnect configuration from platform
125
+
*/
126
+
publicTeachingSynchronizer(
127
+
@NonNullfinalTimetime,
128
+
@NonNullfinalThreadManagerthreadManager,
129
+
@NonNullfinalMerkleDataInputStreamin,
130
+
@NonNullfinalMerkleDataOutputStreamout,
131
+
@NonNullfinalTeacherTreeView<?> view,
132
+
@NullablefinalRunnablebreakConnection,
133
+
@NonNullfinalReconnectConfigreconnectConfig) {
134
+
135
+
this.time = Objects.requireNonNull(time);
136
+
this.threadManager = Objects.requireNonNull(threadManager, "threadManager must not be null");
137
+
inputStream = Objects.requireNonNull(in, "in must not be null");
138
+
outputStream = Objects.requireNonNull(out, "out must not be null");
139
+
140
+
subtrees = newLinkedList<>();
141
+
subtrees.add(newTeacherSubtree(null, view));
142
+
143
+
this.breakConnection = breakConnection;
144
+
this.reconnectConfig = Objects.requireNonNull(reconnectConfig, "reconnectConfig must not be null");
145
+
}
146
+
114
147
/**
115
148
* Perform synchronization in the role of the teacher.
Copy file name to clipboardExpand all lines: platform-sdk/swirlds-platform-core/src/main/java/com/swirlds/platform/reconnect/ReconnectStatePeerProtocol.java
Copy file name to clipboardExpand all lines: platform-sdk/swirlds-platform-core/src/main/java/com/swirlds/platform/reconnect/ReconnectStateTeacher.java
0 commit comments