} catch (InterruptedException e1)
{
}
// Read the columns back
IColumn supercol = null;
int attempts = 0;
while (supercol == null && attempts < CassandraUtils.retryAttempts)
{
try
{
List<Row> rows = CassandraUtils.robustRead(key, new QueryPath(
CassandraUtils.schemaInfoColumnFamily), Arrays.asList(id), ConsistencyLevel.QUORUM);
if (rows == null || rows.size() == 0)
{
continue;
}
if (rows.size() == 1)
{
Row row = rows.get(0);
if (row.cf == null || row.cf.isMarkedForDelete())
{
continue;
}
supercol = rows.get(0).cf.getColumn(id);
}
} catch (IOException e)
{
// let's try again...
}
attempts++;
}
if (supercol == null)
throw new IllegalStateException("just wrote " + offset + ", but didn't read it");
long minTtl = Long.MAX_VALUE;
ByteBuffer winningToken = null;
// See which ones we successfully reserved
for (IColumn c : supercol.getSubColumns())
{
// someone already took this id
if (!(c instanceof ExpiringColumn) && !(c instanceof DeletedColumn))
{