Skip to content

Commit

Permalink
linting changes
Browse files Browse the repository at this point in the history
  • Loading branch information
asthamohta committed Mar 24, 2022
1 parent 8670fb6 commit 48d840d
Show file tree
Hide file tree
Showing 4 changed files with 64 additions and 14 deletions.
25 changes: 25 additions & 0 deletions google-cloud-spanner/clirr-ignored-differences.xml
Original file line number Diff line number Diff line change
Expand Up @@ -35,4 +35,29 @@
<className>com/google/cloud/spanner/connection/ConnectionOptions</className>
<method>com.google.cloud.spanner.Dialect getDialect()</method>
</difference>
<difference>
<differenceType>7013</differenceType>
<className>com/google/cloud/spanner/BackupInfo$Builder</className>
<method>com.google.cloud.spanner.BackupInfo$Builder setMaxExpireTime(com.google.cloud.Timestamp)</method>
</difference>
<difference>
<differenceType>7013</differenceType>
<className>com/google/cloud/spanner/BackupInfo$Builder</className>
<method>com.google.cloud.spanner.BackupInfo$Builder setReferencingBackup(com.google.protobuf.ProtocolStringList)</method>
</difference>
<difference>
<differenceType>7012</differenceType>
<className>com/google/cloud/spanner/DatabaseAdminClient</className>
<method>com.google.api.gax.longrunning.OperationFuture copyBackup(java.lang.String, java.lang.String, java.lang.String, com.google.cloud.Timestamp)</method>
</difference>
<difference>
<differenceType>7012</differenceType>
<className>com/google/cloud/spanner/DatabaseAdminClient</className>
<method>com.google.api.gax.longrunning.OperationFuture copyBackup(com.google.cloud.spanner.BackupId, com.google.cloud.spanner.Backup)</method>
</difference>
<difference>
<differenceType>7012</differenceType>
<className>com/google/cloud/spanner/spi/v1/SpannerRpc</className>
<method>com.google.api.gax.longrunning.OperationFuture copyBackUp(com.google.cloud.spanner.BackupId, com.google.cloud.spanner.Backup)</method>
</difference>
</differences>
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@

package com.google.cloud.spanner;

import static com.google.common.base.Preconditions.checkArgument;

import com.google.api.client.util.Preconditions;
import com.google.api.gax.longrunning.OperationFuture;
import com.google.api.gax.paging.Page;
Expand All @@ -26,8 +28,6 @@
import com.google.spanner.admin.database.v1.CreateBackupMetadata;
import com.google.spanner.admin.database.v1.RestoreDatabaseMetadata;

import static com.google.common.base.Preconditions.checkArgument;

/**
* Represents a Cloud Spanner database backup. {@code Backup} adds a layer of service related
* functionality over {@code BackupInfo}.
Expand Down Expand Up @@ -177,7 +177,7 @@ static Backup fromProto(
checkArgument(!proto.getDatabase().isEmpty(), "Missing expected 'database' field");
return new Backup.Builder(client, BackupId.of(proto.getName()))
.setState(fromProtoState(proto.getState()))
.setSize(proto.getSiprotected abstract Builder setMaxExpireTime(Timestamp maxExpireTime);zeBytes())
.setSize(proto.getSizeBytes())
.setExpireTime(Timestamp.fromProto(proto.getExpireTime()))
.setVersionTime(Timestamp.fromProto(proto.getVersionTime()))
.setDatabase(DatabaseId.of(proto.getDatabase()))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,8 @@
import com.google.cloud.spanner.encryption.EncryptionInfo;
import com.google.protobuf.ProtocolStringList;
import com.google.spanner.admin.database.v1.Database;

import javax.annotation.Nullable;
import java.util.Objects;
import javax.annotation.Nullable;

/** Represents a Cloud Spanner database backup. */
public class BackupInfo {
Expand Down Expand Up @@ -90,16 +89,14 @@ public abstract static class Builder {
/**
* Output Only.
*
* <p>Returns the max allowed expiration time of the backup, with
* microseconds granularity.
* <p>Returns the max allowed expiration time of the backup, with microseconds granularity.
*/
protected abstract Builder setMaxExpireTime(Timestamp maxExpireTime);

/**
* Output Only.
*
* <p>Returns the names of the destination backups being created by copying
* this source backup.
* <p>Returns the names of the destination backups being created by copying this source backup.
*/
protected abstract Builder setReferencingBackup(ProtocolStringList referencingBackup);
}
Expand Down Expand Up @@ -192,7 +189,6 @@ public Builder setMaxExpireTime(Timestamp maxExpireTime) {
return this;
}


@Override
public Builder setReferencingBackup(ProtocolStringList referencingBackup) {
this.referencingBackup = Preconditions.checkNotNull(referencingBackup);
Expand Down Expand Up @@ -297,8 +293,10 @@ public Timestamp getMaxExpireTime() {
return maxExpireTime;
}

/** Returns the names of the destination backups being created by copying
* this source backup {@link Backup}. */
/**
* Returns the names of the destination backups being created by copying this source backup {@link
* Backup}.
*/
public ProtocolStringList getReferencingBackup() {
return referencingBackup;
}
Expand Down Expand Up @@ -327,7 +325,16 @@ public boolean equals(Object o) {
@Override
public int hashCode() {
return Objects.hash(
id, state, size, encryptionConfig, encryptionInfo, expireTime, versionTime, database, maxExpireTime, referencingBackup);
id,
state,
size,
encryptionConfig,
encryptionInfo,
expireTime,
versionTime,
database,
maxExpireTime,
referencingBackup);
}

@Override
Expand Down
20 changes: 19 additions & 1 deletion samples/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,24 @@
<module>snippets</module>
</modules>

<dependencies>
<dependency>
<groupId>com.google.cloud</groupId>
<artifactId>google-cloud-spanner</artifactId>
<version>6.19.1-SNAPSHOT</version>
</dependency>
<!-- [END spanner_install_with_bom] -->
<dependency>
<groupId>com.google.api.grpc</groupId>
<artifactId>grpc-google-cloud-spanner-admin-database-v1</artifactId>
<version>6.19.1-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>com.google.api.grpc</groupId>
<artifactId>proto-google-cloud-spanner-admin-database-v1</artifactId>
<version>6.19.1-SNAPSHOT</version>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
Expand All @@ -53,4 +71,4 @@
</plugin>
</plugins>
</build>
</project>
</project>

0 comments on commit 48d840d

Please sign in to comment.