public void offlineToSlave(Message message, NotificationContext context)
{
System.out
.println("BootstrapProcess.BootstrapStateModel.offlineToSlave()");
HelixManager manager = context.getManager();
ClusterMessagingService messagingService = manager.getMessagingService();
Message requestBackupUriRequest = new Message(
MessageType.USER_DEFINE_MSG, UUID.randomUUID().toString());
requestBackupUriRequest
.setMsgSubType(BootstrapProcess.REQUEST_BOOTSTRAP_URL);
requestBackupUriRequest.setMsgState(MessageState.NEW);
Criteria recipientCriteria = new Criteria();
recipientCriteria.setInstanceName("*");
recipientCriteria.setRecipientInstanceType(InstanceType.PARTICIPANT);
recipientCriteria.setResource(message.getResourceName());
recipientCriteria.setPartition(message.getPartitionName());
recipientCriteria.setSessionSpecific(true);
// wait for 30 seconds
int timeout = 30000;
BootstrapReplyHandler responseHandler = new BootstrapReplyHandler();
int sentMessageCount = messagingService.sendAndWait(recipientCriteria,
requestBackupUriRequest, responseHandler, timeout);
if (sentMessageCount == 0)
{
// could not find any other node hosting the partition
} else if (responseHandler.getBootstrapUrl() != null)