Skip to content

Commit a4d44b2

Browse files
committed
review changes
1 parent b06a3df commit a4d44b2

File tree

3 files changed

+28
-20
lines changed

3 files changed

+28
-20
lines changed

google-cloud-spanner/src/main/java/com/google/cloud/spanner/BackupInfo.java

Lines changed: 15 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,10 @@
2121
import com.google.cloud.spanner.encryption.BackupEncryptionConfig;
2222
import com.google.cloud.spanner.encryption.EncryptionInfo;
2323
import com.google.spanner.admin.database.v1.Database;
24+
25+
import javax.annotation.Nullable;
2426
import java.util.List;
2527
import java.util.Objects;
26-
import javax.annotation.Nullable;
2728

2829
/** Represents a Cloud Spanner database backup. */
2930
public class BackupInfo {
@@ -100,7 +101,7 @@ protected Builder setMaxExpireTime(Timestamp maxExpireTime) {
100101
*
101102
* <p>Returns the names of the destination backups being created by copying this source backup.
102103
*/
103-
protected Builder addAllReferencingBackups(List<String> referencingBackup) {
104+
protected Builder addAllReferencingBackups(List<String> referencingBackups) {
104105
throw new UnsupportedOperationException("Unimplemented");
105106
}
106107
}
@@ -116,7 +117,7 @@ abstract static class BuilderImpl extends Builder {
116117
private EncryptionInfo encryptionInfo;
117118
private com.google.spanner.admin.database.v1.Backup proto;
118119
private Timestamp maxExpireTime;
119-
private List<String> referencingBackup;
120+
private List<String> referencingBackups;
120121

121122
BuilderImpl(BackupId id) {
122123
this.id = Preconditions.checkNotNull(id);
@@ -133,7 +134,7 @@ abstract static class BuilderImpl extends Builder {
133134
this.encryptionInfo = other.encryptionInfo;
134135
this.proto = other.proto;
135136
this.maxExpireTime = other.maxExpireTime;
136-
this.referencingBackup = other.referencingBackup;
137+
this.referencingBackups = other.referencingBackups;
137138
}
138139

139140
@Override
@@ -188,14 +189,14 @@ Builder setProto(@Nullable com.google.spanner.admin.database.v1.Backup proto) {
188189
}
189190

190191
@Override
191-
public Builder setMaxExpireTime(Timestamp maxExpireTime) {
192+
protected Builder setMaxExpireTime(Timestamp maxExpireTime) {
192193
this.maxExpireTime = Preconditions.checkNotNull(maxExpireTime);
193194
return this;
194195
}
195196

196197
@Override
197-
public Builder addAllReferencingBackups(List<String> referencingBackup) {
198-
this.referencingBackup = Preconditions.checkNotNull(referencingBackup);
198+
protected Builder addAllReferencingBackups(List<String> referencingBackups) {
199+
this.referencingBackups = Preconditions.checkNotNull(referencingBackups);
199200
return this;
200201
}
201202
}
@@ -220,7 +221,7 @@ public enum State {
220221
private final EncryptionInfo encryptionInfo;
221222
private final com.google.spanner.admin.database.v1.Backup proto;
222223
private final Timestamp maxExpireTime;
223-
private final List<String> referencingBackup;
224+
private final List<String> referencingBackups;
224225

225226
BackupInfo(BuilderImpl builder) {
226227
this.id = builder.id;
@@ -233,7 +234,7 @@ public enum State {
233234
this.database = builder.database;
234235
this.proto = builder.proto;
235236
this.maxExpireTime = builder.maxExpireTime;
236-
this.referencingBackup = builder.referencingBackup;
237+
this.referencingBackups = builder.referencingBackups;
237238
}
238239

239240
/** Returns the backup id. */
@@ -301,8 +302,8 @@ public Timestamp getMaxExpireTime() {
301302
* Returns the names of the destination backups being created by copying this source backup {@link
302303
* Backup}.
303304
*/
304-
public List<String> getReferencingBackup() {
305-
return referencingBackup;
305+
public List<String> getReferencingBackups() {
306+
return referencingBackups;
306307
}
307308

308309
@Override
@@ -323,7 +324,7 @@ public boolean equals(Object o) {
323324
&& Objects.equals(versionTime, that.versionTime)
324325
&& Objects.equals(database, that.database)
325326
&& Objects.equals(maxExpireTime, that.maxExpireTime)
326-
&& Objects.equals(referencingBackup, that.referencingBackup);
327+
&& Objects.equals(referencingBackups, that.referencingBackups);
327328
}
328329

329330
@Override
@@ -338,7 +339,7 @@ public int hashCode() {
338339
versionTime,
339340
database,
340341
maxExpireTime,
341-
referencingBackup);
342+
referencingBackups);
342343
}
343344

344345
@Override
@@ -354,6 +355,6 @@ public String toString() {
354355
versionTime,
355356
database,
356357
maxExpireTime,
357-
referencingBackup);
358+
referencingBackups);
358359
}
359360
}

google-cloud-spanner/src/main/java/com/google/cloud/spanner/DatabaseAdminClient.java

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,15 @@
2222
import com.google.cloud.Timestamp;
2323
import com.google.cloud.spanner.Options.ListOption;
2424
import com.google.longrunning.Operation;
25-
import com.google.spanner.admin.database.v1.*;
26-
import java.util.List;
25+
import com.google.spanner.admin.database.v1.CopyBackupMetadata;
26+
import com.google.spanner.admin.database.v1.CreateBackupMetadata;
27+
import com.google.spanner.admin.database.v1.CreateDatabaseMetadata;
28+
import com.google.spanner.admin.database.v1.CreateDatabaseRequest;
29+
import com.google.spanner.admin.database.v1.RestoreDatabaseMetadata;
30+
import com.google.spanner.admin.database.v1.UpdateDatabaseDdlMetadata;
31+
2732
import javax.annotation.Nullable;
33+
import java.util.List;
2834

2935
/** Client to do admin operations on a Cloud Spanner Database. */
3036
public interface DatabaseAdminClient {
@@ -206,8 +212,8 @@ default OperationFuture<Backup, CopyBackupMetadata> copyBackup(
206212
}
207213

208214
/**
209-
* Creates a copy of backup from an existing backup in Cloud Spanner. Any configuration options in
210-
* the {@link Backup} instance will be included in the {@link
215+
* Creates a copy of backup from an existing backup in Cloud Spanner in the same instance. Any
216+
* configuration options in the {@link Backup} instance will be included in the {@link
211217
* com.google.spanner.admin.database.v1.CopyBackupRequest}.
212218
*
213219
* <p>The expire time of the new backup must be set and be at least 6 hours and at most 366 days

google-cloud-spanner/src/main/java/com/google/cloud/spanner/spi/v1/SpannerRpc.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,10 +39,11 @@
3939
import com.google.spanner.admin.instance.v1.InstanceConfig;
4040
import com.google.spanner.admin.instance.v1.UpdateInstanceMetadata;
4141
import com.google.spanner.v1.*;
42+
import org.threeten.bp.Duration;
43+
44+
import javax.annotation.Nullable;
4245
import java.util.List;
4346
import java.util.Map;
44-
import javax.annotation.Nullable;
45-
import org.threeten.bp.Duration;
4647

4748
/**
4849
* Abstracts remote calls to the Cloud Spanner service. Typically end-consumer code will never use

0 commit comments

Comments
 (0)