本文整理汇总了Java中com.thinkaurelius.titan.diskstorage.BackendTransaction类的典型用法代码示例。如果您正苦于以下问题:Java BackendTransaction类的具体用法?Java BackendTransaction怎么用?Java BackendTransaction使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
BackendTransaction类属于com.thinkaurelius.titan.diskstorage包,在下文中一共展示了BackendTransaction类的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: execute
import com.thinkaurelius.titan.diskstorage.BackendTransaction; //导入依赖的package包/类
public List<EntryList> execute(final BackendTransaction tx) {
int total = 0;
List<EntryList> result = new ArrayList<EntryList>(4);
for (KeySliceQuery ksq : queries) {
EntryList next =tx.indexQuery(ksq.updateLimit(getLimit()-total));
result.add(next);
total+=next.size();
if (total>=getLimit()) break;
}
return result;
}
示例2: FulgoraExecutor
import com.thinkaurelius.titan.diskstorage.BackendTransaction; //导入依赖的package包/类
FulgoraExecutor(final Map<String,FulgoraRelationQuery> queryDefs, final StandardTitanTx tx, final IDManager idManager,
final int numProcessors, final String stateKey, final OLAPJob job,
final StateInitializer<S> initializer, final FulgoraResult<S> initialState) {
this.tx=tx;
this.edgeSerializer = tx.getEdgeSerializer();
this.stateKey = stateKey;
this.job = job;
this.initializer = initializer;
BackendTransaction btx = tx.getTxHandle();
this.idManager = idManager;
this.queryDefinitions = queryDefs;
this.numProcessors = numProcessors;
int count = 0;
for (FulgoraRelationQuery frq : queryDefs.values()) count+=frq.queries.size();
numQueries = count+1;
//Add one for grounding query, since the first (0th) query is the grounding/condition query
dataQueues = new ArrayList<BlockingQueue<QueryResult>>(numQueries);
pullThreads = new DataPuller[numQueries];
int pos = 0;
pullThreads[pos++]=addDataPuller(BaseKey.VertexExists.getName(),
new SliceQuery(BufferUtil.zeroBuffer(4),BufferUtil.oneBuffer(4)).setLimit(1),btx);
for (Map.Entry<String,FulgoraRelationQuery> queryDef : queryDefs.entrySet()) {
String queryName = queryDef.getKey();
List<SliceQuery> sqs = queryDef.getValue().queries;
for (SliceQuery sq : sqs) {
pullThreads[pos++]=addDataPuller(queryName,sq,btx);
}
}
partitionedVertexMsgs = new ConcurrentHashMap<Long, MessageAccumulator>();
vertexStates = initialState;
}
示例3: addDataPuller
import com.thinkaurelius.titan.diskstorage.BackendTransaction; //导入依赖的package包/类
private final DataPuller addDataPuller(String queryName, SliceQuery sq, BackendTransaction btx) {
BlockingQueue<QueryResult> queue = new LinkedBlockingQueue<QueryResult>(QUEUE_SIZE);
dataQueues.add(queue);
DataPuller dp = new DataPuller(idManager, queryName, queue, btx.edgeStoreKeys(sq));
dp.start();
return dp;
}
示例4: setBackendTransaction
import com.thinkaurelius.titan.diskstorage.BackendTransaction; //导入依赖的package包/类
public void setBackendTransaction(BackendTransaction txHandle) {
Preconditions.checkArgument(this.txHandle==null && txHandle!=null);
this.txHandle = txHandle;
}
示例5: getTxHandle
import com.thinkaurelius.titan.diskstorage.BackendTransaction; //导入依赖的package包/类
public BackendTransaction getTxHandle() {
return txHandle;
}