Skip to content

Commit 458ba93

Browse files
committed
Removing a duplicate method.
1 parent 215617c commit 458ba93

File tree

3 files changed

+13
-21
lines changed

3 files changed

+13
-21
lines changed

ds3-sdk/src/main/java/com/spectralogic/ds3client/helpers/strategy/BlobStrategy.java

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,15 @@ public MasterObjectList getMasterObjectList() {
6161
return masterObjectList;
6262
}
6363

64+
protected int computeDelay(final int retryAfterSeconds) {
65+
final int retryDelay = getRetryDelay();
66+
if (retryDelay == -1) {
67+
return retryAfterSeconds;
68+
} else {
69+
return retryDelay;
70+
}
71+
}
72+
6473
public interface ChunkEventHandler {
6574
void emitWaitingForChunksEvents(final int secondsToDelay);
6675
}

ds3-sdk/src/main/java/com/spectralogic/ds3client/helpers/strategy/GetStreamerStrategy.java

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -146,13 +146,4 @@ private MasterObjectList getAvailable() throws IOException, InterruptedException
146146
} while(true);
147147
}
148148

149-
private int computeDelay(final int retryAfterSeconds) {
150-
final int retryDelay = getRetryDelay();
151-
if (retryDelay == -1) {
152-
return retryAfterSeconds;
153-
} else {
154-
return retryDelay;
155-
}
156-
}
157-
158149
}

ds3-sdk/src/main/java/com/spectralogic/ds3client/helpers/strategy/PutStreamerStrategy.java

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -99,11 +99,11 @@ private Objects tryAllocateChunk(final Objects filtered) throws IOException {
9999
}
100100
retryAfterLeft--;
101101

102-
final int retryAfter = computeRetryAfter(response.getRetryAfterSeconds());
103-
getChunkEventHandler().emitWaitingForChunksEvents(retryAfter);
102+
final int retryDelay = computeDelay(response.getRetryAfterSeconds());
103+
getChunkEventHandler().emitWaitingForChunksEvents(retryDelay);
104104

105-
LOG.debug("Will retry allocate chunk call after {} seconds", retryAfter);
106-
Thread.sleep(retryAfter * 1000);
105+
LOG.debug("Will retry allocate chunk call after {} seconds", retryDelay);
106+
Thread.sleep(retryDelay * 1000);
107107
return null;
108108
} catch (final InterruptedException e) {
109109
throw new RuntimeException(e);
@@ -112,12 +112,4 @@ private Objects tryAllocateChunk(final Objects filtered) throws IOException {
112112
assert false : "This line of code should be impossible to hit."; return null;
113113
}
114114
}
115-
116-
private int computeRetryAfter(final int retryAfterSeconds) {
117-
if (getRetryDelay() == -1) {
118-
return retryAfterSeconds;
119-
} else {
120-
return getRetryDelay();
121-
}
122-
}
123115
}

0 commit comments

Comments
 (0)