migration.proto 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124
  1. // Copyright 2022 Google LLC
  2. //
  3. // Licensed under the Apache License, Version 2.0 (the "License");
  4. // you may not use this file except in compliance with the License.
  5. // You may obtain a copy of the License at
  6. //
  7. // http://www.apache.org/licenses/LICENSE-2.0
  8. //
  9. // Unless required by applicable law or agreed to in writing, software
  10. // distributed under the License is distributed on an "AS IS" BASIS,
  11. // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  12. // See the License for the specific language governing permissions and
  13. // limitations under the License.
  14. syntax = "proto3";
  15. package google.datastore.admin.v1;
  16. option csharp_namespace = "Google.Cloud.Datastore.Admin.V1";
  17. option go_package = "google.golang.org/genproto/googleapis/datastore/admin/v1;admin";
  18. option java_multiple_files = true;
  19. option java_outer_classname = "MigrationProto";
  20. option java_package = "com.google.datastore.admin.v1";
  21. option php_namespace = "Google\\Cloud\\Datastore\\Admin\\V1";
  22. option ruby_package = "Google::Cloud::Datastore::Admin::V1";
  23. // An event signifying a change in state of a [migration from Cloud Datastore to
  24. // Cloud Firestore in Datastore
  25. // mode](https://cloud.google.com/datastore/docs/upgrade-to-firestore).
  26. message MigrationStateEvent {
  27. // The new state of the migration.
  28. MigrationState state = 1;
  29. }
  30. // An event signifying the start of a new step in a [migration from Cloud
  31. // Datastore to Cloud Firestore in Datastore
  32. // mode](https://cloud.google.com/datastore/docs/upgrade-to-firestore).
  33. message MigrationProgressEvent {
  34. // Concurrency modes for transactions in Cloud Firestore.
  35. enum ConcurrencyMode {
  36. // Unspecified.
  37. CONCURRENCY_MODE_UNSPECIFIED = 0;
  38. // Pessimistic concurrency.
  39. PESSIMISTIC = 1;
  40. // Optimistic concurrency.
  41. OPTIMISTIC = 2;
  42. // Optimistic concurrency with entity groups.
  43. OPTIMISTIC_WITH_ENTITY_GROUPS = 3;
  44. }
  45. // Details for the `PREPARE` step.
  46. message PrepareStepDetails {
  47. // The concurrency mode this database will use when it reaches the
  48. // `REDIRECT_WRITES` step.
  49. ConcurrencyMode concurrency_mode = 1;
  50. }
  51. // Details for the `REDIRECT_WRITES` step.
  52. message RedirectWritesStepDetails {
  53. // Ths concurrency mode for this database.
  54. ConcurrencyMode concurrency_mode = 1;
  55. }
  56. // The step that is starting.
  57. //
  58. // An event with step set to `START` indicates that the migration
  59. // has been reverted back to the initial pre-migration state.
  60. MigrationStep step = 1;
  61. // Details about this step.
  62. oneof step_details {
  63. // Details for the `PREPARE` step.
  64. PrepareStepDetails prepare_step_details = 2;
  65. // Details for the `REDIRECT_WRITES` step.
  66. RedirectWritesStepDetails redirect_writes_step_details = 3;
  67. }
  68. }
  69. // States for a migration.
  70. enum MigrationState {
  71. // Unspecified.
  72. MIGRATION_STATE_UNSPECIFIED = 0;
  73. // The migration is running.
  74. RUNNING = 1;
  75. // The migration is paused.
  76. PAUSED = 2;
  77. // The migration is complete.
  78. COMPLETE = 3;
  79. }
  80. // Steps in a migration.
  81. enum MigrationStep {
  82. // Unspecified.
  83. MIGRATION_STEP_UNSPECIFIED = 0;
  84. // Pre-migration: the database is prepared for migration.
  85. PREPARE = 6;
  86. // Start of migration.
  87. START = 1;
  88. // Writes are applied synchronously to at least one replica.
  89. APPLY_WRITES_SYNCHRONOUSLY = 7;
  90. // Data is copied to Cloud Firestore and then verified to match the data in
  91. // Cloud Datastore.
  92. COPY_AND_VERIFY = 2;
  93. // Eventually-consistent reads are redirected to Cloud Firestore.
  94. REDIRECT_EVENTUALLY_CONSISTENT_READS = 3;
  95. // Strongly-consistent reads are redirected to Cloud Firestore.
  96. REDIRECT_STRONGLY_CONSISTENT_READS = 4;
  97. // Writes are redirected to Cloud Firestore.
  98. REDIRECT_WRITES = 5;
  99. }