當前位置: 首頁>>代碼示例>>Java>>正文


Java ICursorMeta類代碼示例

本文整理匯總了Java中com.taobao.tddl.executor.cursor.ICursorMeta的典型用法代碼示例。如果您正苦於以下問題:Java ICursorMeta類的具體用法?Java ICursorMeta怎麽用?Java ICursorMeta使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


ICursorMeta類屬於com.taobao.tddl.executor.cursor包,在下文中一共展示了ICursorMeta類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: buildSchemaFromReturnColumns

import com.taobao.tddl.executor.cursor.ICursorMeta; //導入依賴的package包/類
protected void buildSchemaFromReturnColumns(List<ColumnMeta> leftColumns, List<ColumnMeta> rightColumns)
                                                                                                        throws TddlException {
    if (schemaInited) {
        return;
    }

    schemaInited = true;
    // 以左麵數據順序,作為排序
    setOrderBy(left_cursor);

    List<ColumnMeta> newJoinColumnMsg = new ArrayList<ColumnMeta>(leftColumns.size() + rightColumns.size());

    newJoinColumnMsg.addAll(leftColumns);
    newJoinColumnMsg.addAll(rightColumns);

    ICursorMeta cursorMetaImpJoin = CursorMetaImp.buildNew(newJoinColumnMsg);

    rightCursorOffset = leftColumns.size();
    this.joinCursorMeta = cursorMetaImpJoin;
}
 
開發者ID:loye168,項目名稱:tddl5,代碼行數:21,代碼來源:JoinSchematicCursor.java

示例2: buildSchemaFromReturnColumns

import com.taobao.tddl.executor.cursor.ICursorMeta; //導入依賴的package包/類
protected void buildSchemaFromReturnColumns(List<ColumnMeta> leftColumns, List<ColumnMeta> rightColumns) {
    if (schemaInited) {
        return;
    }

    schemaInited = true;
    // 以左麵數據順序,作為排序
    setOrderBy(left_cursor);

    List<ColumnMeta> newJoinColumnMsg = new ArrayList<ColumnMeta>(leftColumns.size() + rightColumns.size());

    newJoinColumnMsg.addAll(leftColumns);
    newJoinColumnMsg.addAll(rightColumns);

    ICursorMeta cursorMetaImpJoin = CursorMetaImp.buildNew(newJoinColumnMsg);

    rightCursorOffset = leftColumns.size();
    this.joinCursorMeta = cursorMetaImpJoin;
}
 
開發者ID:beebeandwer,項目名稱:TDDL,代碼行數:20,代碼來源:JoinSchematicCursor.java

示例3: getComp

import com.taobao.tddl.executor.cursor.ICursorMeta; //導入依賴的package包/類
public static Comparator<IRowSet> getComp(final List<ISelectable> left_columns,
                                          final List<ISelectable> right_columns, final ICursorMeta leftMeta,
                                          final ICursorMeta rightMeta) {
    return new Comparator<IRowSet>() {

        public IRowsValueScaner leftScaner  = new RowsValueScanerImp(leftMeta, left_columns);
        public IRowsValueScaner rightScaner = new RowsValueScanerImp(rightMeta, right_columns);

        /*
         * 沈洵
         * 這個代碼與com.taobao.ustore.spi.cursor.common.SortCursor.getComp(List
         * <IOrderBy> orderBys)
         * 唯一的不同,也隻有compare的時候需要兩個列的list,並且沒有asc和desc條件。其他邏輯類似。
         */
        @Override
        public int compare(IRowSet o1, IRowSet o2) {
            Iterator<Object> leftIter = leftScaner.rowValueIterator(o1);
            Iterator<Object> rightIter = rightScaner.rowValueIterator(o2);
            for (int i = 0; i < left_columns.size(); i++) {
                Object c1 = leftIter.next();
                Object c2 = rightIter.next();
                int n = comp(c1, c2, left_columns.get(i).getDataType(), right_columns.get(i).getDataType());
                if (n != 0) {
                    return n;
                }
            }
            return 0;
        }
    };
}
 
