11package com .google .gcloud .datastore ;
22
33import java .util .Iterator ;
4- import java .util .Map ;
54
6- public interface DatastoreService {
5+ public interface DatastoreService extends DatastoreReader , DatastoreWriter {
76
8- interface DatastoreReader {
7+ interface Query {
98
10- Map <String , Property <?, ?, ?>> get (Key key );
11-
12- // return the result in the given order
13- Iterator <Map <String , Property <?, ?, ?>>> get (Iterator <Key > key );
14-
15- // query result item is a tuple of (key, value...) where values may be empty
16- //QueryResult runQuery(Query query);
17- }
18-
19- // TODO: remove all refrence of IncomplteKey (except allocate and use Entity instead of Map)
20-
21- interface DatastoreWriter {
22-
23- Key add (IncompleteKey key , Map <String , Property <?, ?, ?>> values );
24-
25- void update (Key key , Map <String , Property <?, ?, ?>> values );
26-
27- Key put (IncompleteKey key , Map <String , Property <?, ?, ?>> values );
28-
29- void delete (Key key );
309 }
3110
3211
@@ -43,35 +22,28 @@ enum IsolationLevel {
4322 SERIALIZABLE , SNAPSHOT ;
4423 }
4524
46- IsolationLevel getIsolationLevel ();
47- }
48-
49- public interface Batch extends DatastoreWriter {
5025
51- @ Override
52- void add (Key key , Map <String , Property <?, ?, ?>> values );
26+ IsolationLevel getIsolationLevel ();
5327
54- @ Override
55- void update ( Key key , Map < String , Property <?, ?, ?>> values );
28+ boolean force ();
29+ }
5630
57- @ Override
58- void put (Key key , Map <String , Property <?, ?, ?>> values );
31+ public interface BatchWriter extends DatastoreWriter {
5932
6033 void submit ();
6134 }
6235
6336 public interface BatchOptions {
64-
6537 }
6638
6739 DatastoreServiceOptions getOptions ();
6840
69- Transaction newTransaction (TransactionOptions tsOptions );
41+ Transaction newTransaction (TransactionOptions transactionOptions );
7042
71- Batch newBatch ( );
43+ BatchWriter newBatchWriter ( BatchOptions batchOptions );
7244
7345 Key allocateId (IncompleteKey key );
7446
75- // results are returned in request order
76- Iterator <Key > allocateIds (Iterator < IncompleteKey > key );
47+ // results are returned using request order
48+ Iterator <Key > allocateIds (IncompleteKey ... key );
7749}
0 commit comments