当前位置: 首页>>代码示例>>Java>>正文


Java VoltTableRow.getLong方法代码示例

本文整理汇总了Java中org.voltdb.VoltTableRow.getLong方法的典型用法代码示例。如果您正苦于以下问题:Java VoltTableRow.getLong方法的具体用法?Java VoltTableRow.getLong怎么用?Java VoltTableRow.getLong使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.voltdb.VoltTableRow的用法示例。


在下文中一共展示了VoltTableRow.getLong方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: 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};
}
 
开发者ID:s-store,项目名称:s-store,代码行数:20,代码来源:TradeStatus.java

示例2: reduce

import org.voltdb.VoltTableRow; //导入方法依赖的package包/类
public void reduce(String key, Iterator<VoltTableRow> rows) {
        long count = 0;
        for (VoltTableRow r : CollectionUtil.iterable(rows)) {
            assert(r != null);
            //Long ct = (Long)r.getLong(1);
            long ct = (long)r.getLong(1);
            count+=ct;

            //System.out.println("....key is: " + key + " Value: "+count);
        } // FOR
      
//        while (rows.hasNext()) {
//            System.out.println("[row]: "+ key);
//            count++;
//        }
        
        Object new_row[] = {
            key,
            count
        };
        
        this.reduceOutput.addRow(new_row);
    }
 
开发者ID:s-store,项目名称:s-store,代码行数:24,代码来源:TestReduceInputIterator.java

示例3: 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);
    }
}
 
开发者ID:s-store,项目名称:sstore-soft,代码行数:18,代码来源:SnapshotScan.java

示例4: run

import org.voltdb.VoltTableRow; //导入方法依赖的package包/类
public VoltTable[] run(short w_id, byte d_id, double h_amount, short c_w_id, byte c_d_id, String c_last, TimestampType timestamp) throws VoltAbortException {
//        voltQueueSQL(getCustomersByLastName, c_last, c_d_id, c_w_id);
        voltQueueSQL(getCidByLastName, c_last, c_d_id, c_w_id);
        final VoltTable customersIds = voltExecuteSQL()[0];
        final int namecnt = customersIds.getRowCount();
        if (namecnt == 0) {
            throw new VoltAbortException("no customers with last name: " + c_last + " in warehouse: "
                    + c_w_id + " and in district " + c_d_id);
        }

        final int index = (namecnt-1)/2;
        final VoltTableRow customerIdRow = customersIds.fetchRow(index);
        final int c_id = (int)customerIdRow.getLong(C_ID_IDX);
        
        voltQueueSQL(getCustomersByCustomerId, c_id, c_d_id, c_w_id);
        final VoltTableRow customer = voltExecuteSQL()[0].fetchRow(0);
        return processPayment(w_id, d_id, c_w_id, c_d_id, c_id, h_amount, customer, timestamp);
    }
 
开发者ID:s-store,项目名称:s-store,代码行数:19,代码来源:paymentByCustomerName.java

示例5: addHostData

import org.voltdb.VoltTableRow; //导入方法依赖的package包/类
@Override
void addHostData(VoltTableRow row) throws IOException {
    assert (row.getString("TABLE").equals(getTableName()));

    if (m_totalPartitions == 0) {
        // XXX this cast should be okay unless we exceed MAX_INT partitions
        m_totalPartitions = (int) row.getLong("TOTAL_PARTITIONS");
    }
    checkSiteConsistency(row); // throws if inconsistent

    int originalPartitionId = (int) row.getLong("PARTITION");
    m_partitionsSeen.add(originalPartitionId);
    int currentHostId = (int) row.getLong("CURRENT_HOST_ID");
    Set<Pair<Integer, Integer>> partitions_at_host = null;
    if (!(m_partitionsAtHost.containsKey(currentHostId))) {
        partitions_at_host = new HashSet<Pair<Integer, Integer>>();
        m_partitionsAtHost.put(currentHostId, partitions_at_host);
    }
    partitions_at_host = m_partitionsAtHost.get(currentHostId);

    partitions_at_host.add(Pair.of(originalPartitionId, (int) row.getLong("ORIGINAL_HOST_ID")));
}
 
