本文整理汇总了Java中org.voltdb.VoltTableRow.getString方法的典型用法代码示例。如果您正苦于以下问题:Java VoltTableRow.getString方法的具体用法?Java VoltTableRow.getString怎么用?Java VoltTableRow.getString使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.voltdb.VoltTableRow
的用法示例。
在下文中一共展示了VoltTableRow.getString方法的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: constructTableState
import org.voltdb.VoltTableRow; //导入方法依赖的package包/类
private TableSaveFileState constructTableState(
VoltTableRow row)
{
TableSaveFileState table_state = null;
String table_name = row.getString("TABLE");
if (row.getString("IS_REPLICATED").equals("TRUE"))
{
table_state = new ReplicatedTableSaveFileState(table_name, m_allowExport);
table_state.setSystemProcedureExecutionContext(this.m_context);
}
else if (row.getString("IS_REPLICATED").equals("FALSE"))
{
table_state = new PartitionedTableSaveFileState(table_name, m_allowExport);
table_state.setSystemProcedureExecutionContext(this.m_context);
}
else
{
// XXX not reached
assert(false);
}
return table_state;
}
示例2: hashToSnapshot
import org.voltdb.VoltTableRow; //导入方法依赖的package包/类
private void hashToSnapshot(VoltTableRow r, HashMap<String, Snapshot> aggregates) {
assert (r.getString("RESULT").equals("SUCCESS"));
assert ("TRUE".equals(r.getString("READABLE")));
final String path = r.getString("PATH");
final String nonce = r.getString("NAME").substring(0, r.getString("NAME").indexOf('-'));
final String combined = path + nonce;
Snapshot s = aggregates.get(combined);
if (s == null) {
s = new Snapshot(r);
aggregates.put(combined, s);
} else {
if (r.getLong("CREATED") != s.m_createTime) {
return;
}
s.processRow(r);
}
}
示例3: run
import org.voltdb.VoltTableRow; //导入方法依赖的package包/类
public VoltTable[] run(long acct_id) throws VoltAbortException {
voltQueueSQL(getTradeStatus, acct_id);
voltQueueSQL(getName, acct_id);
// we need only the first table
VoltTable ts = voltExecuteSQL()[0];
VoltTable result = trade_status_ret_template.clone(256);
for (int i = 0; i < ts.getRowCount(); i++) {
VoltTableRow ts_row = ts.fetchRow(i);
String status_name = ts_row.getString("ST_NAME");
long trade_id = ts_row.getLong("T_ID");
result.addRow(status_name, trade_id);
}
return new VoltTable[] {result};
}
示例4: run
import org.voltdb.VoltTableRow; //导入方法依赖的package包/类
public long run(int partId, VoltTable sp2Data, long[] extraArgs) {
for (int i=0; i < sp2Data.getRowCount(); i++) {
VoltTableRow row = sp2Data.fetchRow(i);
String symbol = row.getString("T_S_SYMB");
voltQueueSQL(getSecurityID, symbol, partId);
VoltTable v[] = voltExecuteSQL();
long SK_SecurityID = v[0].fetchRow(0).getLong(0);
long SK_CompanyID = v[0].fetchRow(0).getLong(1);
voltQueueSQL(insertSP3Out, row.getLong("T_ID"), row.getLong("SK_CreateDateID"), row.getLong("SK_CreateTimeID"),
row.getLong("SK_CloseDateID"), row.getLong("SK_CloseTimeID"), row.getString("Status"), row.getString("Type"),
(short) row.getLong("T_IS_CASH"), SK_SecurityID, SK_CompanyID, (int) row.getLong("T_QTY"),
row.getDouble("T_BID_PRICE"), (int) row.getLong("T_CA_ID"), row.getString("T_EXEC_NAME"),
row.getDouble("T_TRADE_PRICE"), row.getDouble("T_CHRG"), row.getDouble("T_COMM"), row.getDouble("T_TAX"),
row.getLong("batch_id"), partId);
int destinationPartition = TPCDIUtil.hashCode(TPCDIConstants.DIMACCOUNT_TABLE,String.valueOf(row.getLong("T_CA_ID")));
voltExecuteSQLDownStream("SP3out", destinationPartition);
}
// Set the return value to 0: successful vote
return TPCDIConstants.PROC_SUCCESSFUL;
}
示例5: run
import org.voltdb.VoltTableRow; //导入方法依赖的package包/类
public long run(int partId, VoltTable sp2Data, long[] extraArgs) {
for (int i=0; i < sp2Data.getRowCount(); i++) {
VoltTableRow row = sp2Data.fetchRow(i);
String symbol = row.getString("T_S_SYMB");
voltQueueSQL(getSecurityID, symbol, partId);
VoltTable v[] = voltExecuteSQL();
long SK_SecurityID = v[0].fetchRow(0).getLong(0);
long SK_CompanyID = v[0].fetchRow(0).getLong(1);
voltQueueSQL(insertSP3Out, row.getLong("T_ID"), row.getLong("SK_CreateDateID"), row.getLong("SK_CreateTimeID"),
row.getLong("SK_CloseDateID"), row.getLong("SK_CloseTimeID"), row.getString("Status"), row.getString("Type"),
(short) row.getLong("T_IS_CASH"), SK_SecurityID, SK_CompanyID, (int) row.getLong("T_QTY"),
row.getDouble("T_BID_PRICE"), (int) row.getLong("T_CA_ID"), row.getString("T_EXEC_NAME"),
row.getDouble("T_TRADE_PRICE"), row.getDouble("T_CHRG"), row.getDouble("T_COMM"), row.getDouble("T_TAX"),
row.getLong("batch_id"), partId);
int destinationPartition = TPCDIUtil.hashCode(String.valueOf(row.getLong("T_CA_ID")), TPCDIConstants.NUM_PARTITIONS);
voltExecuteSQLDownStream("SP3out", destinationPartition);
}
// Set the return value to 0: successful vote
return TPCDIConstants.PROC_SUCCESSFUL;
}
示例6: Snapshot
import org.voltdb.VoltTableRow; //导入方法依赖的package包/类
private Snapshot(VoltTableRow r) {
assert (r.getString("RESULT").equals("SUCCESS"));
assert ("TRUE".equals(r.getString("READABLE")));
assert ("TRUE".equals(r.getString("COMPLETED")));
m_createTime = r.getLong("CREATED");
Table t = new Table(r);
m_tables.put(t.m_name, t);
m_nonce = r.getString("NAME").substring(0, r.getString("NAME").indexOf('-'));
m_path = r.getString("PATH");
}
示例7: hashDigestToSnapshot
import org.voltdb.VoltTableRow; //导入方法依赖的package包/类
private void hashDigestToSnapshot(VoltTableRow r, HashMap<String, Snapshot> aggregates) {
assert (r.getString("RESULT").equals("SUCCESS"));
final String path = r.getString("PATH");
final String nonce = r.getString("NAME").substring(0, r.getString("NAME").indexOf(".digest"));
final String combined = path + nonce;
Snapshot s = aggregates.get(combined);
if (s == null) {
return;
} else {
s.processDigest(r.getString("TABLES"));
}
}
示例8: map
import org.voltdb.VoltTableRow; //导入方法依赖的package包/类
@Override
public void map(VoltTableRow row) {
String key = row.getString(0); // A_NAME
Object new_row[] = {
key,
row.getLong(1)
};
this.mapEmit(key, new_row); // mapOutputTable
}
示例9: Table
import org.voltdb.VoltTableRow; //导入方法依赖的package包/类
private Table(VoltTableRow r) {
assert (r.getString("RESULT").equals("SUCCESS"));
assert ("TRUE".equals(r.getString("READABLE")));
assert ("TRUE".equals(r.getString("COMPLETED")));
m_totalPartitions = (int) r.getLong("TOTAL_PARTITIONS");
m_createTime = r.getLong("CREATED");
m_name = r.getString("TABLE");
String partitions[] = r.getString("PARTITIONS").split(",");
for (String partition : partitions) {
m_partitionsSeen.add(Long.parseLong(partition));
}
m_size += r.getLong("SIZE");
}
示例10: run
import org.voltdb.VoltTableRow; //导入方法依赖的package包/类
public long run(int partId, VoltTable sp1Data, long[] extraArgs) {
for (int i=0; i < sp1Data.getRowCount(); i++) {
VoltTableRow row = sp1Data.fetchRow(i);
String T_ST_ID = row.getString("T_ST_ID");
String T_TT_ID = row.getString("T_TT_ID");
//get date and time
String T_DTS = row.getString("T_DTS");
String date = T_DTS.split(" ")[0];
String[] time = T_DTS.split(" ")[1].split(":");
int hour = new Integer(time[0]);
int min = new Integer(time[1]);
int sec = new Integer(time[2]);
voltQueueSQL(getStatus, T_ST_ID, partId);
voltQueueSQL(getTradeType, T_TT_ID, partId);
voltQueueSQL(getDateID, date, partId);
voltQueueSQL(getTimeID, hour,min,sec, partId);
VoltTable[] results = voltExecuteSQL();
String status = results[0].fetchRow(0).getString(0);
String type = results[1].fetchRow(0).getString(0);
String symbol = row.getString("T_S_SYMB");
long SK_CreateDateID = -1;
long SK_CreateTimeID = -1;
long SK_CloseDateID = -1;
long SK_CloseTimeID = -1;
if((T_ST_ID.equals("SBMT") && (T_TT_ID.equals("TMB") || T_TT_ID.equals("TMS"))) || T_ST_ID.equals("PNDG")) {
SK_CreateDateID = results[2].fetchRow(0).getLong(0);
SK_CreateTimeID = results[3].fetchRow(0).getLong(0);
}
else if (T_ST_ID.equals("CMPT") || T_ST_ID.equals("CNCL")) {
SK_CloseDateID = results[2].fetchRow(0).getLong(0);
SK_CloseTimeID = results[3].fetchRow(0).getLong(0);
}
voltQueueSQL(insertSP2Out, row.getLong("T_ID"), SK_CreateDateID, SK_CreateTimeID, SK_CloseDateID, SK_CloseTimeID,
status, type, (short) row.getLong("T_IS_CASH"), symbol, (int) row.getLong("T_QTY"),
row.getDouble("T_BID_PRICE"), (int) row.getLong("T_CA_ID"), row.getString("T_EXEC_NAME"),
row.getDouble("T_TRADE_PRICE"), row.getDouble("T_CHRG"), row.getDouble("T_COMM"), row.getDouble("T_TAX"),
row.getLong("batch_id"), partId);
int destinationPartition = TPCDIUtil.hashCode(symbol, TPCDIConstants.NUM_PARTITIONS);
voltExecuteSQLDownStream("SP2out", destinationPartition);
}
// Set the return value to 0: successful vote
return TPCDIConstants.PROC_SUCCESSFUL;
}
示例11: run
import org.voltdb.VoltTableRow; //导入方法依赖的package包/类
public long run(int partId, VoltTable sp1Data, long[] extraArgs) {
for (int i=0; i < sp1Data.getRowCount(); i++) {
VoltTableRow row = sp1Data.fetchRow(i);
String T_ST_ID = row.getString("T_ST_ID");
String T_TT_ID = row.getString("T_TT_ID");
//get date and time
String T_DTS = row.getString("T_DTS");
String date = T_DTS.split(" ")[0];
String[] time = T_DTS.split(" ")[1].split(":");
int hour = new Integer(time[0]);
int min = new Integer(time[1]);
int sec = new Integer(time[2]);
voltQueueSQL(getStatus, T_ST_ID, partId);
voltQueueSQL(getTradeType, T_TT_ID, partId);
voltQueueSQL(getDateID, date, partId);
voltQueueSQL(getTimeID, hour,min,sec, partId);
VoltTable[] results = voltExecuteSQL();
String status = results[0].fetchRow(0).getString(0);
String type = results[1].fetchRow(0).getString(0);
String symbol = row.getString("T_S_SYMB");
long SK_CreateDateID = -1;
long SK_CreateTimeID = -1;
long SK_CloseDateID = -1;
long SK_CloseTimeID = -1;
if((T_ST_ID.equals("SBMT") && (T_TT_ID.equals("TMB") || T_TT_ID.equals("TMS"))) || T_ST_ID.equals("PNDG")) {
SK_CreateDateID = results[2].fetchRow(0).getLong(0);
SK_CreateTimeID = results[3].fetchRow(0).getLong(0);
}
else if (T_ST_ID.equals("CMPT") || T_ST_ID.equals("CNCL")) {
SK_CloseDateID = results[2].fetchRow(0).getLong(0);
SK_CloseTimeID = results[3].fetchRow(0).getLong(0);
}
voltQueueSQL(insertSP2Out, row.getLong("T_ID"), SK_CreateDateID, SK_CreateTimeID, SK_CloseDateID, SK_CloseTimeID,
status, type, (short) row.getLong("T_IS_CASH"), symbol, (int) row.getLong("T_QTY"),
row.getDouble("T_BID_PRICE"), (int) row.getLong("T_CA_ID"), row.getString("T_EXEC_NAME"),
row.getDouble("T_TRADE_PRICE"), row.getDouble("T_CHRG"), row.getDouble("T_COMM"), row.getDouble("T_TAX"),
row.getLong("batch_id"), partId);
int destinationPartition = TPCDIUtil.hashCode(TPCDIConstants.DIMSECURITY_TABLE,symbol);
voltExecuteSQLDownStream("SP2out", destinationPartition);
}
// Set the return value to 0: successful vote
return TPCDIConstants.PROC_SUCCESSFUL;
}
示例12: getStatSysSP
import org.voltdb.VoltTableRow; //导入方法依赖的package包/类
/**
* collect statistics before client disconnect using system stored procedure
* @param client
* @throw Exception
* @return string
*/
private String getStatSysSP(Client client) throws Exception {
LOG.info("collecting statistics using system stored procedure");
StringBuffer statStr = new StringBuffer();
String[] columns = {"PROCEDURE", "RECEIVED", "EXECUTED", "COMPLETED", "ABORTED", "REJECTED"};
ClientResponse cresponse = client.callProcedure("@Statistics", "TXNCOUNTER", 0);
VoltTable[] results = cresponse.getResults();
VoltTable vt = results[0];
VoltTableRow vtRow = vt.cloneRow();
int numRow = vt.getRowCount();
while(vtRow.advanceRow()) {
if (vtRow.getString("procedure").charAt(0) == '@') {
numRow--;
}
}
Object statStrTable[][] = new String[numRow + 1][columns.length];
for (int i = 0; i < columns.length; i++) {
statStrTable[0][i] = columns[i];
}
int currRow = 1;
vtRow.resetRowPosition();
while (vtRow.advanceRow()) {
if (vtRow.getString("procedure").charAt(0) == '@') {
continue;
}
for (int i = 0; i < columns.length; i++) {
if (i == 0) {
statStrTable[currRow][i] = vtRow.getString(columns[i]);
} else {
statStrTable[currRow][i] = String.valueOf(vtRow.getLong(columns[i]));
}
}
currRow += 1;
}
statStr.append("Transactions Statistics, Including Warm Up:\n\n");
statStr.append(TableUtil.table(statStrTable));
statStr.append(String.format("\n%s\n", StringUtil.repeat("=", 100)));
return statStr.toString();
}