for (int i = 0; i < session.getSuperColumns(); i++)
{
String superColumnName = "S" + Integer.toString(i);
ColumnParent parent = new ColumnParent("Super1").setSuper_column(ByteBufferUtil.bytes(superColumnName));
TimerContext context = session.latency.time();
boolean success = false;
String exceptionMessage = null;
for (int t = 0; t < session.getRetryTimes(); t++)
{
try
{
slices = client.get_range_slices(parent, predicate, range, session.getConsistencyLevel());
success = (slices.size() != 0);
}
catch (Exception e)
{
exceptionMessage = getExceptionMessage(e);
success = false;
}
}
if (!success)
{
error(String.format("Operation [%d] retried %d times - error on calling get_range_slices for range offset %s %s%n",
index,
session.getRetryTimes(),
ByteBufferUtil.string(start),
(exceptionMessage == null) ? "" : "(" + exceptionMessage + ")"));
}
session.operations.getAndIncrement();
context.stop();
}
session.keys.getAndAdd(slices.size());
}
else
{
ColumnParent parent = new ColumnParent("Standard1");
ByteBuffer start = ByteBufferUtil.bytes(String.format(format, index));
List<KeySlice> slices = new ArrayList<KeySlice>();
KeyRange range = new KeyRange(count).setStart_key(start).setEnd_key(ByteBufferUtil.EMPTY_BYTE_BUFFER);
TimerContext context = session.latency.time();
boolean success = false;
String exceptionMessage = null;
for (int t = 0; t < session.getRetryTimes(); t++)
{
if (success)
break;
try
{
slices = client.get_range_slices(parent, predicate, range, session.getConsistencyLevel());
success = (slices.size() != 0);
}
catch (Exception e)
{
exceptionMessage = getExceptionMessage(e);
success = false;
}
}
if (!success)
{
error(String.format("Operation [%d] retried %d times - error on calling get_indexed_slices for range offset %s %s%n",
index,
session.getRetryTimes(),
ByteBufferUtil.string(start),
(exceptionMessage == null) ? "" : "(" + exceptionMessage + ")"));
}
session.operations.getAndIncrement();
session.keys.getAndAdd(slices.size());
context.stop();
}
}