@Override public KeyFactory newKeyFactory() { return DatastoreHelper.newKeyFactory(getOptions()); }
com.google.datastore.v1.CommitResponse commit( final com.google.datastore.v1.CommitRequest requestPb) { try { return RetryHelper.runWithRetries( new Callable<com.google.datastore.v1.CommitResponse>() { @Override public com.google.datastore.v1.CommitResponse call() throws DatastoreException { return datastoreRpc.commit(requestPb); } }, retrySettings, EXCEPTION_HANDLER, getOptions().getClock()); } catch (RetryHelperException e) { throw DatastoreException.translateAndThrow(e); } }
private com.google.datastore.v1.AllocateIdsResponse allocateIds( final com.google.datastore.v1.AllocateIdsRequest requestPb) { try { return RetryHelper.runWithRetries( new Callable<com.google.datastore.v1.AllocateIdsResponse>() { @Override public com.google.datastore.v1.AllocateIdsResponse call() throws DatastoreException { return datastoreRpc.allocateIds(requestPb); } }, retrySettings, EXCEPTION_HANDLER, getOptions().getClock()); } catch (RetryHelperException e) { throw DatastoreException.translateAndThrow(e); } }
com.google.datastore.v1.RunQueryResponse runQuery( final com.google.datastore.v1.RunQueryRequest requestPb) { try { return RetryHelper.runWithRetries( new Callable<com.google.datastore.v1.RunQueryResponse>() { @Override public com.google.datastore.v1.RunQueryResponse call() throws DatastoreException { return datastoreRpc.runQuery(requestPb); } }, retrySettings, EXCEPTION_HANDLER, getOptions().getClock()); } catch (RetryHelperException e) { throw DatastoreException.translateAndThrow(e); } }
com.google.datastore.v1.LookupResponse lookup( final com.google.datastore.v1.LookupRequest requestPb) { try { return RetryHelper.runWithRetries( new Callable<com.google.datastore.v1.LookupResponse>() { @Override public com.google.datastore.v1.LookupResponse call() throws DatastoreException { return datastoreRpc.lookup(requestPb); } }, retrySettings, EXCEPTION_HANDLER, getOptions().getClock()); } catch (RetryHelperException e) { throw DatastoreException.translateAndThrow(e); } }
com.google.datastore.v1.BeginTransactionResponse beginTransaction( final com.google.datastore.v1.BeginTransactionRequest requestPb) { try { return RetryHelper.runWithRetries( new Callable<com.google.datastore.v1.BeginTransactionResponse>() { @Override public com.google.datastore.v1.BeginTransactionResponse call() throws DatastoreException { return datastoreRpc.beginTransaction(requestPb); } }, retrySettings, EXCEPTION_HANDLER, getOptions().getClock()); } catch (RetryHelperException e) { throw DatastoreException.translateAndThrow(e); } }
void rollback(final com.google.datastore.v1.RollbackRequest requestPb) { try { RetryHelper.runWithRetries( new Callable<Void>() { @Override public Void call() throws DatastoreException { datastoreRpc.rollback(requestPb); return null; } }, retrySettings, EXCEPTION_HANDLER, getOptions().getClock()); } catch (RetryHelperException e) { throw DatastoreException.translateAndThrow(e); } } }
@Override public <T> T runInTransaction( final TransactionCallable<T> callable, TransactionOptions transactionOptions) { final DatastoreImpl self = this; try { return RetryHelper.runWithRetries( new ReadWriteTransactionCallable<T>(self, callable, transactionOptions), retrySettings, TRANSACTION_EXCEPTION_HANDLER, getOptions().getClock()); } catch (RetryHelperException e) { throw DatastoreException.translateAndThrow(e); } }
@Override public <T> T runInTransaction(final TransactionCallable<T> callable) { final DatastoreImpl self = this; try { return RetryHelper.runWithRetries( new ReadWriteTransactionCallable<T>(self, callable, null), retrySettings, TRANSACTION_EXCEPTION_HANDLER, getOptions().getClock()); } catch (RetryHelperException e) { throw DatastoreException.translateAndThrow(e); } }
QueryResultsImpl( DatastoreImpl datastore, com.google.datastore.v1.ReadOptions readOptionsPb, Query<T> query) { this.datastore = datastore; this.readOptionsPb = readOptionsPb; this.query = query; queryResultType = query.getType(); com.google.datastore.v1.PartitionId.Builder pbBuilder = com.google.datastore.v1.PartitionId.newBuilder(); pbBuilder.setProjectId(datastore.getOptions().getProjectId()); if (query.getNamespace() != null) { pbBuilder.setNamespaceId(query.getNamespace()); } else if (datastore.getOptions().getNamespace() != null) { pbBuilder.setNamespaceId(datastore.getOptions().getNamespace()); } partitionIdPb = pbBuilder.build(); sendRequest(); if (runQueryResponsePb.getBatch().getSkippedResults() > 0) { cursor = runQueryResponsePb.getBatch().getSkippedCursor(); } else { cursor = mostRecentQueryPb.getStartCursor(); } }
@Override public KeyFactory newKeyFactory() { return DatastoreHelper.newKeyFactory(getOptions()); }
com.google.datastore.v1.RunQueryResponse runQuery( final com.google.datastore.v1.RunQueryRequest requestPb) { try { return RetryHelper.runWithRetries( new Callable<com.google.datastore.v1.RunQueryResponse>() { @Override public com.google.datastore.v1.RunQueryResponse call() throws DatastoreException { return datastoreRpc.runQuery(requestPb); } }, retrySettings, EXCEPTION_HANDLER, getOptions().getClock()); } catch (RetryHelperException e) { throw DatastoreException.translateAndThrow(e); } }
com.google.datastore.v1.BeginTransactionResponse beginTransaction( final com.google.datastore.v1.BeginTransactionRequest requestPb) { try { return RetryHelper.runWithRetries( new Callable<com.google.datastore.v1.BeginTransactionResponse>() { @Override public com.google.datastore.v1.BeginTransactionResponse call() throws DatastoreException { return datastoreRpc.beginTransaction(requestPb); } }, retrySettings, EXCEPTION_HANDLER, getOptions().getClock()); } catch (RetryHelperException e) { throw DatastoreException.translateAndThrow(e); } }
void rollback(final com.google.datastore.v1.RollbackRequest requestPb) { try { RetryHelper.runWithRetries( new Callable<Void>() { @Override public Void call() throws DatastoreException { datastoreRpc.rollback(requestPb); return null; } }, retrySettings, EXCEPTION_HANDLER, getOptions().getClock()); } catch (RetryHelperException e) { throw DatastoreException.translateAndThrow(e); } } }
private com.google.datastore.v1.AllocateIdsResponse allocateIds( final com.google.datastore.v1.AllocateIdsRequest requestPb) { try { return RetryHelper.runWithRetries( new Callable<com.google.datastore.v1.AllocateIdsResponse>() { @Override public com.google.datastore.v1.AllocateIdsResponse call() throws DatastoreException { return datastoreRpc.allocateIds(requestPb); } }, retrySettings, EXCEPTION_HANDLER, getOptions().getClock()); } catch (RetryHelperException e) { throw DatastoreException.translateAndThrow(e); } }
com.google.datastore.v1.LookupResponse lookup( final com.google.datastore.v1.LookupRequest requestPb) { try { return RetryHelper.runWithRetries( new Callable<com.google.datastore.v1.LookupResponse>() { @Override public com.google.datastore.v1.LookupResponse call() throws DatastoreException { return datastoreRpc.lookup(requestPb); } }, retrySettings, EXCEPTION_HANDLER, getOptions().getClock()); } catch (RetryHelperException e) { throw DatastoreException.translateAndThrow(e); } }
com.google.datastore.v1.CommitResponse commit( final com.google.datastore.v1.CommitRequest requestPb) { try { return RetryHelper.runWithRetries( new Callable<com.google.datastore.v1.CommitResponse>() { @Override public com.google.datastore.v1.CommitResponse call() throws DatastoreException { return datastoreRpc.commit(requestPb); } }, retrySettings, EXCEPTION_HANDLER, getOptions().getClock()); } catch (RetryHelperException e) { throw DatastoreException.translateAndThrow(e); } }
@Override public <T> T runInTransaction( final TransactionCallable<T> callable, TransactionOptions transactionOptions) { final DatastoreImpl self = this; try { return RetryHelper.runWithRetries( new ReadWriteTransactionCallable<T>(self, callable, transactionOptions), retrySettings, TRANSACTION_EXCEPTION_HANDLER, getOptions().getClock()); } catch (RetryHelperException e) { throw DatastoreException.translateAndThrow(e); } }
@Override public <T> T runInTransaction(final TransactionCallable<T> callable) { final DatastoreImpl self = this; try { return RetryHelper.runWithRetries( new ReadWriteTransactionCallable<T>(self, callable, null), retrySettings, TRANSACTION_EXCEPTION_HANDLER, getOptions().getClock()); } catch (RetryHelperException e) { throw DatastoreException.translateAndThrow(e); } }
QueryResultsImpl( DatastoreImpl datastore, com.google.datastore.v1.ReadOptions readOptionsPb, Query<T> query) { this.datastore = datastore; this.readOptionsPb = readOptionsPb; this.query = query; queryResultType = query.getType(); com.google.datastore.v1.PartitionId.Builder pbBuilder = com.google.datastore.v1.PartitionId.newBuilder(); pbBuilder.setProjectId(datastore.getOptions().getProjectId()); if (query.getNamespace() != null) { pbBuilder.setNamespaceId(query.getNamespace()); } else if (datastore.getOptions().getNamespace() != null) { pbBuilder.setNamespaceId(datastore.getOptions().getNamespace()); } partitionIdPb = pbBuilder.build(); sendRequest(); if (runQueryResponsePb.getBatch().getSkippedResults() > 0) { cursor = runQueryResponsePb.getBatch().getSkippedCursor(); } else { cursor = mostRecentQueryPb.getStartCursor(); } }