Program: 6971
Project: 6971
Buggy source:
private void scanQueue(TransactionExecutor txExecutor,HBaseConsumerStateStore stateStore,QueueName queueName,QueueBarrier start,@Nullable QueueBarrier end,final QueueStatistics outStats) throws Exception {
  final byte[] queueRowPrefix=QueueEntryRow.getQueueRowPrefix(queueName);
  ConsumerGroupConfig groupConfig=start.getGroupConfig();
  System.out.printf("String_Node_Str",groupConfig);
  HBaseQueueAdmin admin=queueClientFactory.getQueueAdmin();
  TableId tableId=admin.getDataTableId(queueName,QueueConstants.QueueType.SHARDED_QUEUE);
  HTable hTable=queueClientFactory.createHTable(tableId);
  System.out.printf("String_Node_Str",Bytes.toString(hTable.getTableName()));
  final byte[] stateColumnName=Bytes.add(QueueEntryRow.STATE_COLUMN_PREFIX,Bytes.toBytes(groupConfig.getGroupId()));
  int distributorBuckets=queueClientFactory.getDistributorBuckets(hTable.getTableDescriptor());
  ShardedHBaseQueueStrategy queueStrategy=new ShardedHBaseQueueStrategy(distributorBuckets);
  Scan scan=new Scan();
  scan.setStartRow(start.getStartRow());
  if (end != null) {
    scan.setStopRow(end.getStartRow());
  }
  scan.addColumn(QueueEntryRow.COLUMN_FAMILY,QueueEntryRow.DATA_COLUMN);
  scan.addColumn(QueueEntryRow.COLUMN_FAMILY,QueueEntryRow.META_COLUMN);
  scan.addColumn(QueueEntryRow.COLUMN_FAMILY,stateColumnName);
  scan.setMaxVersions(1);
  System.out.printf("String_Node_Str",scan.toString());
  List<Integer> instanceIds=Lists.newArrayList();
  if (groupConfig.getDequeueStrategy() == DequeueStrategy.FIFO) {
    instanceIds.add(0);
  }
 else {
    for (int instanceId=0; instanceId < groupConfig.getGroupSize(); instanceId++) {
      instanceIds.add(instanceId);
    }
  }
  for (  int instanceId : instanceIds) {
    System.out.printf("String_Node_Str",instanceId);
    ConsumerConfig consConfig=new ConsumerConfig(groupConfig,instanceId);
    final QueueScanner scanner=queueStrategy.createScanner(consConfig,hTable,scan,100);
    txExecutor.execute(new TransactionExecutor.Procedure<HBaseConsumerStateStore>(){
      @Override public void apply(      HBaseConsumerStateStore input) throws Exception {
        ImmutablePair<byte[],Map<byte[],byte[]>> result;
        while ((result=scanner.next()) != null) {
          byte[] rowKey=result.getFirst();
          Map<byte[],byte[]> columns=result.getSecond();
          visitRow(outStats,input.getTransaction(),rowKey,columns.get(stateColumnName),queueRowPrefix.length);
        }
      }
    }
,stateStore);
  }
}

Fixed version (ground truth):
private void scanQueue(TransactionExecutor txExecutor,HBaseConsumerStateStore stateStore,QueueName queueName,QueueBarrier start,@Nullable QueueBarrier end,final QueueStatistics outStats) throws Exception {
  final byte[] queueRowPrefix=QueueEntryRow.getQueueRowPrefix(queueName);
  ConsumerGroupConfig groupConfig=start.getGroupConfig();
  System.out.printf("String_Node_Str",groupConfig);
  HBaseQueueAdmin admin=queueClientFactory.getQueueAdmin();
  TableId tableId=admin.getDataTableId(queueName,QueueConstants.QueueType.SHARDED_QUEUE);
  HTable hTable=queueClientFactory.createHTable(tableId);
  System.out.printf("String_Node_Str",Bytes.toString(hTable.getTableName()));
  final byte[] stateColumnName=Bytes.add(QueueEntryRow.STATE_COLUMN_PREFIX,Bytes.toBytes(groupConfig.getGroupId()));
  int distributorBuckets=queueClientFactory.getDistributorBuckets(hTable.getTableDescriptor());
  ShardedHBaseQueueStrategy queueStrategy=new ShardedHBaseQueueStrategy(distributorBuckets);
  Scan scan=new Scan();
  scan.setStartRow(start.getStartRow());
  if (end != null) {
    scan.setStopRow(end.getStartRow());
  }
 else {
    scan.setStopRow(QueueEntryRow.getQueueEntryRowKey(queueName,Long.MAX_VALUE,Integer.MAX_VALUE));
  }
  scan.addColumn(QueueEntryRow.COLUMN_FAMILY,QueueEntryRow.META_COLUMN);
  scan.addColumn(QueueEntryRow.COLUMN_FAMILY,stateColumnName);
  scan.setCacheBlocks(false);
  scan.setMaxVersions(1);
  System.out.printf("String_Node_Str",scan.toString());
  List<Integer> instanceIds=Lists.newArrayList();
  if (groupConfig.getDequeueStrategy() == DequeueStrategy.FIFO) {
    instanceIds.add(0);
  }
 else {
    for (int instanceId=0; instanceId < groupConfig.getGroupSize(); instanceId++) {
      instanceIds.add(instanceId);
    }
  }
  final int rowsCache=Integer.parseInt(System.getProperty("String_Node_Str","String_Node_Str"));
  for (  final int instanceId : instanceIds) {
    System.out.printf("String_Node_Str",instanceId);
    ConsumerConfig consConfig=new ConsumerConfig(groupConfig,instanceId);
    final QueueScanner scanner=queueStrategy.createScanner(consConfig,hTable,scan,rowsCache);
    try {
      txExecutor.execute(new TransactionExecutor.Procedure<HBaseConsumerStateStore>(){
        @Override public void apply(        HBaseConsumerStateStore input) throws Exception {
          ImmutablePair<byte[],Map<byte[],byte[]>> result;
          while ((result=scanner.next()) != null) {
            byte[] rowKey=result.getFirst();
            Map<byte[],byte[]> columns=result.getSecond();
            visitRow(outStats,input.getTransaction(),rowKey,columns.get(stateColumnName),queueRowPrefix.length);
            if (Boolean.parseBoolean(System.getProperty("String_Node_Str")) && outStats.getTotal() % rowsCache == 0) {
              System.out.printf("String_Node_Str",instanceId,outStats.getReport());
            }
          }
        }
      }
,stateStore);
    }
 catch (    TransactionFailureException e) {
      if (!(Throwables.getRootCause(e) instanceof TransactionNotInProgressException)) {
        throw Throwables.propagate(e);
      }
    }
    System.out.printf("String_Node_Str",instanceId,outStats.getReport());
  }
}