本文整理汇总了Java中org.opencloudb.net.mysql.RowDataPacket.read方法的典型用法代码示例。如果您正苦于以下问题:Java RowDataPacket.read方法的具体用法?Java RowDataPacket.read怎么用?Java RowDataPacket.read使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.opencloudb.net.mysql.RowDataPacket
的用法示例。
在下文中一共展示了RowDataPacket.read方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: rowResponse
import org.opencloudb.net.mysql.RowDataPacket; //导入方法依赖的package包/类
@Override
public void rowResponse(byte[] row, BackendConnection conn) {
if (result == null) {
RowDataPacket rowDataPkg = new RowDataPacket(1);
rowDataPkg.read(row);
byte[] columnData = rowDataPkg.fieldValues.get(0);
String columnVal = new String(columnData);
result = columnVal;
dataNode = (String) conn.getAttachment();
} else {
LOGGER.warn("find multi data nodes for child table store, sql is: "
+ sql);
}
}
示例2: rowResponse
import org.opencloudb.net.mysql.RowDataPacket; //导入方法依赖的package包/类
@Override
public void rowResponse(byte[] row, PhysicalConnection conn) {
if (result == null) {
RowDataPacket rowDataPkg = new RowDataPacket(1);
rowDataPkg.read(row);
byte[] columnData = rowDataPkg.fieldValues.get(0);
String columnVal = new String(columnData);
result = columnVal;
dataNode = (String) conn.getAttachment();
} else {
LOGGER.warn("find multi data nodes for child table store, sql is: "
+ sql);
}
}
示例3: rowResponse
import org.opencloudb.net.mysql.RowDataPacket; //导入方法依赖的package包/类
@Override
public void rowResponse(byte[] row, BackendConnection conn) {
RowDataPacket rowDataPkg = new RowDataPacket(1);
rowDataPkg.read(row);
byte[] columnData = rowDataPkg.fieldValues.get(0);
String columnVal = new String(columnData);
SequnceVal seqVal = (SequnceVal) conn.getAttachment();
seqVal.dbretVal = seqVal.dbretVal = columnVal;
if (IncrSequenceMySQLHandler.errSeqResult.equals(columnVal)) {
LOGGER.warn(" sequnce sql returned err value ,sequence:"
+ seqVal.seqName + " " + columnVal + " sql:" + seqVal.sql);
}
}
示例4: rowResponse
import org.opencloudb.net.mysql.RowDataPacket; //导入方法依赖的package包/类
@Override
public void rowResponse(byte[] row, BackendConnection conn) {
if (errorRepsponsed) {
return;
}
lock.lock();
try {
if (dataMergeSvr != null) {
dataMergeSvr.onNewRecord(
((RouteResultsetNode) conn.getAttachment()).getName(),
row);
} else {
if (primaryKeyIndex != -1) {// cache
// primaryKey->
// dataNode
RowDataPacket rowDataPkg = new RowDataPacket(fieldCount);
rowDataPkg.read(row);
String primaryKey = new String(
rowDataPkg.fieldValues.get(primaryKeyIndex));
LayerCachePool pool = MycatServer.getInstance()
.getRouterservice().getTableId2DataNodeCache();
String dataNode = ((RouteResultsetNode) conn
.getAttachment()).getName();
pool.putIfAbsent(priamaryKeyTable, primaryKey, dataNode);
}
row[3] = ++packetId;
buffer = session.getSource().writeToBuffer(row, buffer);
}
} catch (Exception e) {
handleDataProcessException(e, conn);
} finally {
lock.unlock();
}
}
示例5: rowResponse
import org.opencloudb.net.mysql.RowDataPacket; //导入方法依赖的package包/类
@Override
public void rowResponse(byte[] row, BackendConnection conn) {
if (errorRepsponsed) {
return;
}
lock.lock();
try {
if (dataMergeSvr != null) {
boolean canOutput = dataMergeSvr.onNewRecord(
((RouteResultsetNode) conn.getAttachment()).getName(),
row);
} else {
if (primaryKeyIndex != -1) {// cache
// primaryKey->
// dataNode
RowDataPacket rowDataPkg = new RowDataPacket(fieldCount);
rowDataPkg.read(row);
String primaryKey = new String(
rowDataPkg.fieldValues.get(primaryKeyIndex));
LayerCachePool pool = MycatServer.getInstance()
.getRouterservice().getTableId2DataNodeCache();
String dataNode = ((RouteResultsetNode) conn
.getAttachment()).getName();
pool.putIfAbsent(priamaryKeyTable, primaryKey, dataNode);
}
row[3] = ++packetId;
buffer = session.getSource().writeToBuffer(row, buffer);
}
} catch (Exception e) {
handleDataProcessException(e, conn);
} finally {
lock.unlock();
}
}
示例6: onNewRecord
import org.opencloudb.net.mysql.RowDataPacket; //导入方法依赖的package包/类
/**
* process new record (mysql binary data),if data can output to client
* ,return true
*
* @param dataNode
* DN's name (data from this dataNode)
* @param rowData
* raw data
*/
public boolean onNewRecord(String dataNode, byte[] rowData) {
RowDataPacket rowDataPkg = new RowDataPacket(fieldCount);
rowDataPkg.read(rowData);
if (grouper != null) {
grouper.addRow(rowDataPkg);
} else {
result.add(rowDataPkg);
}
// todo ,if too large result set ,should store to disk
return false;
}
示例7: onNewRecord
import org.opencloudb.net.mysql.RowDataPacket; //导入方法依赖的package包/类
/**
* process new record (mysql binary data),if data can output to client
* ,return true
*
* @param dataNode
* DN's name (data from this dataNode)
* @param rowData
* raw data
*/
public boolean onNewRecord(String dataNode, byte[] rowData) {
NodeRowDataPacket nodePacket = this.result.get(dataNode);
RowDataPacket rowDataPkg = new RowDataPacket(fieldCount);
rowDataPkg.read(rowData);
if (grouper != null) {
grouper.addRow(rowDataPkg);
} else {
nodePacket.addPacket(rowDataPkg);
this.dataController.newRecord(dataNode);
}
return false;
}