*
*/
public static HashMap<Token, InetAddress> loadTokens()
{
HashMap<Token, InetAddress> tokenMap = new HashMap<Token, InetAddress>();
IPartitioner p = StorageService.getPartitioner();
Table table = Table.open(Table.SYSTEM_TABLE);
QueryFilter filter = QueryFilter.getIdentityFilter(decorate(RING_KEY), new QueryPath(STATUS_CF));
ColumnFamily cf = table.getColumnFamilyStore(STATUS_CF).getColumnFamily(filter);
if (cf != null)
{
for (IColumn column : cf.getSortedColumns())
{
try
{
ByteBuffer v = column.value();
byte[] addr = new byte[v.remaining()];
ByteBufferUtil.arrayCopy(v, v.position(), addr, 0, v.remaining());
tokenMap.put(p.getTokenFactory().fromByteArray(column.name()), InetAddress.getByAddress(addr));
}
catch (UnknownHostException e)
{
throw new IOError(e);
}