Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,6 @@
import java.net.URI;

import org.apache.http.impl.client.CloseableHttpClient;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import com.ibm.watson.developer_cloud.retrieve_and_rank.v1.models.SolrCluster;
import com.ibm.watson.developer_cloud.retrieve_and_rank.v1.models.SolrClusterCreationRequest;
Expand All @@ -37,7 +35,6 @@
* A client for managing Watson Search Service Solr clusters.
*/
public class HttpClusterLifecycleClient implements AutoCloseable, ClusterLifecycleClient {
private static final Logger LOG = LoggerFactory.getLogger(HttpSolrConfigManager.class);
private final MessageFormatter msgs = new MessageFormatter(bundleName());

private final ClusterLifecycleRestSender clusterLifecycleRestSender;
Expand Down Expand Up @@ -99,7 +96,7 @@ public void close() {
try {
createdHttpClient.close();
} catch (final IOException e) {
LOG.error(msgs.format(UNABLE_TO_CLOSE_HTTP_CLIENT), e);
throw new RuntimeException(msgs.format(UNABLE_TO_CLOSE_HTTP_CLIENT), e);
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,6 @@
import java.util.Collection;

import org.apache.http.impl.client.CloseableHttpClient;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import com.ibm.watson.developer_cloud.retrieve_and_rank.v1.utils.HttpClientFactory;
import com.ibm.watson.developer_cloud.retrieve_and_rank.v1.utils.MessageFormatter;
Expand All @@ -36,7 +34,6 @@
* Manages SolrCloud configuration.
*/
public class HttpSolrConfigManager implements SolrConfigManager {
private static final Logger LOG = LoggerFactory.getLogger(HttpSolrConfigManager.class);
private final MessageFormatter msgs = new MessageFormatter(bundleName());

private final SolrConfigRestSender configUploader;
Expand Down Expand Up @@ -106,7 +103,7 @@ public void close() {
try {
createdHttpClient.close();
} catch (final IOException e) {
LOG.error(msgs.format(UNABLE_TO_CLOSE_HTTP_CLIENT), e);
throw new RuntimeException(msgs.format(UNABLE_TO_CLOSE_HTTP_CLIENT), e);
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
import java.net.URI;
import java.nio.file.Files;
import java.util.Collection;
import java.util.logging.Logger;

import javax.ws.rs.core.UriBuilder;

Expand All @@ -37,18 +38,17 @@
import org.apache.http.entity.FileEntity;
import org.apache.http.protocol.HTTP;
import org.apache.http.util.EntityUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import com.google.common.base.Throwables;
import com.ibm.watson.developer_cloud.alchemy.v1.util.PublicationDateTypeAdapter;
import com.ibm.watson.developer_cloud.retrieve_and_rank.v1.models.RemoteError;
import com.ibm.watson.developer_cloud.retrieve_and_rank.v1.models.SolrConfigList;

/**
* Posts config to the Watson search service.
*/
public class SolrConfigRestSender {
private static final Logger LOG = LoggerFactory.getLogger(SolrConfigRestSender.class);
private static final Logger LOG = Logger.getLogger(PublicationDateTypeAdapter.class.getName());
private static final MessageFormatter MSGS = new MessageFormatter(bundleName());

private final URI serviceUrl;
Expand Down Expand Up @@ -85,7 +85,7 @@ public void uploadConfiguration(final String configName, final File file) {
Files.delete(zipFile.toPath());
} catch (final IOException e) {
zipFile.deleteOnExit();
LOG.warn(MSGS.format(FAILED_TO_DELETE_TEMP_2, zipFile.getPath(), e.getMessage()));
LOG.warning(MSGS.format(FAILED_TO_DELETE_TEMP_2, zipFile.getPath(), e.getMessage()));
}
}
}
Expand Down