Skip to content

Commit f077c04

Browse files
authored
feat!: mark interfaces as @InternalExtensionOnly (#1275)
* feat!: mark interfaces as `@InternalExtensionOnly` * lint
1 parent 408bb21 commit f077c04

14 files changed

+33
-9
lines changed

google-cloud-datastore/src/main/java/com/google/cloud/datastore/Batch.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616

1717
package com.google.cloud.datastore;
1818

19+
import com.google.api.core.InternalExtensionOnly;
1920
import java.util.List;
2021
import javax.annotation.concurrent.NotThreadSafe;
2122

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

4749
interface Response {

google-cloud-datastore/src/main/java/com/google/cloud/datastore/Datastore.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,14 @@
1616

1717
package com.google.cloud.datastore;
1818

19+
import com.google.api.core.InternalExtensionOnly;
1920
import com.google.cloud.Service;
2021
import com.google.datastore.v1.TransactionOptions;
2122
import java.util.Iterator;
2223
import java.util.List;
2324

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

2729
/**
@@ -505,9 +507,7 @@ interface TransactionCallable<T> {
505507
* @throws DatastoreException upon failure
506508
* @return {@link AggregationResults}
507509
*/
508-
default AggregationResults runAggregation(AggregationQuery query, ReadOption... options) {
509-
throw new UnsupportedOperationException("Not implemented.");
510-
}
510+
AggregationResults runAggregation(AggregationQuery query, ReadOption... options);
511511

512512
/**
513513
* Closes the gRPC channels associated with this instance and frees up their resources. This

google-cloud-datastore/src/main/java/com/google/cloud/datastore/DatastoreBatchWriter.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616

1717
package com.google.cloud.datastore;
1818

19+
import com.google.api.core.InternalExtensionOnly;
1920
import java.util.List;
2021
import javax.annotation.concurrent.NotThreadSafe;
2122

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

3638
/**

google-cloud-datastore/src/main/java/com/google/cloud/datastore/DatastoreFactory.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,9 @@
1616

1717
package com.google.cloud.datastore;
1818

19+
import com.google.api.core.InternalExtensionOnly;
1920
import com.google.cloud.ServiceFactory;
2021

2122
/** An interface for Datastore factories. */
23+
@InternalExtensionOnly
2224
public interface DatastoreFactory extends ServiceFactory<Datastore, DatastoreOptions> {}

google-cloud-datastore/src/main/java/com/google/cloud/datastore/DatastoreReader.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,12 @@
1616

1717
package com.google.cloud.datastore;
1818

19+
import com.google.api.core.InternalExtensionOnly;
1920
import java.util.Iterator;
2021
import java.util.List;
2122

2223
/** An interface to represent Google Cloud Datastore read operations. */
24+
@InternalExtensionOnly
2325
public interface DatastoreReader {
2426

2527
/**
@@ -59,7 +61,5 @@ public interface DatastoreReader {
5961
*
6062
* @throws DatastoreException upon failure
6163
*/
62-
default AggregationResults runAggregation(AggregationQuery query) {
63-
throw new UnsupportedOperationException("Not implemented.");
64-
}
64+
AggregationResults runAggregation(AggregationQuery query);
6565
}

google-cloud-datastore/src/main/java/com/google/cloud/datastore/DatastoreReaderWriter.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,5 +16,8 @@
1616

1717
package com.google.cloud.datastore;
1818

19+
import com.google.api.core.InternalExtensionOnly;
20+
1921
/** An interface that combines both Google Cloud Datastore read and write operations. */
22+
@InternalExtensionOnly
2023
public interface DatastoreReaderWriter extends DatastoreReader, DatastoreWriter {}

google-cloud-datastore/src/main/java/com/google/cloud/datastore/DatastoreWriter.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,11 @@
1616

1717
package com.google.cloud.datastore;
1818

19+
import com.google.api.core.InternalExtensionOnly;
1920
import java.util.List;
2021

2122
/** An interface to represent Google Cloud Datastore write operations. */
23+
@InternalExtensionOnly
2224
public interface DatastoreWriter {
2325

2426
/**

google-cloud-datastore/src/main/java/com/google/cloud/datastore/QueryResults.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616

1717
package com.google.cloud.datastore;
1818

19+
import com.google.api.core.InternalExtensionOnly;
1920
import com.google.datastore.v1.QueryResultBatch;
2021
import java.util.Iterator;
2122

@@ -28,6 +29,7 @@
2829
*
2930
* @param <V> the type of the results value.
3031
*/
32+
@InternalExtensionOnly
3133
public interface QueryResults<V> extends Iterator<V> {
3234

3335
/** Returns the actual class of the result's values. */

google-cloud-datastore/src/main/java/com/google/cloud/datastore/StructuredQuery.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727

2828
import com.google.api.core.ApiFunction;
2929
import com.google.api.core.InternalApi;
30+
import com.google.api.core.InternalExtensionOnly;
3031
import com.google.cloud.StringEnumType;
3132
import com.google.cloud.StringEnumValue;
3233
import com.google.cloud.Timestamp;
@@ -700,6 +701,7 @@ public String toString() {
700701
*
701702
* @param <V> the type of result the query returns.
702703
*/
704+
@InternalExtensionOnly
703705
public interface Builder<V> {
704706

705707
/** Sets the namespace for the query. */

google-cloud-datastore/src/main/java/com/google/cloud/datastore/Transaction.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616

1717
package com.google.cloud.datastore;
1818

19+
import com.google.api.core.InternalExtensionOnly;
1920
import com.google.protobuf.ByteString;
2021
import java.util.Iterator;
2122
import java.util.List;
@@ -61,6 +62,7 @@
6162
* This class too should not be treated as a thread safe class. </b>
6263
*/
6364
@NotThreadSafe
65+
@InternalExtensionOnly
6466
public interface Transaction extends DatastoreBatchWriter, DatastoreReaderWriter {
6567

6668
interface Response {

google-cloud-datastore/src/main/java/com/google/cloud/datastore/ValueBuilder.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616

1717
package com.google.cloud.datastore;
1818

19+
import com.google.api.core.InternalExtensionOnly;
1920
import com.google.cloud.GcpLaunchStage;
2021

2122
/**
@@ -25,6 +26,7 @@
2526
* @param <P> the value type.
2627
* @param <B> the value type's associated builder.
2728
*/
29+
@InternalExtensionOnly
2830
public interface ValueBuilder<V, P extends Value<V>, B extends ValueBuilder<V, P, B>> {
2931

3032
ValueType getValueType();

google-cloud-datastore/src/main/java/com/google/cloud/datastore/aggregation/AggregationBuilder.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,16 @@
1616

1717
package com.google.cloud.datastore.aggregation;
1818

19+
import com.google.api.core.InternalExtensionOnly;
20+
1921
/**
2022
* An interface to represent the builders which build and customize {@link Aggregation} for {@link
2123
* com.google.cloud.datastore.AggregationQuery}.
2224
*
2325
* <p>Used by {@link
2426
* com.google.cloud.datastore.AggregationQuery.Builder#addAggregation(AggregationBuilder)}.
2527
*/
28+
@InternalExtensionOnly
2629
public interface AggregationBuilder<A extends Aggregation> {
2730
A build();
2831
}

google-cloud-datastore/src/main/java/com/google/cloud/datastore/spi/DatastoreRpcFactory.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,13 @@
1616

1717
package com.google.cloud.datastore.spi;
1818

19+
import com.google.api.core.InternalExtensionOnly;
1920
import com.google.cloud.datastore.DatastoreOptions;
2021
import com.google.cloud.spi.ServiceRpcFactory;
2122

2223
/**
2324
* An interface for Datastore RPC factory. Implementation will be loaded via {@link
2425
* java.util.ServiceLoader}.
2526
*/
27+
@InternalExtensionOnly
2628
public interface DatastoreRpcFactory extends ServiceRpcFactory<DatastoreOptions> {}

google-cloud-datastore/src/main/java/com/google/cloud/datastore/spi/v1/DatastoreRpc.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
package com.google.cloud.datastore.spi.v1;
1818

1919
import com.google.api.core.InternalApi;
20+
import com.google.api.core.InternalExtensionOnly;
2021
import com.google.api.gax.rpc.HeaderProvider;
2122
import com.google.cloud.ServiceRpc;
2223
import com.google.cloud.datastore.DatastoreException;
@@ -39,6 +40,7 @@
3940
import com.google.datastore.v1.RunQueryResponse;
4041

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

4446
/**
@@ -96,9 +98,7 @@ BeginTransactionResponse beginTransaction(BeginTransactionRequest request)
9698
*
9799
* @throws DatastoreException upon failure
98100
*/
99-
default RunAggregationQueryResponse runAggregationQuery(RunAggregationQueryRequest request) {
100-
throw new UnsupportedOperationException("Not implemented.");
101-
}
101+
RunAggregationQueryResponse runAggregationQuery(RunAggregationQueryRequest request);
102102

103103
@Override
104104
void close() throws Exception;

0 commit comments

Comments
 (0)