}
resourceMap.put("lastHeartbeat", currentTime);
if (firstHeartbeatWritten==-1) {
resourceMap.put("runtimeId", runtimeId);
}
if (resetLeaderElectionId || !resourceMap.containsKey("leaderElectionId")) {
int maxLongLength = String.valueOf(Long.MAX_VALUE).length();
String currentTimeMillisStr = String.format("%0"
+ maxLongLength + "d", System.currentTimeMillis());
String prefix = "0";