Project

General

Profile

« Previous | Next » 

Revision 7346

allow SM resynch to be executed any time, not just during start up.
https://redmine.dataone.org/issues/3116

View differences:

lib/admin/replication-configuration-include.jsp
211 211

  
212 212
</form>
213 213

  
214
<h3>Hazelcast Synchronization</h3>
215
<hr class="config-line">
216

  
217
<table border="0" cellpadding="4" cellspacing="0" width="100%" class="tablepanel">
218
	<tr>
219
		<td>
220
		<form action="<%=request.getContextPath()%>/admin" method="POST" target="bottom">
221
			<input type="hidden" name="action" value="resynchSystemMetadata"> 
222
			<input type="hidden" name="configureType" value="replication">
223
			<input type="submit" value="Resynch" target="bottom">
224
			Bring all missing System Metadata from remote hosts to this server
225
		</form>
226
		</td>
227
	</tr>
228
</table>
229

  
214 230
<br/>
215 231

  
216 232
<a
src/edu/ucsb/nceas/metacat/dataone/hazelcast/HazelcastService.java
556 556
		
557 557
	}
558 558
	
559
	private void resynchInThread() {
559
	public void resynchInThread() {
560 560
		logMetacat.debug("launching system metadata resynch in a thread");
561 561
		ExecutorService executor = Executors.newSingleThreadExecutor();
562 562
		executor.execute(new Runnable() {
src/edu/ucsb/nceas/metacat/admin/ReplicationAdmin.java
38 38

  
39 39
import org.apache.log4j.Logger;
40 40

  
41
import edu.ucsb.nceas.metacat.dataone.hazelcast.HazelcastService;
41 42
import edu.ucsb.nceas.metacat.replication.ReplicationService;
42 43
import edu.ucsb.nceas.metacat.service.SessionService;
43 44
import edu.ucsb.nceas.metacat.shared.MetacatUtilException;
......
157 158
			out.println("<html><body>\"Get All\" Done</body></html>");
158 159
		} else if (action.equals("servercontrol")) {
159 160
			ReplicationService.handleServerControlRequest(params, request, response);
161
		} else if (action.equals("resynchSystemMetadata")) {
162
			HazelcastService.getInstance().resynchInThread();
163
			response.setContentType("text/html");
164
			out = response.getWriter();
165
			out.println("<html><body>SystemMetadata resynch has been started</body></html>");
160 166
		} else {
161 167
			// Forward the request to the JSP page
162 168
			RequestUtil.forwardRequest(request, response, "/admin/replication-configuration.jsp", null);

Also available in: Unified diff