Hosts.java (eucalyptus-4.4.1) | : | Hosts.java (eucalyptus-4.4.2) | ||
---|---|---|---|---|
skipping to change at line 514 | skipping to change at line 514 | |||
* <ol> | * <ol> | |||
* <li>Update their map copies from non-member partition's coordinator with {@link ReplicatedHashMap#setState(java.io.InputStream)}.</li> | * <li>Update their map copies from non-member partition's coordinator with {@link ReplicatedHashMap#setState(java.io.InputStream)}.</li> | |||
* <li>Check to see if the current view state is compatible with their previ ous view state.</li> | * <li>Check to see if the current view state is compatible with their previ ous view state.</li> | |||
* <li>Fail-stop if an inconsistency exists.</li> | * <li>Fail-stop if an inconsistency exists.</li> | |||
* </ol> | * </ol> | |||
*/ | */ | |||
private void handleMergeView( final MergeView mergeView ) { | private void handleMergeView( final MergeView mergeView ) { | |||
/** | /** | |||
* Which host was the coordinator for the partition this host belongs to. | * Which host was the coordinator for the partition this host belongs to. | |||
*/ | */ | |||
final Host preMergeCoordinator = Coordinator.INSTANCE.get(); | final Host preMergeCoordinator = getCoordinator( ); | |||
LOG.info("Hosts.viewChange(): merge : pre-merge-coordinator=" + preMerge Coordinator ); | LOG.info("Hosts.viewChange(): merge : pre-merge-coordinator=" + preMerge Coordinator ); | |||
Runnable mergeViews = new Runnable() { | Runnable mergeViews = new Runnable() { | |||
/** | /** | |||
* Was this host the coordinator when the merge view arrived (i.e., befo re the partiton has been resolved)? | * Was this host the coordinator when the merge view arrived (i.e., befo re the partition has been resolved)? | |||
*/ | */ | |||
private final boolean coordinator = preMergeCoordinator.isLocalHost(); | private final boolean coordinator = preMergeCoordinator!=null && preMerg eCoordinator.isLocalHost(); | |||
/** | /** | |||
* Which host was the coordinator for the partition this host belongs to . | * Which host was the coordinator for the partition this host belongs to . | |||
*/ | */ | |||
private final String coordinatorAddress = preMergeCoordinator != null ? preMergeCoordinator.getDisplayName() : "NONE"; | private final String coordinatorAddress = preMergeCoordinator != null ? preMergeCoordinator.getDisplayName() : "NONE"; | |||
private String logPrefix( final View v ) { | private String logPrefix( final View v ) { | |||
final ViewId viewId = v == null ? null : v.getViewId( ); | final ViewId viewId = v == null ? null : v.getViewId( ); | |||
final String id = viewId == null ? "?" : Objects.toString( viewId.getI d() ); | final String id = viewId == null ? "?" : Objects.toString( viewId.getI d() ); | |||
final String creator = viewId == null ? "?" : Objects.toString( viewId .getCreator( ), "?" ); | final String creator = viewId == null ? "?" : Objects.toString( viewId .getCreator( ), "?" ); | |||
return "Hosts.viewChange(): merge [" +id + ":" + creator + "]=> "; | return "Hosts.viewChange(): merge [" +id + ":" + creator + "]=> "; | |||
skipping to change at line 1303 | skipping to change at line 1303 | |||
} | } | |||
} | } | |||
public Host get( ) {//GRZE: this needs to use active DBs to avoid db-sync ra ce. | public Host get( ) {//GRZE: this needs to use active DBs to avoid db-sync ra ce. | |||
List<Host> dbHosts = Hosts.listActiveDatabases( ); | List<Host> dbHosts = Hosts.listActiveDatabases( ); | |||
return find( dbHosts ); | return find( dbHosts ); | |||
} | } | |||
public Host await( ) {//GRZE: this needs to use all DBs to ensure waiting fo r booting coordinator | public Host await( ) {//GRZE: this needs to use all DBs to ensure waiting fo r booting coordinator | |||
while ( !Hosts.isCoordinator( ) && AwaitDatabase.INSTANCE.apply( Hosts.get Coordinator( ) ) ); | while ( !Hosts.isCoordinator( ) && AwaitDatabase.INSTANCE.apply( Hosts.get Coordinator( ) ) ); | |||
Host coord = get( ); | ||||
if ( !BootstrapArgs.isCloudController( ) ) { | if ( !BootstrapArgs.isCloudController( ) ) { | |||
Coordinator.loggedWait( JoinShouldWait.NON_CLOUD_CONTROLLER ); | Coordinator.loggedWait( JoinShouldWait.NON_CLOUD_CONTROLLER ); | |||
return JoinShouldWait.NON_CLOUD_CONTROLLER.get( ); | return JoinShouldWait.NON_CLOUD_CONTROLLER.get( ); | |||
} else { | } else { | |||
return Hosts.localHost( ); | return Hosts.localHost( ); | |||
} | } | |||
} | } | |||
private static void loggedWait( JoinShouldWait waitFunction ) { | private static void loggedWait( JoinShouldWait waitFunction ) { | |||
for ( Host h = waitFunction.get( ); waitFunction.apply( h ); h = waitFunct ion.get( ) ) { | for ( Host h = waitFunction.get( ); waitFunction.apply( h ); h = waitFunct ion.get( ) ) { | |||
End of changes. 4 change blocks. | ||||
4 lines changed or deleted | 3 lines changed or added |