Revision 6814
Added by ben leinfelder over 12 years ago
ReplicationServerList.java | ||
---|---|---|
88 | 88 |
serialNumber=dbConn.getCheckOutSerialNumber(); |
89 | 89 |
//Select fields from xml_replication table |
90 | 90 |
pstmt = dbConn.prepareStatement("select server, last_checked, replicate,"+ |
91 |
" datareplicate, systemmetadatareplicate, hub from xml_replication");
|
|
91 |
" datareplicate, hub from xml_replication"); |
|
92 | 92 |
//Execute prepare statement |
93 | 93 |
pstmt.execute(); |
94 | 94 |
//Get result set |
... | ... | |
109 | 109 |
//Data replication value |
110 | 110 |
int dataReplication = rs.getInt(4); |
111 | 111 |
logMetacat.info("DataReplication value: "+dataReplication); |
112 |
//Data replication value |
|
113 |
int systemMetadataReplication = rs.getInt(5); |
|
114 |
logMetacat.info("DataReplication value: "+dataReplication); |
|
115 | 112 |
//Hub value |
116 |
int hubValue = rs.getInt(6);
|
|
113 |
int hubValue = rs.getInt(5);
|
|
117 | 114 |
logMetacat.info("Hub value: "+hubValue); |
118 | 115 |
//Get rid of local host |
119 | 116 |
if(!serverName.equals("localhost")) |
... | ... | |
155 | 152 |
}//else |
156 | 153 |
//Set data replciation value |
157 | 154 |
server.setDataReplication(hasDataReplication); |
158 |
if (systemMetadataReplication == 1) { |
|
159 |
hasSystemMetadataReplication = true; |
|
160 |
} |
|
161 |
server.setSystemMetadataReplication(hasSystemMetadataReplication); |
|
162 | 155 |
|
163 | 156 |
//Detemine isHub by hubValue |
164 | 157 |
if (hubValue ==1) |
... | ... | |
392 | 385 |
return server.getDataReplication(); |
393 | 386 |
}//getDataReplicationValue |
394 | 387 |
|
395 |
/** |
|
396 |
* To a given server name, try to get its data file replciation option |
|
397 |
* If couldn't find the server in the server list, false will return |
|
398 |
* @param givenServerName, the server's name which we want to get data file |
|
399 |
* replication value |
|
400 |
*/ |
|
401 |
public synchronized boolean getSystemMetadataReplicationValue(String givenServerName) |
|
402 |
{ |
|
403 |
int index = -1;//Variable to store the index |
|
404 |
ReplicationServer server = null;//Variable for replication server |
|
405 |
|
|
406 |
//Get the server's index in server list |
|
407 |
index = findIndexInServerList(givenServerName); |
|
408 |
//If index = -1, couldn't find this server, null will return |
|
409 |
if (index == -1) |
|
410 |
{ |
|
411 |
return false; |
|
412 |
}//if |
|
413 |
//Get Replication server object |
|
414 |
server = (ReplicationServer) serverList.elementAt(index); |
|
415 |
//Return this object's data replication value |
|
416 |
return server.isSystemMetadataReplication(); |
|
417 |
} |
|
418 | 388 |
|
419 | 389 |
/** |
420 | 390 |
* To a given server name, try to get its hub option |
Also available in: Unified diff
remove flag for independent system metadata replication -- these entries are replicated along with the data/metadata objects or via hazelcast when the actual object is not on the server.