开发者ID:s-store,项目名称:s-store,代码行数:23,代码来源:PartitionedTableSaveFileState.java

示例6: map

import org.voltdb.VoltTableRow; //导入方法依赖的package包/类
@Override
public void map(VoltTableRow row) {
    long key = row.getLong(0); // A_NAME
    long quantity = row.getLong(1);
    double amount = row.getDouble(2);
    double price = row.getDouble(3);
    long ct = row.getLong(4);
    Object new_row[] = {
            key,
            quantity, // FIXME row.getLong(1)
            amount,
            price,
            ct
    };
    this.mapEmit(key, new_row);
}
 
开发者ID:s-store,项目名称:sstore-soft,代码行数:17,代码来源:MRqueryJoinAgg.java

示例7: 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");
}
 
开发者ID:s-store,项目名称:s-store,代码行数:11,代码来源:SnapshotScan.java

示例8: run

import org.voltdb.VoltTableRow; //导入方法依赖的package包/类
public long run(int partId, VoltTable sp3Data, long[] extraArgs) {

		for (int i=0; i < sp3Data.getRowCount(); i++) {
			VoltTableRow row = sp3Data.fetchRow(i);
			long ca_id = row.getLong("T_CA_ID");
			voltQueueSQL(getAccountInfo, ca_id, partId);
			VoltTable v[] = voltExecuteSQL();
			long SK_AccountID = v[0].fetchRow(0).getLong(0);
			long SK_CustomerID = v[0].fetchRow(0).getLong(1);
			long SK_BrokerID = v[0].fetchRow(0).getLong(2);

			voltQueueSQL(insertSP4Out,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"),
					row.getLong("SK_SecurityID"),row.getLong("SK_CompanyID"),(int)row.getLong("T_QTY"),row.getDouble("T_BID_PRICE"),
					SK_AccountID,SK_CustomerID,SK_BrokerID,
					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_ID")), TPCDIConstants.NUM_PARTITIONS);
			voltExecuteSQLDownStream("SP4out", destinationPartition);
		}
        // Set the return value to 0: successful vote
        return TPCDIConstants.PROC_SUCCESSFUL;
    }
 
开发者ID:s-store,项目名称:s-store,代码行数:29,代码来源:SP4GetAccountInfo.java

示例9: 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
}
 
开发者ID:s-store,项目名称:sstore-soft,代码行数:10,代码来源:MockMapReduce.java

示例10: run

import org.voltdb.VoltTableRow; //导入方法依赖的package包/类
public long run(int partId, VoltTable sp3Data, long[] extraArgs) {

		for (int i=0; i < sp3Data.getRowCount(); i++) {
			VoltTableRow row = sp3Data.fetchRow(i);
			long ca_id = row.getLong("T_CA_ID");
			voltQueueSQL(getAccountInfo, ca_id, partId);
			VoltTable v[] = voltExecuteSQL();
			long SK_AccountID = v[0].fetchRow(0).getLong(0);
			long SK_CustomerID = v[0].fetchRow(0).getLong(1);
			long SK_BrokerID = v[0].fetchRow(0).getLong(2);

			voltQueueSQL(insertSP4Out,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"),
					row.getLong("SK_SecurityID"),row.getLong("SK_CompanyID"),(int)row.getLong("T_QTY"),row.getDouble("T_BID_PRICE"),
					SK_AccountID,SK_CustomerID,SK_BrokerID,
					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.DIMTRADE_TABLE,String.valueOf(row.getLong("T_ID")));
			voltExecuteSQLDownStream("SP4out", destinationPartition);
		}
        // Set the return value to 0: successful vote
        return TPCDIConstants.PROC_SUCCESSFUL;
    }
 
