本文整理汇总了Java中com.google.code.or.common.glossary.Row类的典型用法代码示例。如果您正苦于以下问题:Java Row类的具体用法?Java Row怎么用?Java Row使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Row类属于com.google.code.or.common.glossary包,在下文中一共展示了Row类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: executeInsertPstmt
import com.google.code.or.common.glossary.Row; //导入依赖的package包/类
private void executeInsertPstmt(int stmtId, List<Row> rows) {
PreparedStatement script = session.getPrepared(stmtId);
for (Row row: rows) {
Parameters param = toParameters(row);
checkParameters(script, param);
try {
Object result = script.run(this.session, param);
checkResult(result);
}
catch (OrcaException x) {
if (x.getMessage().equals("EXISTENCE_VIOLATION")) {
_log.warn("INSERT failure is ignored");
return;
}
throw x;
}
}
}
开发者ID:waterguo,项目名称:antsdb,代码行数:19,代码来源:MysqlSlave.java
示例2: executeUpdatePstmt
import com.google.code.or.common.glossary.Row; //导入依赖的package包/类
private void executeUpdatePstmt(long tableId, int stmtId, TableMeta meta, List<Pair<Row>> rows)
throws SQLException {
PreparedStatement script = session.getPrepared(stmtId);
for (Pair<Row> pair: rows) {
Parameters param = toParameters(meta, pair);
checkParameters(script, param);
Object result = script.run(this.session, param);
if ((result instanceof Integer) && (((Integer)result) == 0)) {
// fall back to insert if update failed
_log.warn("update failed with 0 update count {}, switching to insert", meta.getObjectName().toString());
_log.warn("{}", pair);
executeInsertPstmt(tableId, Collections.singletonList(pair.getAfter()));
return;
}
checkResult(result);
}
}
开发者ID:waterguo,项目名称:antsdb,代码行数:18,代码来源:MysqlSlave.java
示例3: MysqlBinlogData
import com.google.code.or.common.glossary.Row; //导入依赖的package包/类
public MysqlBinlogData(
Table table,
MysqlBinlogHandler binlogType,
Row rowBefore,
Row rowAfter){
this.table = table;
this.binlogType = binlogType;
if(rowBefore != null){
this.rowBefore = Collections.unmodifiableList(rowBefore.getColumns());
}else{
this.rowBefore = null;
}
if(rowAfter != null){
this.rowAfter = Collections.unmodifiableList(rowAfter.getColumns());
}else{
this.rowAfter = null;
}
}
开发者ID:kakao,项目名称:adt,代码行数:21,代码来源:MysqlBinlogData.java
示例4: getData
import com.google.code.or.common.glossary.Row; //导入依赖的package包/类
private List<Map<String, Object>> getData(String tableName, List<Row> rows) {
List<Map<String, Object>> dataList = new ArrayList<Map<String, Object>>();
for (Row row : rows) {
Map<String, Object> data = new HashMap<String, Object>();
List<Column> columns = row.getColumns();
List<ColumnInfo> columnSchemaInfo = databaseInfo.getTableInfo(tableName).getRowInfo().getColumnInfo();
for (int index = 0; index < columns.size(); ++index) {
ColumnInfo columnInfo = columnSchemaInfo.get(index);
Column col = columns.get(index);
data.put(columnInfo.getName(),
columnInfo.getColumnDataType().getConvertedValue(columnInfo.getColumnDataType(),
col.getValue()));
}
dataList.add(data);
}
return dataList;
}
开发者ID:flipkart-incubator,项目名称:storm-mysql,代码行数:18,代码来源:SpoutBinLogEventListener.java
示例5: getRowPairs
import com.google.code.or.common.glossary.Row; //导入依赖的package包/类
private static List<Pair<Row>> getRowPairs(List<MySqlValue> oldValueList, List<MySqlValue> newValueList) {
List<Pair<Row>> rowPairs = new ArrayList<Pair<Row>>();
Row oldRow = new Row();
Row newRow = new Row();
List<Column> oldColumns = new ArrayList<Column>();
List<Column> newColumns = new ArrayList<Column>();
for (int index = 0; index < oldValueList.size(); ++index) {
MySqlValue oldValue = oldValueList.get(index);
oldColumns.add(getColumn(oldValue));
MySqlValue newValue = newValueList.get(index);
newColumns.add(getColumn(newValue));
}
oldRow.setColumns(oldColumns);
newRow.setColumns(newColumns);
Pair<Row> rowPair = new Pair<Row>(oldRow, newRow);
rowPairs.add(rowPair);
return rowPairs;
}
开发者ID:flipkart-incubator,项目名称:storm-mysql,代码行数:21,代码来源:BinLogEventGenerator.java
示例6: executeDeletePstmt
import com.google.code.or.common.glossary.Row; //导入依赖的package包/类
private void executeDeletePstmt(int stmtId, TableMeta meta, List<Row> rows) {
PreparedStatement script = session.getPrepared(stmtId);
for (Row row: rows) {
Parameters param = toParameters(meta, row);
checkParameters(script, param);
Object result = script.run(this.session, param);
if ((result instanceof Integer) && (((Integer)result) == 0)) {
_log.warn("delete failed with 0 update count {}", meta.getObjectName().toString());
_log.warn("{}", row);
return;
}
checkResult(result);
}
}
开发者ID:waterguo,项目名称:antsdb,代码行数:15,代码来源:MysqlSlave.java
示例7: toParameters
import com.google.code.or.common.glossary.Row; //导入依赖的package包/类
private Parameters toParameters(Row row) {
List<Column> columns = row.getColumns();
Object[] pureValues = new Object[columns.size()];
for (int i=0; i<columns.size(); i++) {
pureValues[i] = toParameter(columns.get(i));
}
return new Parameters(pureValues);
}
开发者ID:waterguo,项目名称:antsdb,代码行数:9,代码来源:MysqlSlave.java
示例8: getInstance
import com.google.code.or.common.glossary.Row; //导入依赖的package包/类
public static MysqlBinlogTask getInstance(
final MysqlBinlogProcessor processor,
final TableMapEvent tableMapEvent,
final MysqlBinlogHandler type,
final Row oldRow,
final Row newRow,
final String binlogFileName,
final long binlogPosition,
final long binlogTimestamp,
final int binlogCurrentRowNumber,
final int binlogTotalRowNumber){
MysqlBinlogTask task = new MysqlBinlogTask();
task.initialize(
processor,
tableMapEvent,
type,
oldRow,
newRow,
binlogFileName,
binlogPosition,
binlogTimestamp,
binlogCurrentRowNumber,
binlogTotalRowNumber);
return task;
}
开发者ID:kakao,项目名称:adt,代码行数:29,代码来源:MysqlBinlogTask.java
示例9: initialize
import com.google.code.or.common.glossary.Row; //导入依赖的package包/类
private void initialize(
final MysqlBinlogProcessor processor,
final TableMapEvent tableMapEvent,
final MysqlBinlogHandler type,
final Row oldRow,
final Row newRow,
final String binlogFileName,
final long binlogPosition,
final long binlogTimestamp,
final int binlogCurrentRowNumber,
final int binlogTotalRowNumber){
this.processor = processor;
this.tableMapEvent = tableMapEvent;
this.type = type;
this.oldRow = oldRow;
this.newRow = newRow;
this.binlogFileName = binlogFileName;
this.binlogPosition = binlogPosition;
this.binlogTimestamp = binlogTimestamp;
this.binlogCurrentRowNumber = binlogCurrentRowNumber;
this.binlogTotalRowNumber = binlogTotalRowNumber;
dependencyValues.clear();
waitingFlag.clear();
waitingCount.set(0);
_isFinished = false;
// gen idx value
calcDepedencyValues();
}
开发者ID:kakao,项目名称:adt,代码行数:33,代码来源:MysqlBinlogTask.java
示例10: calcDependencyValue
import com.google.code.or.common.glossary.Row; //导入依赖的package包/类
private void calcDependencyValue(String dbName, String tableName, Row row, Index idx){
final List<com.google.code.or.common.glossary.Column> columnList = row.getColumns();
StringBuilder builder = new StringBuilder(dbName)
.append('.').append(tableName)
.append('.').append(idx.getName());
for(int i=0; i<idx.getColumns().size(); i++){
builder.append('[').append(idx.getColumn(i).getName()).append('=');
com.google.code.or.common.glossary.Column col = columnList.get(idx.getColumn(i).getPosition());
Object value = col.getValue();
if(value == null){
}else if(value instanceof byte[]){
Arrays.toString((byte[])value);
}else{
builder.append(value.toString());
}
builder.append("]");
}
dependencyValues.add(builder.toString());
}
开发者ID:kakao,项目名称:adt,代码行数:28,代码来源:MysqlBinlogTask.java
示例11: getRows
import com.google.code.or.common.glossary.Row; //导入依赖的package包/类
private static List<Row> getRows(List<MySqlValue> valueList) {
List<Row> rows = new ArrayList<Row>();
Row singleRow = new Row();
List<Column> columns = new ArrayList<Column>();
for (MySqlValue value : valueList) {
columns.add(getColumn(value));
}
singleRow.setColumns(columns);
rows.add(singleRow);
return rows;
}
开发者ID:flipkart-incubator,项目名称:storm-mysql,代码行数:12,代码来源:BinLogEventGenerator.java
示例12: convertPrimaryKeyData
import com.google.code.or.common.glossary.Row; //导入依赖的package包/类
static Struct convertPrimaryKeyData(Schema pkSchema, Table table, Row row) {
Struct pkStruct = new Struct(pkSchema);
for (String pk : table.getPKList()) {
int idx = table.findColumnIndex(pk);
Column column = row.getColumns().get(idx);
ColumnDef def = table.getColumnList().get(idx);
addFieldData(pkStruct, def, column);
}
return pkStruct;
}
开发者ID:wushujames,项目名称:kafka-mysql-connector,代码行数:14,代码来源:DataConverter.java
示例13: convertRowData
import com.google.code.or.common.glossary.Row; //导入依赖的package包/类
static Struct convertRowData(Schema rowSchema, Table table, Row row) {
Struct rowStruct = new Struct(rowSchema);
for (int columnNumber = 0; columnNumber < table.getColumnList().size(); columnNumber++) {
Column column = row.getColumns().get(columnNumber);
ColumnDef def = table.getColumnList().get(columnNumber);
addFieldData(rowStruct, def, column);
}
return rowStruct;
}
开发者ID:wushujames,项目名称:kafka-mysql-connector,代码行数:12,代码来源:DataConverter.java
示例14: getRowBefore
import com.google.code.or.common.glossary.Row; //导入依赖的package包/类
public Row getRowBefore(){
return oldRow;
}
开发者ID:kakao,项目名称:adt,代码行数:4,代码来源:MysqlBinlogTask.java
示例15: getRowAfter
import com.google.code.or.common.glossary.Row; //导入依赖的package包/类
public Row getRowAfter(){
return newRow;
}
开发者ID:kakao,项目名称:adt,代码行数:4,代码来源:MysqlBinlogTask.java
注:本文中的com.google.code.or.common.glossary.Row类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论