本文整理匯總了Java中com.taobao.tddl.executor.cursor.ICursorMeta.getColumns方法的典型用法代碼示例。如果您正苦於以下問題:Java ICursorMeta.getColumns方法的具體用法?Java ICursorMeta.getColumns怎麽用?Java ICursorMeta.getColumns使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類com.taobao.tddl.executor.cursor.ICursorMeta
的用法示例。
在下文中一共展示了ICursorMeta.getColumns方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: buildSchemaInJoin
import com.taobao.tddl.executor.cursor.ICursorMeta; //導入方法依賴的package包/類
protected void buildSchemaInJoin(ICursorMeta leftCursorMeta, ICursorMeta rightCursorMeta) throws TddlException {
if (schemaInited) {
return;
}
schemaInited = true;
// 以左麵數據順序,作為排序
setOrderBy(left_cursor);
List<ColumnMeta> leftColumns = leftCursorMeta.getColumns();
List<ColumnMeta> rightColumns = rightCursorMeta.getColumns();
this.kvPairComparator = ExecUtils.getComp(this.leftJoinOnColumns,
this.rightJoinOnColumns,
leftCursorMeta,
rightCursorMeta);
List<ColumnMeta> newJoinColumnMsg = new ArrayList<ColumnMeta>(leftColumns.size() + rightColumns.size());
rightCursorOffset = leftCursorMeta.getIndexRange();
newJoinColumnMsg.addAll(leftColumns);
newJoinColumnMsg.addAll(rightColumns);
List<Integer> indexes = new ArrayList<Integer>(newJoinColumnMsg.size());
addIndexToNewIndexes(leftCursorMeta, leftColumns, indexes, 0);
addIndexToNewIndexes(rightCursorMeta, rightColumns, indexes, rightCursorOffset);
ICursorMeta cursorMetaImpJoin = CursorMetaImp.buildNew(newJoinColumnMsg,
indexes,
(leftCursorMeta.getIndexRange() + rightCursorMeta.getIndexRange()));
// setMeta(cursorMetaImpJoin);
this.joinCursorMeta = cursorMetaImpJoin;
}
示例2: buildSchemaInJoin
import com.taobao.tddl.executor.cursor.ICursorMeta; //導入方法依賴的package包/類
protected void buildSchemaInJoin(ICursorMeta leftCursorMeta, ICursorMeta rightCursorMeta) {
if (schemaInited) {
return;
}
schemaInited = true;
// 以左麵數據順序,作為排序
setOrderBy(left_cursor);
List<ColumnMeta> leftColumns = leftCursorMeta.getColumns();
List<ColumnMeta> rightColumns = rightCursorMeta.getColumns();
this.kvPairComparator = ExecUtils.getComp(this.leftJoinOnColumns,
this.rightJoinOnColumns,
leftCursorMeta,
rightCursorMeta);
List<ColumnMeta> newJoinColumnMsg = new ArrayList<ColumnMeta>(leftColumns.size() + rightColumns.size());
rightCursorOffset = leftCursorMeta.getIndexRange();
newJoinColumnMsg.addAll(leftColumns);
newJoinColumnMsg.addAll(rightColumns);
List<Integer> indexes = new ArrayList<Integer>(newJoinColumnMsg.size());
addIndexToNewIndexes(leftCursorMeta, leftColumns, indexes, 0);
addIndexToNewIndexes(rightCursorMeta, rightColumns, indexes, rightCursorOffset);
ICursorMeta cursorMetaImpJoin = CursorMetaImp.buildNew(newJoinColumnMsg,
indexes,
(leftCursorMeta.getIndexRange() + rightCursorMeta.getIndexRange()));
// setMeta(cursorMetaImpJoin);
this.joinCursorMeta = cursorMetaImpJoin;
}
示例3: buildColumnMeta
import com.taobao.tddl.executor.cursor.ICursorMeta; //導入方法依賴的package包/類
private void buildColumnMeta(List<IOrderBy> orderBys, List<ColumnMeta> keyColumns, List<ColumnMeta> valueColumns,
IRowSet kv, List<ColumnMeta> metaValueColumns, List<ColumnMeta> metaKeyColumns) {
ICursorMeta cursorMeta = kv.getParentCursorMeta();
List<ColumnMeta> columnMeta = cursorMeta.getColumns();
Set<IOrderBy> hashOrderBys = new HashSet<IOrderBy>();
for (ColumnMeta cm : columnMeta) {
/**
* 為了防止有列名相同的列,新建一個列,列名由原表名和列名組成
*/
ColumnMeta columnInTempTable = new ColumnMeta(cm.getTableName(),
cm.getTableName() + _TDDL_TABLENAME + cm.getName(),
cm.getDataType(),
cm.getAlias(),
cm.isNullable());
IOrderBy orderBy = findOrderByInKey(orderBys, cm);
if (orderBy != null) {
keyColumns.add(columnInTempTable);
hashOrderBys.add(orderBy);
if (!metaKeyColumns.contains(cm)) {
metaKeyColumns.add(cm);
}
} else {
// 列名與order by not match ,放到value裏
if (!valueColumns.contains(columnInTempTable)) {
valueColumns.add(columnInTempTable);
}
if (!metaValueColumns.contains(cm)) {
metaValueColumns.add(cm);
}
}
}
if (keyColumns.size() < orderBys.size()) {
// order by 的列不存在與cursor中,不可能吧
throw new RuntimeException("should not be here");
}
// 是否針對重複的value進行排序
if (sortedDuplicates) {// identity
valueColumns.add(new ColumnMeta(keyColumns.get(0).getTableName(),
identity,
DataType.IntegerType,
null,
true));
}
}