Skip to content

feat!: mark interfaces as @InternalExtensionOnly #1275

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

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@

package com.google.cloud.datastore;

import com.google.api.core.InternalExtensionOnly;
import java.util.List;
import javax.annotation.concurrent.NotThreadSafe;

Expand All @@ -42,6 +43,7 @@
* This class too should not be treated as a thread safe class. </b>
*/
@NotThreadSafe
@InternalExtensionOnly
public interface Batch extends DatastoreBatchWriter {

interface Response {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,14 @@

package com.google.cloud.datastore;

import com.google.api.core.InternalExtensionOnly;
import com.google.cloud.Service;
import com.google.datastore.v1.TransactionOptions;
import java.util.Iterator;
import java.util.List;

/** An interface for Google Cloud Datastore. */
@InternalExtensionOnly
public interface Datastore extends Service<DatastoreOptions>, DatastoreReaderWriter, AutoCloseable {

/**
Expand Down Expand Up @@ -505,9 +507,7 @@ interface TransactionCallable<T> {
* @throws DatastoreException upon failure
* @return {@link AggregationResults}
*/
default AggregationResults runAggregation(AggregationQuery query, ReadOption... options) {
throw new UnsupportedOperationException("Not implemented.");
}
AggregationResults runAggregation(AggregationQuery query, ReadOption... options);

/**
* Closes the gRPC channels associated with this instance and frees up their resources. This
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@

package com.google.cloud.datastore;

import com.google.api.core.InternalExtensionOnly;
import java.util.List;
import javax.annotation.concurrent.NotThreadSafe;

Expand All @@ -31,6 +32,7 @@
* This class too should not be treated as a thread safe class. </b>
*/
@NotThreadSafe
@InternalExtensionOnly
public interface DatastoreBatchWriter extends DatastoreWriter {

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,9 @@

package com.google.cloud.datastore;

import com.google.api.core.InternalExtensionOnly;
import com.google.cloud.ServiceFactory;

/** An interface for Datastore factories. */
@InternalExtensionOnly
public interface DatastoreFactory extends ServiceFactory<Datastore, DatastoreOptions> {}
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,12 @@

package com.google.cloud.datastore;

import com.google.api.core.InternalExtensionOnly;
import java.util.Iterator;
import java.util.List;

/** An interface to represent Google Cloud Datastore read operations. */
@InternalExtensionOnly
public interface DatastoreReader {

/**
Expand Down Expand Up @@ -59,7 +61,5 @@ public interface DatastoreReader {
*
* @throws DatastoreException upon failure
*/
default AggregationResults runAggregation(AggregationQuery query) {
throw new UnsupportedOperationException("Not implemented.");
}
AggregationResults runAggregation(AggregationQuery query);
}
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,8 @@

package com.google.cloud.datastore;

import com.google.api.core.InternalExtensionOnly;

/** An interface that combines both Google Cloud Datastore read and write operations. */
@InternalExtensionOnly
public interface DatastoreReaderWriter extends DatastoreReader, DatastoreWriter {}
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,11 @@

package com.google.cloud.datastore;

import com.google.api.core.InternalExtensionOnly;
import java.util.List;

/** An interface to represent Google Cloud Datastore write operations. */
@InternalExtensionOnly
public interface DatastoreWriter {

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@

package com.google.cloud.datastore;

import com.google.api.core.InternalExtensionOnly;
import com.google.datastore.v1.QueryResultBatch;
import java.util.Iterator;

Expand All @@ -28,6 +29,7 @@
*
* @param <V> the type of the results value.
*/
@InternalExtensionOnly
public interface QueryResults<V> extends Iterator<V> {

/** Returns the actual class of the result's values. */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@

import com.google.api.core.ApiFunction;
import com.google.api.core.InternalApi;
import com.google.api.core.InternalExtensionOnly;
import com.google.cloud.StringEnumType;
import com.google.cloud.StringEnumValue;
import com.google.cloud.Timestamp;
Expand Down Expand Up @@ -700,6 +701,7 @@ public String toString() {
*
* @param <V> the type of result the query returns.
*/
@InternalExtensionOnly
public interface Builder<V> {

/** Sets the namespace for the query. */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@

package com.google.cloud.datastore;

import com.google.api.core.InternalExtensionOnly;
import com.google.protobuf.ByteString;
import java.util.Iterator;
import java.util.List;
Expand Down Expand Up @@ -61,6 +62,7 @@
* This class too should not be treated as a thread safe class. </b>
*/
@NotThreadSafe
@InternalExtensionOnly
public interface Transaction extends DatastoreBatchWriter, DatastoreReaderWriter {

interface Response {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@

package com.google.cloud.datastore;

import com.google.api.core.InternalExtensionOnly;
import com.google.cloud.GcpLaunchStage;

/**
Expand All @@ -25,6 +26,7 @@
* @param <P> the value type.
* @param <B> the value type's associated builder.
*/
@InternalExtensionOnly
public interface ValueBuilder<V, P extends Value<V>, B extends ValueBuilder<V, P, B>> {

ValueType getValueType();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,16 @@

package com.google.cloud.datastore.aggregation;

import com.google.api.core.InternalExtensionOnly;

/**
* An interface to represent the builders which build and customize {@link Aggregation} for {@link
* com.google.cloud.datastore.AggregationQuery}.
*
* <p>Used by {@link
* com.google.cloud.datastore.AggregationQuery.Builder#addAggregation(AggregationBuilder)}.
*/
@InternalExtensionOnly
public interface AggregationBuilder<A extends Aggregation> {
A build();
}
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,13 @@

package com.google.cloud.datastore.spi;

import com.google.api.core.InternalExtensionOnly;
import com.google.cloud.datastore.DatastoreOptions;
import com.google.cloud.spi.ServiceRpcFactory;

/**
* An interface for Datastore RPC factory. Implementation will be loaded via {@link
* java.util.ServiceLoader}.
*/
@InternalExtensionOnly
public interface DatastoreRpcFactory extends ServiceRpcFactory<DatastoreOptions> {}
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
package com.google.cloud.datastore.spi.v1;

import com.google.api.core.InternalApi;
import com.google.api.core.InternalExtensionOnly;
import com.google.api.gax.rpc.HeaderProvider;
import com.google.cloud.ServiceRpc;
import com.google.cloud.datastore.DatastoreException;
Expand All @@ -39,6 +40,7 @@
import com.google.datastore.v1.RunQueryResponse;

/** Provides access to the remote Datastore service. */
@InternalExtensionOnly
public interface DatastoreRpc extends ServiceRpc, AutoCloseable {

/**
Expand Down Expand Up @@ -96,9 +98,7 @@ BeginTransactionResponse beginTransaction(BeginTransactionRequest request)
*
* @throws DatastoreException upon failure
*/
default RunAggregationQueryResponse runAggregationQuery(RunAggregationQueryRequest request) {
throw new UnsupportedOperationException("Not implemented.");
}
RunAggregationQueryResponse runAggregationQuery(RunAggregationQueryRequest request);

@Override
void close() throws Exception;
Expand Down