Skip to content

Commit

Permalink
Regenerate logging with updated class names (#1708)
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelbausor authored Mar 8, 2017
1 parent 7716d73 commit acb7114
Show file tree
Hide file tree
Showing 12 changed files with 263 additions and 268 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
import com.google.cloud.logging.spi.DefaultLoggingRpc;
import com.google.cloud.logging.spi.LoggingRpc;
import com.google.cloud.logging.spi.LoggingRpcFactory;
import com.google.cloud.logging.spi.v2.LoggingServiceV2Settings;
import com.google.cloud.logging.spi.v2.LoggingSettings;
import com.google.common.collect.ImmutableSet;

import java.io.IOException;
Expand All @@ -32,8 +32,8 @@ public class LoggingOptions extends GrpcServiceOptions<Logging, LoggingRpc, Logg
private static final long serialVersionUID = -5117984564582881668L;
private static final String LOGGING_SCOPE = "https://www.googleapis.com/auth/logging.admin";
private static final Set<String> SCOPES = ImmutableSet.of(LOGGING_SCOPE);
private static final String DEFAULT_HOST = LoggingServiceV2Settings.getDefaultServiceAddress()
+ ':' + LoggingServiceV2Settings.getDefaultServicePort();
private static final String DEFAULT_HOST = LoggingSettings.getDefaultServiceAddress()
+ ':' + LoggingSettings.getDefaultServicePort();

public static class DefaultLoggingFactory implements LoggingFactory {
private static final LoggingFactory INSTANCE = new DefaultLoggingFactory();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,12 @@
import com.google.cloud.NoCredentials;
import com.google.cloud.logging.LoggingException;
import com.google.cloud.logging.LoggingOptions;
import com.google.cloud.logging.spi.v2.ConfigServiceV2Client;
import com.google.cloud.logging.spi.v2.ConfigServiceV2Settings;
import com.google.cloud.logging.spi.v2.LoggingServiceV2Client;
import com.google.cloud.logging.spi.v2.LoggingServiceV2Settings;
import com.google.cloud.logging.spi.v2.MetricsServiceV2Client;
import com.google.cloud.logging.spi.v2.MetricsServiceV2Settings;
import com.google.cloud.logging.spi.v2.ConfigClient;
import com.google.cloud.logging.spi.v2.ConfigSettings;
import com.google.cloud.logging.spi.v2.LoggingClient;
import com.google.cloud.logging.spi.v2.LoggingSettings;
import com.google.cloud.logging.spi.v2.MetricsClient;
import com.google.cloud.logging.spi.v2.MetricsSettings;
import com.google.logging.v2.CreateLogMetricRequest;
import com.google.logging.v2.CreateSinkRequest;
import com.google.logging.v2.DeleteLogMetricRequest;
Expand Down Expand Up @@ -70,9 +70,9 @@

public class DefaultLoggingRpc implements LoggingRpc {

private final ConfigServiceV2Client configClient;
private final LoggingServiceV2Client loggingClient;
private final MetricsServiceV2Client metricsClient;
private final ConfigClient configClient;
private final LoggingClient loggingClient;
private final MetricsClient metricsClient;
private final ScheduledExecutorService executor;
private final ProviderManager providerManager;
private final ExecutorFactory<ScheduledExecutorService> executorFactory;
Expand Down Expand Up @@ -126,21 +126,24 @@ public DefaultLoggingRpc(LoggingOptions options) throws IOException {
.setExecutorProvider(executorProvider)
.build();
UnaryCallSettings.Builder callSettingsBuilder = internalOptions.getApiCallSettings();
ConfigServiceV2Settings.Builder confBuilder = ConfigServiceV2Settings.defaultBuilder()
.setExecutorProvider(providerManager)
.setChannelProvider(providerManager)
.applyToAllUnaryMethods(callSettingsBuilder);
LoggingServiceV2Settings.Builder logBuilder = LoggingServiceV2Settings.defaultBuilder()
.setExecutorProvider(providerManager)
.setChannelProvider(providerManager)
.applyToAllUnaryMethods(callSettingsBuilder);
MetricsServiceV2Settings.Builder metricsBuilder = MetricsServiceV2Settings.defaultBuilder()
.setExecutorProvider(providerManager)
.setChannelProvider(providerManager)
.applyToAllUnaryMethods(callSettingsBuilder);
configClient = ConfigServiceV2Client.create(confBuilder.build());
loggingClient = LoggingServiceV2Client.create(logBuilder.build());
metricsClient = MetricsServiceV2Client.create(metricsBuilder.build());
ConfigSettings.Builder confBuilder =
ConfigSettings.defaultBuilder()
.setExecutorProvider(providerManager)
.setChannelProvider(providerManager)
.applyToAllUnaryMethods(callSettingsBuilder);
LoggingSettings.Builder logBuilder =
LoggingSettings.defaultBuilder()
.setExecutorProvider(providerManager)
.setChannelProvider(providerManager)
.applyToAllUnaryMethods(callSettingsBuilder);
MetricsSettings.Builder metricsBuilder =
MetricsSettings.defaultBuilder()
.setExecutorProvider(providerManager)
.setChannelProvider(providerManager)
.applyToAllUnaryMethods(callSettingsBuilder);
configClient = ConfigClient.create(confBuilder.build());
loggingClient = LoggingClient.create(logBuilder.build());
metricsClient = MetricsClient.create(metricsBuilder.build());
} catch (Exception ex) {
throw new IOException(ex);
}
Expand Down
Loading

0 comments on commit acb7114

Please sign in to comment.