開發者ID:loye168,項目名稱:tddl5,代碼行數:31,代碼來源:ExecUtils.java

示例4: convertToICursorMeta

import com.taobao.tddl.executor.cursor.ICursorMeta; //導入依賴的package包/類
public static ICursorMeta convertToICursorMeta(IQueryTree query) {
    if (query.getSql() != null) {
        return null;
    }
    ICursorMeta iCursorMeta = null;
    List<ColumnMeta> columns = convertISelectablesToColumnMeta(query.getColumns(),
        query.getAlias(),
        query.isSubQuery());
    iCursorMeta = CursorMetaImp.buildNew(columns, columns.size());
    return iCursorMeta;
}
 
開發者ID:loye168,項目名稱:tddl5,代碼行數:12,代碼來源:ExecUtils.java

示例5: getObject

import com.taobao.tddl.executor.cursor.ICursorMeta; //導入依賴的package包/類
public static Object getObject(final ICursorMeta meta, IRowSet rowSet, String tableName, String columnName,
                               String columnAlias) {
    Integer index = meta.getIndex(tableName, columnName, columnAlias);
    if (index == null) {
        throw new RuntimeException("not found :" + tableName + "." + columnName + " in ICursorMeta:" + meta);
    }
    return rowSet.getObject(index);
}
 
開發者ID:loye168,項目名稱:tddl5,代碼行數:9,代碼來源:ExecUtils.java

示例6: schematicCursor

import com.taobao.tddl.executor.cursor.ICursorMeta; //導入依賴的package包/類
@Override
public ISchematicCursor schematicCursor(ExecutionContext executionContext, Cursor cursor, ICursorMeta meta,
                                        List<IOrderBy> orderBys) throws TddlException {
    try {
        return new SchematicCursor(cursor, meta, orderBys);
    } catch (Exception e) {
        closeParentCursor(cursor);
        throw new TddlException(e);
    }
}
 
開發者ID:loye168,項目名稱:tddl5,代碼行數:11,代碼來源:CursorFactoryDefaultImpl.java

示例7: mergeCursor

import com.taobao.tddl.executor.cursor.ICursorMeta; //導入依賴的package包/類
@Override
public IMergeCursor mergeCursor(ExecutionContext executionContext, List<ISchematicCursor> cursors,
                                ICursorMeta indexMeta, IMerge currentExecotor, List<IOrderBy> orderBys)
                                                                                                       throws TddlException {
    try {
        return new MergeCursor(cursors, indexMeta, currentExecotor, executionContext, orderBys);
    } catch (Exception e) {
        if (cursors != null) {
            for (ISchematicCursor iSchematicCursor : cursors) {
                closeParentCursor(iSchematicCursor);
            }
        }
        throw new TddlException(e);
    }
}
 
開發者ID:loye168,項目名稱:tddl5,代碼行數:16,代碼來源:CursorFactoryDefaultImpl.java

示例8: initComparator

import com.taobao.tddl.executor.cursor.ICursorMeta; //導入依賴的package包/類
protected void initComparator(List<IOrderBy> orderBys, ICursorMeta cursorMeta) {
    if (schemaInited) {
        return;
    }
    schemaInited = true;
    if (orderBys != null) {
        this.kvPairComparator = ExecUtils.getComp(orderBys, cursorMeta);
    }
}
 
開發者ID:loye168,項目名稱:tddl5,代碼行數:10,代碼來源:SortCursor.java

示例9: wrap

import com.taobao.tddl.executor.cursor.ICursorMeta; //導入依賴的package包/類
public static IRowSet wrap(ICursorMeta newCursorMeta, IRowSet target,
                           Map<Integer/* 返回列中的index位置 */, Integer/* 實際數據中的index位置 */> mapping) {
    if (target == null) {
        return null;
    }
    return new ValueMappingRowSet(newCursorMeta, target, mapping);
}
 
