本文整理汇总了Java中com.taobao.tddl.executor.utils.ExecUtils.getOrderBy方法的典型用法代码示例。如果您正苦于以下问题:Java ExecUtils.getOrderBy方法的具体用法?Java ExecUtils.getOrderBy怎么用?Java ExecUtils.getOrderBy使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.taobao.tddl.executor.utils.ExecUtils
的用法示例。
在下文中一共展示了ExecUtils.getOrderBy方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: buildOrderBy
import com.taobao.tddl.executor.utils.ExecUtils; //导入方法依赖的package包/类
public static List<IOrderBy> buildOrderBy(IDataNodeExecutor executor, IndexMeta indexMeta, String tableName) {
IQuery query = ((IQuery) executor);
List<IOrderBy> orderBy = null;
orderBy = query.getOrderBys();
if (orderBy == null || orderBy.isEmpty()) {
List<IOrderBy> groupBys = query.getGroupBys();
orderBy = groupBys;
}
if (orderBy == null || orderBy.isEmpty()) {
orderBy = ExecUtils.getOrderBy(indexMeta);
}
List<IOrderBy> orderbys = ExecUtils.copyOrderBys(orderBy);
return orderbys;
}
示例2: getCursor
import com.taobao.tddl.executor.utils.ExecUtils; //导入方法依赖的package包/类
public ISchematicCursor getCursor(ITransaction txn, IndexMeta indexMeta, String isolation, String actualTableName)
throws TddlException {
Database db = getDatabase(actualTableName);
if (db == null) {
throw new IllegalArgumentException("table don't contains indexName:" + actualTableName);
}
CursorConfig cc = CursorConfig.DEFAULT;
LockMode lm = LockMode.DEFAULT;
if (txn != null) {
com.sleepycat.je.TransactionConfig _config = ((JE_Transaction) txn).config;
if (_config.getReadUncommitted()) {
cc = CursorConfig.READ_UNCOMMITTED;
lm = LockMode.READ_UNCOMMITTED;
} else if (_config.getReadCommitted()) {
cc = CursorConfig.READ_COMMITTED;
// lm = LockMode.READ_COMMITTED;
}
} else {
if (Isolation.READ_COMMITTED.equals(isolation)) {
cc = CursorConfig.READ_COMMITTED;
// lm = LockMode.READ_COMMITTED;//not support
} else if (Isolation.READ_UNCOMMITTED.equals(isolation)) {
cc = CursorConfig.READ_UNCOMMITTED;
lm = LockMode.READ_UNCOMMITTED;
} else if (Isolation.REPEATABLE_READ.equals(isolation)) {
// default
} else if (Isolation.SERIALIZABLE.equals(isolation)) {
// txn_config
}
}
JE_Cursor je_cursor = new JE_Cursor(indexMeta, db.openCursor(txn == null ? null : ((JE_Transaction) txn).txn,
cc), lm);
if (txn != null) {
((JE_Transaction) txn).addCursor(je_cursor);
}
return new SchematicCursor(je_cursor, je_cursor.getiCursorMeta(), ExecUtils.getOrderBy(indexMeta));
}
示例3: getCursor
import com.taobao.tddl.executor.utils.ExecUtils; //导入方法依赖的package包/类
public ISchematicCursor getCursor(ITransaction txn, IndexMeta indexMeta, String isolation, String actualTableName)
throws TddlException {
Database db = getDatabase(actualTableName);
if (db == null) {
throw new TddlException("table don't contains indexName:" + actualTableName);
}
CursorConfig cc = CursorConfig.DEFAULT;
LockMode lm = LockMode.DEFAULT;
if (txn != null) {
com.sleepycat.je.TransactionConfig _config = ((JE_Transaction) txn).config;
if (_config.getReadUncommitted()) {
cc = CursorConfig.READ_UNCOMMITTED;
lm = LockMode.READ_UNCOMMITTED;
} else if (_config.getReadCommitted()) {
cc = CursorConfig.READ_COMMITTED;
// lm = LockMode.READ_COMMITTED;
}
} else {
if (Isolation.READ_COMMITTED.equals(isolation)) {
cc = CursorConfig.READ_COMMITTED;
// lm = LockMode.READ_COMMITTED;//not support
} else if (Isolation.READ_UNCOMMITTED.equals(isolation)) {
cc = CursorConfig.READ_UNCOMMITTED;
lm = LockMode.READ_UNCOMMITTED;
} else if (Isolation.REPEATABLE_READ.equals(isolation)) {
// default
} else if (Isolation.SERIALIZABLE.equals(isolation)) {
// txn_config
}
}
JE_Cursor je_cursor = new JE_Cursor(indexMeta,
db.openCursor(txn == null ? null : ((JE_Transaction) txn).txn, cc), lm);
if (txn != null) {
((JE_Transaction) txn).addCursor(je_cursor);
}
return new SchematicCursor(je_cursor, je_cursor.getiCursorMeta(), ExecUtils.getOrderBy(indexMeta));
}
示例4: getCursor
import com.taobao.tddl.executor.utils.ExecUtils; //导入方法依赖的package包/类
@Override
public ISchematicCursor getCursor(ExecutionContext executionContext, IndexMeta indexMeta, String indexMetaName) {
DemoCursor dc = new DemoCursor(indexMeta, map);
return new SchematicCursor(dc, dc.getiCursorMeta(), ExecUtils.getOrderBy(indexMeta));
}
示例5: getCursor
import com.taobao.tddl.executor.utils.ExecUtils; //导入方法依赖的package包/类
@Override
public ISchematicCursor getCursor(ExecutionContext executionContext, IndexMeta meta, IQuery iQuery)
throws TddlException {
HbCursor hc = new HbCursor(meta, this.hbOperate, this.physicalSchema, this.schema, iQuery);
return new SchematicCursor(hc, hc.getCursorMeta(), ExecUtils.getOrderBy(meta));
}