Esempio n. 1
0
 public function executeBatchKeyspaceIds(VTContext $ctx, array $bound_keyspace_id_queries, $tablet_type = \topodata\TabletType::MASTER, $as_transaction = TRUE)
 {
     if (!$this->inTransaction()) {
         throw new VTException('execute called while not in transaction.');
     }
     $request = new \vtgate\ExecuteBatchKeyspaceIdsRequest();
     $request->setSession($this->session);
     VTProto::addQueries($request, $bound_keyspace_id_queries);
     $request->setTabletType($tablet_type);
     $request->setAsTransaction($as_transaction);
     if ($ctx->getCallerId()) {
         $request->setCallerId($ctx->getCallerId());
     }
     $response = $this->client->executeBatchKeyspaceIds($ctx, $request);
     $this->session = $response->getSession();
     VTProto::checkError($response);
     $results = array();
     foreach ($response->getResultsList() as $result) {
         $results[] = new VTCursor($result);
     }
     return $results;
 }
Esempio n. 2
0
 public function executeBatchKeyspaceIds(VTContext $ctx, array $bound_keyspace_id_queries, $tablet_type, $as_transaction)
 {
     $request = new \vtgate\ExecuteBatchKeyspaceIdsRequest();
     VTProto::addQueries($request, $bound_keyspace_id_queries);
     $request->setTabletType($tablet_type);
     $request->setAsTransaction($as_transaction);
     if ($ctx->getCallerId()) {
         $request->setCallerId($ctx->getCallerId());
     }
     $response = $this->client->executeBatchKeyspaceIds($ctx, $request);
     VTProto::checkError($response);
     $results = array();
     foreach ($response->getResultsList() as $result) {
         $results[] = new VTCursor($result);
     }
     return $results;
 }