開發者ID:loye168,項目名稱:tddl5,代碼行數:8,代碼來源:ValueMappingCursor.java

示例10: initSchema

import com.taobao.tddl.executor.cursor.ICursorMeta; //導入依賴的package包/類
protected ICursorMeta initSchema() {
    if (schemaInited) {
        return cursormeta;
    }
    schemaInited = true;
    ColumnMessage colMeta = new ColumnMessage(ResultCursor.AFFECT_ROW, DataType.IntegerType);
    CursorMetaImp cursurMetaImp = CursorMetaImp.buildNew("", Arrays.asList(colMeta), 1);
    this.cursormeta = cursurMetaImp;
    return cursurMetaImp;
}
 
開發者ID:loye168,項目名稱:tddl5,代碼行數:11,代碼來源:AffectRowCursor.java

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

}
 
開發者ID:loye168,項目名稱:tddl5,代碼行數:31,代碼來源:JoinSchematicCursor.java

示例12: addIndexToNewIndexes

import com.taobao.tddl.executor.cursor.ICursorMeta; //導入依賴的package包/類
private void addIndexToNewIndexes(ICursorMeta cursorMeta, List<ColumnMeta> columns, List<Integer> indexes,
                                  int offset) {
    for (ColumnMeta cm : columns) {
        Integer index = cursorMeta.getIndex(cm.getTableName(), cm.getName(), cm.getAlias());

        indexes.add(offset + index);
    }
}
 
開發者ID:loye168,項目名稱:tddl5,代碼行數:9,代碼來源:JoinSchematicCursor.java

示例13: joinRecord

import com.taobao.tddl.executor.cursor.ICursorMeta; //導入依賴的package包/類
public IRowSet joinRecord(IRowSet kv1, IRowSet kv2) throws TddlException {
    ICursorMeta leftCursorMeta = null;
    ICursorMeta rightCursorMeta = null;
    if (kv1 != null) {
        leftCursorMeta = kv1.getParentCursorMeta();
    }
    if (kv2 != null) {
        rightCursorMeta = kv2.getParentCursorMeta();
    }
    buildSchemaInJoin(leftCursorMeta, rightCursorMeta);

    IRowSet joinedRowSet = new JoinRowSet(rightCursorOffset, kv1, kv2, joinCursorMeta);
    return joinedRowSet;
}
 
開發者ID:loye168,項目名稱:tddl5,代碼行數:15,代碼來源:JoinSchematicCursor.java

示例14: MergeCursor

import com.taobao.tddl.executor.cursor.ICursorMeta; //導入依賴的package包/類
public MergeCursor(List<ISchematicCursor> cursors, ICursorMeta iCursorMeta, IMerge merge,
                   ExecutionContext executionContext, List<IOrderBy> orderBys){
    super(null, iCursorMeta, orderBys);
    this.cursors = cursors;

    this.merge = merge;
    this.executionContext = executionContext;
    setOrderBy(orderBys);
}
 
開發者ID:loye168,項目名稱:tddl5,代碼行數:10,代碼來源:MergeCursor.java

示例15: RowsValueScanerImp

import com.taobao.tddl.executor.cursor.ICursorMeta; //導入依賴的package包/類
public RowsValueScanerImp(ICursorMeta cursorMeta, List<ISelectable> left_columns){
    super();
    this.cursorMeta = cursorMeta;
    this.columnsYouWant = left_columns;
    indexList = new ArrayList<Integer>(left_columns.size());
    for (ISelectable icol : left_columns) {
        Integer index = this.cursorMeta.getIndex(icol.getTableName(), icol.getColumnName(), icol.getAlias());

        indexList.add(index);
    }

}
 
開發者ID:loye168,項目名稱:tddl5,代碼行數:13,代碼來源:RowsValueScanerImp.java


注:本文中的com.taobao.tddl.executor.cursor.ICursorMeta類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。