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


Java RowDataPacket.read方法代码示例

本文整理汇总了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);
	}

}
 
开发者ID:youngor,项目名称:openclouddb,代码行数:17,代码来源:FetchStoreNodeOfChildTableHandler.java

示例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);
	}

}
 
开发者ID:youngor,项目名称:openclouddb,代码行数:17,代码来源:FetchStoreNodeOfChildTableHandler.java

示例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);
	}

}
 
开发者ID:youngor,项目名称:openclouddb,代码行数:15,代码来源:IncrSequenceMySQLHandler.java

示例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();
	}
}
 
开发者ID:youngor,项目名称:openclouddb,代码行数:36,代码来源:MultiNodeQueryHandler.java

示例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();
	}
}
 
开发者ID:youngor,项目名称:openclouddb,代码行数:36,代码来源:MultiNodeQueryWithLimitHandler.java

示例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;

}
 
开发者ID:youngor,项目名称:openclouddb,代码行数:22,代码来源:DataMergeService.java

示例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;

}
 
开发者ID:youngor,项目名称:openclouddb,代码行数:23,代码来源:MutiDataMergeService.java


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