-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add GapicSpannerRpc stub #3016
Merged
pongad
merged 3 commits into
googleapis:spanner-gapic-migration
from
yihanzhen:spanner-migrate-to-gapic
Mar 12, 2018
Merged
Add GapicSpannerRpc stub #3016
Changes from 2 commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
162 changes: 162 additions & 0 deletions
162
google-cloud-spanner/src/main/java/com/google/cloud/spanner/spi/v1/GapicSpannerRpc.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,162 @@ | ||
/* | ||
* Copyright 2018 Google LLC | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
package com.google.cloud.spanner.spi.v1; | ||
|
||
import com.google.cloud.spanner.SpannerException; | ||
import com.google.cloud.spanner.spi.v1.SpannerRpc.Option; | ||
import com.google.longrunning.Operation; | ||
import com.google.protobuf.FieldMask; | ||
import com.google.spanner.admin.database.v1.Database; | ||
import com.google.spanner.admin.instance.v1.Instance; | ||
import com.google.spanner.admin.instance.v1.InstanceConfig; | ||
import com.google.spanner.v1.BeginTransactionRequest; | ||
import com.google.spanner.v1.CommitRequest; | ||
import com.google.spanner.v1.CommitResponse; | ||
import com.google.spanner.v1.ExecuteSqlRequest; | ||
import com.google.spanner.v1.PartitionQueryRequest; | ||
import com.google.spanner.v1.PartitionReadRequest; | ||
import com.google.spanner.v1.PartitionResponse; | ||
import com.google.spanner.v1.ReadRequest; | ||
import com.google.spanner.v1.RollbackRequest; | ||
import com.google.spanner.v1.Session; | ||
import com.google.spanner.v1.Transaction; | ||
import java.util.List; | ||
import java.util.Map; | ||
import javax.annotation.Nullable; | ||
|
||
|
||
/** Implementation of Cloud Spanner remote calls using Gapic libraries. */ | ||
public class GapicSpannerRpc implements SpannerRpc { | ||
|
||
// private final DatabaseAdminClient adminDatabaseClient; | ||
// private final InstanceAdminClient adminInstanceClient; | ||
|
||
public Paginated<InstanceConfig> listInstanceConfigs(int pageSize, @Nullable String pageToken) | ||
throws SpannerException { | ||
throw new UnsupportedOperationException("Not implemented yet."); | ||
} | ||
|
||
public InstanceConfig getInstanceConfig(String instanceConfigName) throws SpannerException { | ||
throw new UnsupportedOperationException("Not implemented yet."); | ||
// return adminInstanceClient.getInstanceConfig(instanceConfigName); | ||
} | ||
|
||
public Paginated<Instance> listInstances( | ||
int pageSize, @Nullable String pageToken, @Nullable String filter) throws SpannerException { | ||
throw new UnsupportedOperationException("Not implemented yet."); | ||
// return adminInstanceClient.listInstances(); | ||
} | ||
|
||
public Operation createInstance(String parent, String instanceId, Instance instance) | ||
throws SpannerException { | ||
throw new UnsupportedOperationException("Not implemented yet."); | ||
} | ||
|
||
public Operation updateInstance(Instance instance, FieldMask fieldMask) throws SpannerException { | ||
throw new UnsupportedOperationException("Not implemented yet."); | ||
} | ||
|
||
public Instance getInstance(String instanceName) throws SpannerException { | ||
throw new UnsupportedOperationException("Not implemented yet."); | ||
// return adminInstanceClient.getInstance(instanceName); | ||
} | ||
|
||
public void deleteInstance(String instanceName) throws SpannerException { | ||
throw new UnsupportedOperationException("Not implemented yet."); | ||
// adminInstanceClient.deleteInstance(instanceName); | ||
} | ||
|
||
// Database admin APIs. | ||
public Paginated<Database> listDatabases( | ||
String instanceName, int pageSize, @Nullable String pageToken) throws SpannerException { | ||
throw new UnsupportedOperationException("Not implemented yet."); | ||
} | ||
|
||
public Operation createDatabase(String instanceName, String createDatabaseStatement, | ||
Iterable<String> additionalStatements) throws SpannerException { | ||
throw new UnsupportedOperationException("Not implemented yet."); | ||
} | ||
|
||
public Operation updateDatabaseDdl(String databaseName, Iterable<String> updateDatabaseStatements, | ||
@Nullable String updateId) throws SpannerException { | ||
throw new UnsupportedOperationException("Not implemented yet."); | ||
} | ||
|
||
public void dropDatabase(String databaseName) throws SpannerException { | ||
throw new UnsupportedOperationException("Not implemented yet."); | ||
// adminDatabaseClient.dropDatabase(databaseName); | ||
} | ||
|
||
public Database getDatabase(String databaseName) throws SpannerException { | ||
throw new UnsupportedOperationException("Not implemented yet."); | ||
// adminDatabaseClient.getDatabase(databaseName); | ||
} | ||
|
||
public List<String> getDatabaseDdl(String databaseName) throws SpannerException { | ||
throw new UnsupportedOperationException("Not implemented yet."); | ||
} | ||
|
||
/** Retrieves a long running operation. */ | ||
public Operation getOperation(String name) throws SpannerException { | ||
throw new UnsupportedOperationException("Not implemented yet."); | ||
} | ||
|
||
public Session createSession(String databaseName, @Nullable Map<String, String> labels, | ||
@Nullable Map<Option, ?> options) throws SpannerException { | ||
throw new UnsupportedOperationException("Not implemented yet."); | ||
} | ||
|
||
public void deleteSession(String sessionName, @Nullable Map<Option, ?> options) | ||
throws SpannerException { | ||
throw new UnsupportedOperationException("Not implemented yet."); | ||
} | ||
|
||
public StreamingCall read( | ||
ReadRequest request, ResultStreamConsumer consumer, @Nullable Map<Option, ?> options) { | ||
throw new UnsupportedOperationException("Not implemented yet."); | ||
} | ||
|
||
public StreamingCall executeQuery( | ||
ExecuteSqlRequest request, ResultStreamConsumer consumer, @Nullable Map<Option, ?> options) { | ||
throw new UnsupportedOperationException("Not implemented yet."); | ||
} | ||
|
||
public Transaction beginTransaction( | ||
BeginTransactionRequest request, @Nullable Map<Option, ?> options) throws SpannerException { | ||
throw new UnsupportedOperationException("Not implemented yet."); | ||
} | ||
|
||
public CommitResponse commit(CommitRequest commitRequest, @Nullable Map<Option, ?> options) | ||
throws SpannerException { | ||
throw new UnsupportedOperationException("Not implemented yet."); | ||
} | ||
|
||
public void rollback(RollbackRequest request, @Nullable Map<Option, ?> options) | ||
throws SpannerException { | ||
throw new UnsupportedOperationException("Not implemented yet."); | ||
} | ||
|
||
public PartitionResponse partitionQuery( | ||
PartitionQueryRequest request, @Nullable Map<Option, ?> options) throws SpannerException { | ||
throw new UnsupportedOperationException("Not implemented yet."); | ||
} | ||
|
||
public PartitionResponse partitionRead( | ||
PartitionReadRequest request, @Nullable Map<Option, ?> options) throws SpannerException { | ||
throw new UnsupportedOperationException("Not implemented yet."); | ||
} | ||
} |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This comment was marked as spam.
Sorry, something went wrong.