doubledeadline=5.0;// Construct a read policy for eventual consistencyReadPolicypolicy=newReadPolicy(ReadPolicy.Consistency.EVENTUAL);// Set the read policyDatastoreServiceConfigeventuallyConsistentConfig=DatastoreServiceConfig.Builder.withReadPolicy(policy);// Set the call deadlineDatastoreServiceConfigdeadlineConfig=DatastoreServiceConfig.Builder.withDeadline(deadline);// Set both the read policy and the call deadlineDatastoreServiceConfigdatastoreConfig=DatastoreServiceConfig.Builder.withReadPolicy(policy).deadline(deadline);// Get Datastore service with the given configurationDatastoreServicedatastore=DatastoreServiceFactory.getDatastoreService(datastoreConfig);
[[["わかりやすい","easyToUnderstand","thumb-up"],["問題の解決に役立った","solvedMyProblem","thumb-up"],["その他","otherUp","thumb-up"]],[["わかりにくい","hardToUnderstand","thumb-down"],["情報またはサンプルコードが不正確","incorrectInformationOrSampleCode","thumb-down"],["必要な情報 / サンプルがない","missingTheInformationSamplesINeed","thumb-down"],["翻訳に関する問題","translationIssue","thumb-down"],["その他","otherDown","thumb-down"]],["最終更新日 2025-03-13 UTC。"],[[["This API supports first-generation runtimes and is relevant when upgrading to second-generation runtimes, while migration to Java 11/17 requires a separate migration guide."],["Datastore queries offer two consistency levels: strongly consistent queries, which guarantee the freshest results but may be slower, and eventually consistent queries, which are generally faster but may return stale results."],["Ancestor queries are strongly consistent by default but can be set to eventually consistent, while non-ancestor queries are always eventually consistent."],["The Datastore read policy can be set to eventually consistent to improve performance, and the call deadline can be adjusted to control the maximum wait time for a Datastore operation."],["Developers can use the `DatastoreServiceConfig` to set the read policy and/or the call deadline for Datastore operations, using the `ReadPolicy` for consistency and `withDeadline` for the time limit, and can use the `DatastoreServiceFactory` to get a `DatastoreService` instance with the desired configuration."]]],[]]