Skip to content

Commit 582b133

Browse files
author
Ajay Kannan
committed
---
yaml --- r: 2513 b: refs/heads/update-datastore c: 8808c54 h: refs/heads/master i: 2511: d2b14c4
1 parent f32eea0 commit 582b133

4 files changed

Lines changed: 10 additions & 2 deletions

File tree

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ refs/heads/gh-pages: 4e0561bb4504bf647db669a14417b2b2c87ba45d
55
refs/heads/bigquery: 762fa5830e6c398c0396177e3e7fd243bd62cfc3
66
refs/heads/pubsub-alpha: 1a0e970f265af871e02274085b9662b3fe29058b
77
refs/heads/resource-manager: ebf4adc5ee835cd2086c4ac5b4e78d01a5a005a7
8-
refs/heads/update-datastore: d8a61590089bbaa0619b4c8d8491fb5f55028806
8+
refs/heads/update-datastore: 8808c54c09a1d80060d8ea804164dc26ee4ce229
99
refs/tags/0.0.9: 22f1839238f66c39e67ed4dfdcd273b1ae2e8444
1010
refs/tags/v0.0.10: 207ebd2a3472fddee69fe1298eb90429e3306efd
1111
refs/tags/v0.0.11: ffbfba48a6426ff63c08ff2117e58681f251fbf2

branches/update-datastore/gcloud-java-datastore/README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,8 @@ while (results.hasNext()) {
128128
}
129129
```
130130

131+
Cloud Datastore relies on indexing to run queries. Indexing is turned on by default for most types of properties. To read more about indexing, see the [Cloud Datastore Index Configuration documentation](https://cloud.google.com/datastore/docs/tools/indexconfig).
132+
131133
#### Complete source code
132134

133135
Here we put together all the code shown above into one program. This program assumes that you are running on Compute Engine or from your own desktop. To run this example on App Engine, simply move the code from the main method to your application's servlet class.

branches/update-datastore/gcloud-java-datastore/src/main/java/com/google/gcloud/datastore/Query.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,10 @@
3535
* A Google Cloud Datastore query.
3636
* For usage examples see {@link GqlQuery} and {@link StructuredQuery}.
3737
*
38+
* Note that queries require proper indexing. See
39+
* <a href="https://cloud.google.com/datastore/docs/tools/indexconfig">
40+
* Cloud Datastore Index Configuration</a> for help configuring indexes.
41+
*
3842
* @param <V> the type of the values returned by this query.
3943
* @see <a href="https://cloud.google.com/datastore/docs/concepts/queries">Datastore Queries</a>
4044
*/

branches/update-datastore/gcloud-java-datastore/src/main/java/com/google/gcloud/spi/DefaultDatastoreRpc.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,9 @@
4242
import org.json.JSONTokener;
4343

4444
import java.net.InetAddress;
45+
import java.net.MalformedURLException;
4546
import java.net.URL;
47+
import java.net.UnknownHostException;
4648
import java.util.HashMap;
4749
import java.util.Map;
4850

@@ -93,7 +95,7 @@ private static boolean isLocalHost(String host) {
9395
}
9496
InetAddress hostAddr = InetAddress.getByName(new URL(normalizedHost).getHost());
9597
return hostAddr.isAnyLocalAddress() || hostAddr.isLoopbackAddress();
96-
} catch (Exception e) {
98+
} catch (UnknownHostException | MalformedURLException e) {
9799
// ignore
98100
}
99101
}

0 commit comments

Comments
 (0)