private void load() {
		
		long startTime = System.currentTimeMillis();
		logger.info("Starting reload of soft state...");
		
		// the next version of the soft state
		final Map<KeyRegistrationRecord, Set<KeyRegistrationRecord>> topology = new ConcurrentHashMap<KeyRegistrationRecord, Set<KeyRegistrationRecord>>();
		final Map<String, KeyRegistrationRecord> key_to_record = new ConcurrentHashMap<String, KeyRegistrationRecord>();
		final Map<Long, KeyRegistrationRecord> id_to_record = new ConcurrentHashMap<Long, KeyRegistrationRecord>();
		final List<KeyRegistrationRecord> peers = Collections.synchronizedList(new ArrayList<KeyRegistrationRecord>());
		final Map<String, Integer> ips_to_key_counts = Collections.synchronizedMap(new HashMap<String, Integer>());
		
		(new SQLStatementProcessor<Void>("SELECT public_key, nick, created_by_account, registration_ip, registration_timestamp, last_refresh_timestamp, db_id FROM registered_keys ORDER BY key_hash ASC") {
			Void process(PreparedStatement s) throws SQLException {
				
				ResultSet rs = s.executeQuery();
				
				while( rs.next() ) {
					KeyRegistrationRecord fr = new KeyRegistrationRecord( rs.getString("public_key"), rs.getString("nick"), new Date(rs.getTimestamp("registration_timestamp").getTime()), 
							new Date(rs.getTimestamp("last_refresh_timestamp").getTime()), rs.getString("registration_ip"), 
							rs.getLong("created_by_account"), rs.getLong("db_id") );
					
					peers.add(fr);
					key_to_record.put(fr.getBase64PublicKey(), fr);
					id_to_record.put(fr.getID(), fr);
					topology.put(fr, Collections.synchronizedSet(new HashSet<KeyRegistrationRecord>()));
				}
				
				return null;
			}
		}).doit();
		
		(new SQLStatementProcessor<Void>("SELECT registration_ip, COUNT(*) FROM registered_keys GROUP BY registration_ip") {
			Void process(PreparedStatement s) throws SQLException {
				
				ResultSet rs = s.executeQuery();
				while( rs.next() ) {
					String reg_ip = rs.getString(1);
					Integer count = rs.getInt(2);
					
					ips_to_key_counts.put(reg_ip, count);
					
					logger.finest("ip: " + reg_ip + " registered " + count);
				}
				
				return null;
			}
		}).doit();
		
//		(new SQLStatementProcessor<Void>("SELECT username, registered_keys FROM valid_accounts") {
//			Void process(PreparedStatement s) throws SQLException {
//				ResultSet rs = s.executeQuery();
//				while( rs.next() ) {
//					String reg_username = rs.getString(1);
//					Integer count = rs.getInt(2);
//					
//					logger.finest("user: " + reg_username + " registered " + count);
//				}
//				return null;
//			}
//		}).doit();
		
		(new SQLStatementProcessor<Void>("SELECT * FROM topology") {
			Void process(PreparedStatement s) throws SQLException {
				ResultSet rs = s.executeQuery();
				while( rs.next() ) {
					KeyRegistrationRecord a = id_to_record.get(rs.getLong("A_id"));
					KeyRegistrationRecord b = id_to_record.get(rs.getLong("B_id"));
					
					if( a == null ) { 
						logger.severe("Null soft state key registration record for ID: " + rs.getLong("A_id"));
						continue;
					}
					
					if( b == null ) { 
						logger.severe("Null soft state key registration record for ID: " + rs.getLong("B_id"));	
					}
					
					createFriendLink(topology, a, b, false);
				}
				return null;
			}
		}).doit();
		
		synchronized(CommunityDAO.this) {
			CommunityDAO.this.key_to_record = key_to_record;
			CommunityDAO.this.id_to_record = id_to_record;
			CommunityDAO.this.topology = topology;
			CommunityDAO.this.peers = peers;
			CommunityDAO.this.ips_to_key_counts = ips_to_key_counts;
		}
		
		logger.info("db sync took: " + (System.currentTimeMillis() - startTime) + " for " + peers.size());
	}