Skip to content

Commit

Permalink
spanner: implement partitionRead (#3022)
Browse files Browse the repository at this point in the history
  • Loading branch information
pongad authored Mar 13, 2018
1 parent f3aa527 commit 91dd689
Showing 1 changed file with 12 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@

import com.google.cloud.spanner.SpannerException;
import com.google.cloud.spanner.spi.v1.SpannerRpc.Option;
import com.google.cloud.spanner.v1.stub.GrpcSpannerStub;
import com.google.cloud.spanner.v1.stub.SpannerStub;
import com.google.cloud.spanner.v1.stub.SpannerStubSettings;
import com.google.longrunning.Operation;
import com.google.protobuf.FieldMask;
import com.google.spanner.admin.database.v1.Database;
Expand All @@ -34,13 +37,18 @@
import com.google.spanner.v1.RollbackRequest;
import com.google.spanner.v1.Session;
import com.google.spanner.v1.Transaction;
import java.io.IOException;
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 SpannerStub stub;

public GapicSpannerRpc() throws IOException {
stub = GrpcSpannerStub.create(SpannerStubSettings.newBuilder().build());
}

@Override
public Paginated<InstanceConfig> listInstanceConfigs(int pageSize, @Nullable String pageToken)
Expand Down Expand Up @@ -169,6 +177,8 @@ public PartitionResponse partitionQuery(
@Override
public PartitionResponse partitionRead(
PartitionReadRequest request, @Nullable Map<Option, ?> options) throws SpannerException {
throw new UnsupportedOperationException("Not implemented yet.");
// TODO(pongad): Figure out metadata
// TODO(pongad): Figure out channel affinity
return stub.partitionReadCallable().call(request);
}
}

0 comments on commit 91dd689

Please sign in to comment.