Skip to content

Commit fbdbcfb

Browse files
committed
Minor fix due to Lucene 5 update
1 parent c48fac8 commit fbdbcfb

File tree

2 files changed

+14
-5
lines changed

2 files changed

+14
-5
lines changed

src/main/java/org/elasticsearch/cloud/gce/blobstore/GoogleCloudStorageConcurrentUpload.java

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@
2222
import com.google.api.client.googleapis.media.MediaHttpUploader;
2323
import com.google.api.services.storage.Storage;
2424
import com.google.api.services.storage.model.StorageObject;
25-
import org.apache.lucene.util.IOUtils;
2625
import org.elasticsearch.cloud.gce.GoogleCloudStorageService;
2726

2827
import java.io.IOException;
@@ -75,7 +74,13 @@ public void run() {
7574

7675
} finally {
7776
done.countDown();
78-
IOUtils.closeWhileHandlingException(input);
77+
if (input != null) {
78+
try {
79+
input.close();
80+
} catch (IOException e) {
81+
// Ignore
82+
}
83+
}
7984
}
8085
}
8186

src/main/java/org/elasticsearch/cloud/gce/blobstore/GoogleCloudStorageOutputStream.java

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@
1919

2020
package org.elasticsearch.cloud.gce.blobstore;
2121

22-
import org.apache.lucene.util.IOUtils;
2322
import org.elasticsearch.common.Preconditions;
2423

2524
import java.io.IOException;
@@ -82,7 +81,13 @@ public void write(int b) throws IOException {
8281

8382
@Override
8483
public void close() throws IOException {
85-
IOUtils.closeWhileHandlingException(output);
84+
if (output != null) {
85+
try {
86+
output.close();
87+
} catch (IOException e) {
88+
// Ignore
89+
}
90+
}
8691

8792
if (input != null) {
8893
try {
@@ -93,7 +98,6 @@ public void close() throws IOException {
9398
checkForConcurrentUploadErrors();
9499

95100
} finally {
96-
IOUtils.closeWhileHandlingException(output);
97101
output = null;
98102
input = null;
99103
upload = null;

0 commit comments

Comments
 (0)