Skip to content

Commit bcabfbc

Browse files
Reviewer comments
1 parent d67872a commit bcabfbc

4 files changed

Lines changed: 8 additions & 9 deletions

File tree

google-cloud-contrib/google-cloud-nio/src/main/java/com/google/cloud/storage/contrib/nio/CloudStorageFileSystemProvider.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -225,7 +225,7 @@ public SeekableByteChannel newByteChannel(
225225
private SeekableByteChannel newReadChannel(Path path, Set<? extends OpenOption> options)
226226
throws IOException {
227227
initStorage();
228-
int maxChannelReopens = ((CloudStorageFileSystem)path.getFileSystem()).config().maxChannelReopens();
228+
int maxChannelReopens = ((CloudStorageFileSystem) path.getFileSystem()).config().maxChannelReopens();
229229
for (OpenOption option : options) {
230230
if (option instanceof StandardOpenOption) {
231231
switch ((StandardOpenOption) option) {
@@ -247,8 +247,8 @@ private SeekableByteChannel newReadChannel(Path path, Set<? extends OpenOption>
247247
default:
248248
throw new UnsupportedOperationException(option.toString());
249249
}
250-
} else if (option instanceof OptionMaxChannelReopen) {
251-
maxChannelReopens = ((OptionMaxChannelReopen)option).maxChannelReopen();
250+
} else if (option instanceof OptionMaxChannelReopens) {
251+
maxChannelReopens = ((OptionMaxChannelReopens) option).maxChannelReopens();
252252
} else {
253253
throw new UnsupportedOperationException(option.toString());
254254
}

google-cloud-contrib/google-cloud-nio/src/main/java/com/google/cloud/storage/contrib/nio/CloudStorageOptions.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ public static CloudStorageOption.OpenCopy withBlockSize(int size) {
9898
* <p>The default is 0.
9999
*/
100100
public static CloudStorageOption.OpenCopy withChannelReopen(int count) {
101-
return OptionMaxChannelReopen.create(count);
101+
return OptionMaxChannelReopens.create(count);
102102
}
103103

104104
private CloudStorageOptions() {}

google-cloud-contrib/google-cloud-nio/src/main/java/com/google/cloud/storage/contrib/nio/CloudStorageReadChannel.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,6 @@ public int read(ByteBuffer dst) throws IOException {
117117
innerOpen();
118118
continue;
119119
} else if ((exs.getCode() == 500 || exs.getCode() == 503) && retries < maxRetries) {
120-
// Retrying works in practice.
121120
retries++;
122121
sleepForAttempt(retries);
123122
continue;

google-cloud-contrib/google-cloud-nio/src/main/java/com/google/cloud/storage/contrib/nio/OptionMaxChannelReopen.java renamed to google-cloud-contrib/google-cloud-nio/src/main/java/com/google/cloud/storage/contrib/nio/OptionMaxChannelReopens.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,14 +19,14 @@
1919
import com.google.auto.value.AutoValue;
2020

2121
@AutoValue
22-
abstract class OptionMaxChannelReopen implements CloudStorageOption.OpenCopy {
22+
abstract class OptionMaxChannelReopens implements CloudStorageOption.OpenCopy {
2323

2424
/**
2525
* Re-open the channel if it's closed unexpectedly while we're reading it.
2626
*/
27-
static OptionMaxChannelReopen create(int retryCount) {
28-
return new AutoValue_OptionMaxChannelReopen(retryCount);
27+
static OptionMaxChannelReopens create(int retryCount) {
28+
return new AutoValue_OptionMaxChannelReopens(retryCount);
2929
}
3030

31-
abstract int maxChannelReopen();
31+
abstract int maxChannelReopens();
3232
}

0 commit comments

Comments
 (0)