new FileInputStream(filepath)), 16 * 1024 * 1024);
String line = null;
String delimiter_ = new String(",");
RowMutationMessage rmInbox = null;
RowMutationMessage rmOutbox = null;
ColumnFamily cfInbox = null;
ColumnFamily cfOutbox = null;
while ((line = bufReader.readLine()) != null) {
StringTokenizer st = new StringTokenizer(line, delimiter_);
int i = 0;
String threadId = null;
int lastUpdated = 0;
int isDeleted = 0;
int folder = 0;
String user = null;
while (st.hasMoreElements()) {
switch (i) {
case 0:
user = (String) st.nextElement();// sb.append((String)st.nextElement());
break;
case 1:
folder = Integer.parseInt((String) st.nextElement());// sb.append((String)st.nextElement());
break;
case 2:
threadId = (String) st.nextElement();
break;
case 3:
lastUpdated = Integer.parseInt((String) st.nextElement());
break;
case 4:
isDeleted = Integer.parseInt((String) st.nextElement());// (String)st.nextElement();
break;
default:
break;
}
++i;
}
String key = null;
if (folder == 0) {
key = user + ":0";
} else {
key = user + ":1";
}
ReadCommand readCommand = new ReadCommand(tablename_, key);
Message message = new Message(from_, StorageService.readStage_,
StorageService.readVerbHandler_,
new Object[] {readCommand});
IAsyncResult iar = MessagingService.getMessagingInstance().sendRR(
message, to_);
Object[] result = iar.get();
ReadResponse readResponse = (ReadResponse) result[0];
Row row = readResponse.row();
if (row == null) {
logger_.debug("ERROR No row for this key .....: " + line);
Thread.sleep(1000/requestsPerSecond_, 1000%requestsPerSecond_);
errorCount_++;
} else {
Map<String, ColumnFamily> cfMap = row.getColumnFamilyMap();
if (cfMap == null || cfMap.size() == 0) {
logger_
.debug("ERROR ColumnFamil map is missing.....: "
+ threadId + " key:" + key
+ " record:" + line);
System.out
.println("ERROR ColumnFamil map is missing.....: "
+ threadId + " key:" + key
+ " record:" + line);
errorCount_++;
continue;
}
ColumnFamily cfamily = cfMap.get(columnFamily_);
if (cfamily == null) {
logger_
.debug("ERROR ColumnFamily is missing.....: "
+ threadId + " key:" + key
+ " record:" + line);
System.out
.println("ERROR ColumnFamily is missing.....: "
+ threadId + " key:" + key
+ " record:" + line);
errorCount_++;
continue;
}
IColumn clmn = cfamily.getColumn(threadId);
queryCount_++;
if (clmn == null) {
logger_.debug("ERROR Column is missing.....: " + threadId
+ " record:" + line);
System.out.println("ERROR Column is missing.....: "