當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。