本文整理匯總了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;
}