开发者ID:s-store,项目名称:s-store,代码行数:29,代码来源:SP4GetAccountInfo.java

示例11: 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");
}
 
开发者ID:s-store,项目名称:s-store,代码行数:14,代码来源:SnapshotScan.java

示例12: run

import org.voltdb.VoltTableRow; //导入方法依赖的package包/类
public long run(int partId, VoltTable sp4Data, long[] extraArgs) {
  	
for (int i=0; i < sp4Data.getRowCount(); i++) {
	VoltTableRow row = sp4Data.fetchRow(i);
	double tradePrice = row.getDouble("T_TRADE_PRICE");
	double quantity = (double)row.getLong("T_QTY");
	Double commission = row.getDouble("T_COMM");
	Double fee = row.getDouble("T_CHRG");
	long tradeID = row.getLong("T_ID");
	long batchID = row.getLong("batch_id");
	String messageText = "";
	String messageData = "";
	
	if(commission != null && commission > tradePrice*quantity){
		messageText = "Invalid trade commission";
		messageData = "T_ID=" + tradeID + ", T_COMM=" + commission;
		voltQueueSQL(insertMessage, batchID,"DimTrade","Alert",messageText,messageData,partId);
	}
	if(fee != null && fee > tradePrice*quantity){
		messageText = "Invalid trade fee";
		messageData = "T_ID=" + tradeID + ", T_CHRG=" + fee;
		voltQueueSQL(insertMessage, batchID, "DimTrade","Alert",messageText,messageData,partId);
	}

	voltQueueSQL(insertDimTrade, row.getLong("T_ID"), row.getLong("SK_BrokerID"), 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"),
			row.getLong("SK_SecurityID"), row.getLong("SK_CompanyID"), (int) row.getLong("T_QTY"),
			row.getDouble("T_BID_PRICE"), row.getLong("SK_CustomerID"), row.getLong("SK_AccountID"),
			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);
	
	voltExecuteSQL();
}
      // Set the return value to 0: successful vote
      return TPCDIConstants.PROC_SUCCESSFUL;
  }
 
开发者ID:s-store,项目名称:sstore-soft,代码行数:38,代码来源:SP5InsertTrade.java

示例13: map

import org.voltdb.VoltTableRow; //导入方法依赖的package包/类
@Override
public void map(VoltTableRow row) {
    long key = row.getLong(0); // A_NAME
    long quantity = row.getLong(1);
    double amount = row.getDouble(2);
    long ct = row.getLong(3);
    Object new_row[] = {
            key,
            quantity, // FIXME row.getLong(1)
            amount,
            ct
    };
    this.mapEmit(key, new_row);
}
 
开发者ID:s-store,项目名称:sstore-soft,代码行数:15,代码来源:MRquery1.java

示例14: map

import org.voltdb.VoltTableRow; //导入方法依赖的package包/类
@Override
public void map(VoltTableRow row) {
    long key = row.getLong(0);
    Object new_row[] = {
            key,
            row.getLong(1),
            row.getLong(2),
            row.getDouble(3),
            row.getTimestampAsTimestamp(4)
    };
    this.mapEmit(key, new_row);
}
 
开发者ID:s-store,项目名称:s-store,代码行数:13,代码来源:MRquery3.java

示例15: map

import org.voltdb.VoltTableRow; //导入方法依赖的package包/类
@Override
public void map(VoltTableRow row) {
    long key = row.getLong(0); 
    long line = row.getLong(1);
    long high_line_ct = 0; 
    long low_line_ct = 0;
    if (line == 1 || line == 2) high_line_ct = 1;
    if (line != 1 && line != 2) low_line_ct = 1;
    Object new_row[] = {
            key,
            high_line_ct,
            low_line_ct
    };
    this.mapEmit(key, new_row);
}
 
开发者ID:s-store,项目名称:sstore-soft,代码行数:16,代码来源:MRquery12.java


注:本文中的org.voltdb.VoltTableRow.getLong方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。