File tree 4 files changed +32
-2
lines changed
src/main/java/com/google/cloud/datastore
4 files changed +32
-2
lines changed Original file line number Diff line number Diff line change 106
106
<groupId >io.opencensus</groupId >
107
107
<artifactId >opencensus-api</artifactId >
108
108
</dependency >
109
+ <dependency >
110
+ <groupId >com.google.code.findbugs</groupId >
111
+ <artifactId >jsr305</artifactId >
112
+ </dependency >
109
113
110
114
<!-- Test dependencies -->
111
115
<dependency >
Original file line number Diff line number Diff line change 17
17
package com .google .cloud .datastore ;
18
18
19
19
import java .util .List ;
20
+ import javax .annotation .concurrent .NotThreadSafe ;
20
21
21
22
/**
22
23
* An interface to represent a batch of write operations. Any write operation that is applied on a
32
33
* batch.add(entity2, entity3);
33
34
* batch.submit();
34
35
* }</pre>
36
+ *
37
+ * <p><b> WARNING: This class maintains an internal state in terms of {@link
38
+ * java.util.LinkedHashMap} and {@link java.util.LinkedHashSet} which gets updated on every method
39
+ * call performing CRUD operations to record the mutations. Since {@link java.util.LinkedHashMap} is
40
+ * not thread safe as per its <a
41
+ * href="https://docs.oracle.com/javase/8/docs/api/java/util/LinkedHashMap.html">documentation</a>,
42
+ * This class too should not be treated as a thread safe class. </b>
35
43
*/
44
+ @ NotThreadSafe
36
45
public interface Batch extends DatastoreBatchWriter {
37
46
38
47
interface Response {
Original file line number Diff line number Diff line change 17
17
package com .google .cloud .datastore ;
18
18
19
19
import java .util .List ;
20
+ import javax .annotation .concurrent .NotThreadSafe ;
20
21
21
22
/**
22
23
* An interface to represent a batch of write operations. All write operation for a batch writer
23
24
* will be applied to the Datastore in one RPC call.
25
+ *
26
+ * <p><b> WARNING: This class maintains an internal state in terms of {@link
27
+ * java.util.LinkedHashMap} and {@link java.util.LinkedHashSet} which gets updated on every method
28
+ * call performing CRUD operations to record the mutations. Since {@link java.util.LinkedHashMap} is
29
+ * not thread safe as per its <a
30
+ * href="https://docs.oracle.com/javase/8/docs/api/java/util/LinkedHashMap.html">documentation</a>,
31
+ * This class too should not be treated as a thread safe class. </b>
24
32
*/
33
+ @ NotThreadSafe
25
34
public interface DatastoreBatchWriter extends DatastoreWriter {
26
35
27
36
/**
Original file line number Diff line number Diff line change 19
19
import com .google .protobuf .ByteString ;
20
20
import java .util .Iterator ;
21
21
import java .util .List ;
22
+ import javax .annotation .concurrent .NotThreadSafe ;
22
23
23
24
/**
24
25
* A Google cloud datastore transaction. Similar to {@link Batch} any write operation that is
25
26
* applied on a transaction will only be sent to the Datastore upon {@link #commit}. A call to
26
27
* {@link #rollback} will invalidate the transaction and discard the changes. Any read operation
27
28
* that is done by a transaction will be part of it and therefore a {@code commit} is guaranteed to
28
- * fail if an entity was modified outside of the transaction after it was read. Write operation on
29
- * this transaction will not be reflected by read operation (as the changes are only sent to the
29
+ * fail if an entity was modified outside the transaction after it was read. Write operation on this
30
+ * transaction will not be reflected by read operation (as the changes are only sent to the
30
31
* Datastore upon {@code commit}. A usage example:
31
32
*
32
33
* <pre>{@code
52
53
*
53
54
* @see <a href="https://cloud.google.com/datastore/docs/concepts/transactions">Google Cloud
54
55
* Datastore transactions</a>
56
+ * <p><b> WARNING: This class maintains an internal state in terms of {@link
57
+ * java.util.LinkedHashMap} and {@link java.util.LinkedHashSet} which gets updated on every
58
+ * method call performing CRUD operations to record the mutations. Since {@link
59
+ * java.util.LinkedHashMap} is not thread safe as per its <a
60
+ * href="https://docs.oracle.com/javase/8/docs/api/java/util/LinkedHashMap.html">documentation</a>,
61
+ * This class too should not be treated as a thread safe class. </b>
55
62
*/
63
+ @ NotThreadSafe
56
64
public interface Transaction extends DatastoreBatchWriter , DatastoreReaderWriter {
57
65
58
66
interface Response {
You can’t perform that action at this time.
0 commit comments