Skip to content

Commit 5818eca

Browse files
abhinav-qlogicchingor13
authored andcommitted
---
yaml --- r: 35435 b: refs/heads/pubsub-ordering-keys c: af8ee56 h: refs/heads/master i: 35433: cb0b403 35431: 900d0b5
1 parent 7e92721 commit 5818eca

5 files changed

Lines changed: 28 additions & 17 deletions

File tree

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@ refs/tags/v0.72.0: a7703f2593ba312c0b2dde6fdfd4f5c764bb55ac
155155
refs/tags/v0.73.0: 21241ea8be9439cc5764c4944cdce21d34ce4f9e
156156
refs/tags/v0.74.0: 9d1f733dbbf790de7b494418523b69c4a9a57638
157157
refs/heads/ignoretest: 23c412ae07af3d0ab1caa2d44d5bc5c0ccb8b31d
158-
refs/heads/pubsub-ordering-keys: c8a6062dd4cdd76ee093091e16f56aeeb3ed6827
158+
refs/heads/pubsub-ordering-keys: af8ee562e540eb41301233a186b00ab948d952eb
159159
refs/tags/v0.75.0: c3673089ae09a897c1b4cf7dfe167fe4f8ab32fb
160160
refs/tags/v0.76.0: 395b016826d3ddf9cb8b34919636df15a4dbd032
161161
refs/tags/v0.77.0: 28a85a77883ccf5d48f297fd0ef3b3dca6ce01f0

branches/pubsub-ordering-keys/google-cloud-clients/google-cloud-logging/src/main/java/com/google/cloud/logging/LoggingImpl.java

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@
4444
import com.google.common.collect.Iterables;
4545
import com.google.common.collect.Lists;
4646
import com.google.common.collect.Maps;
47+
import com.google.common.util.concurrent.MoreExecutors;
4748
import com.google.common.util.concurrent.Uninterruptibles;
4849
import com.google.logging.v2.CreateLogMetricRequest;
4950
import com.google.logging.v2.CreateSinkRequest;
@@ -142,7 +143,8 @@ private static <I, O> ApiFuture<O> transform(
142143
public O apply(I i) {
143144
return function.apply(i);
144145
}
145-
});
146+
},
147+
MoreExecutors.directExecutor());
146148
}
147149

148150
private abstract static class BasePageFetcher<T> implements AsyncPageImpl.NextPageFetcher<T> {
@@ -615,7 +617,8 @@ public void onFailure(Throwable t) {
615617
removeFromPending();
616618
}
617619
}
618-
});
620+
},
621+
MoreExecutors.directExecutor());
619622
break;
620623
}
621624
}
@@ -629,7 +632,7 @@ private ApiFuture<Void> writeAsync(Iterable<LogEntry> logEntries, WriteOption...
629632
static ListLogEntriesRequest listLogEntriesRequest(
630633
String projectId, Map<Option.OptionType, ?> options) {
631634
ListLogEntriesRequest.Builder builder = ListLogEntriesRequest.newBuilder();
632-
builder.addProjectIds(projectId);
635+
builder.addResourceNames("projects/" + projectId);
633636
Integer pageSize = PAGE_SIZE.get(options);
634637
if (pageSize != null) {
635638
builder.setPageSize(pageSize);

branches/pubsub-ordering-keys/google-cloud-clients/google-cloud-logging/src/main/java/com/google/cloud/logging/spi/v2/GrpcLoggingRpc.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@
4444
import com.google.cloud.logging.v2.LoggingSettings;
4545
import com.google.cloud.logging.v2.MetricsClient;
4646
import com.google.cloud.logging.v2.MetricsSettings;
47+
import com.google.common.util.concurrent.MoreExecutors;
4748
import com.google.logging.v2.CreateLogMetricRequest;
4849
import com.google.logging.v2.CreateSinkRequest;
4950
import com.google.logging.v2.DeleteLogMetricRequest;
@@ -96,7 +97,7 @@ public GrpcLoggingRpc(final LoggingOptions options) throws IOException {
9697
|| NoCredentials.getInstance().equals(options.getCredentials())) {
9798
ManagedChannel managedChannel =
9899
ManagedChannelBuilder.forTarget(options.getHost())
99-
.usePlaintext(true)
100+
.usePlaintext()
100101
.executor(executor)
101102
.build();
102103
TransportChannel transportChannel = GrpcTransportChannel.create(managedChannel);
@@ -189,7 +190,8 @@ public V apply(ApiException exception) {
189190
}
190191
throw new LoggingException(exception);
191192
}
192-
});
193+
},
194+
MoreExecutors.directExecutor());
193195
}
194196

195197
@Override

branches/pubsub-ordering-keys/google-cloud-clients/google-cloud-logging/src/test/java/com/google/cloud/logging/LoggingImplTest.java

Lines changed: 16 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1293,7 +1293,7 @@ public void testListLogEntries() {
12931293
EasyMock.replay(rpcFactoryMock);
12941294
logging = options.getService();
12951295
ListLogEntriesRequest request =
1296-
ListLogEntriesRequest.newBuilder().addProjectIds(PROJECT).build();
1296+
ListLogEntriesRequest.newBuilder().addResourceNames(PROJECT_PB).build();
12971297
List<LogEntry> entriesList = ImmutableList.of(LOG_ENTRY1, LOG_ENTRY2);
12981298
ListLogEntriesResponse response =
12991299
ListLogEntriesResponse.newBuilder()
@@ -1314,9 +1314,12 @@ public void testListLogEntriesNextPage() throws ExecutionException, InterruptedE
13141314
EasyMock.replay(rpcFactoryMock);
13151315
logging = options.getService();
13161316
ListLogEntriesRequest request1 =
1317-
ListLogEntriesRequest.newBuilder().addProjectIds(PROJECT).build();
1317+
ListLogEntriesRequest.newBuilder().addResourceNames(PROJECT_PB).build();
13181318
ListLogEntriesRequest request2 =
1319-
ListLogEntriesRequest.newBuilder().addProjectIds(PROJECT).setPageToken(cursor1).build();
1319+
ListLogEntriesRequest.newBuilder()
1320+
.addResourceNames(PROJECT_PB)
1321+
.setPageToken(cursor1)
1322+
.build();
13201323
List<LogEntry> descriptorList1 = ImmutableList.of(LOG_ENTRY1, LOG_ENTRY2);
13211324
List<LogEntry> descriptorList2 = ImmutableList.of(LOG_ENTRY1);
13221325
ListLogEntriesResponse response1 =
@@ -1351,7 +1354,7 @@ public void testListLogEntriesEmpty() {
13511354
EasyMock.replay(rpcFactoryMock);
13521355
logging = options.getService();
13531356
ListLogEntriesRequest request =
1354-
ListLogEntriesRequest.newBuilder().addProjectIds(PROJECT).build();
1357+
ListLogEntriesRequest.newBuilder().addResourceNames(PROJECT_PB).build();
13551358
List<LogEntry> entriesList = ImmutableList.of();
13561359
ListLogEntriesResponse response =
13571360
ListLogEntriesResponse.newBuilder()
@@ -1373,7 +1376,7 @@ public void testListLogEntriesWithOptions() {
13731376
logging = options.getService();
13741377
ListLogEntriesRequest request =
13751378
ListLogEntriesRequest.newBuilder()
1376-
.addProjectIds(PROJECT)
1379+
.addResourceNames(PROJECT_PB)
13771380
.setOrderBy("timestamp desc")
13781381
.setFilter("logName:syslog")
13791382
.build();
@@ -1400,7 +1403,7 @@ public void testListLogEntriesAsync() throws ExecutionException, InterruptedExce
14001403
EasyMock.replay(rpcFactoryMock);
14011404
logging = options.getService();
14021405
ListLogEntriesRequest request =
1403-
ListLogEntriesRequest.newBuilder().addProjectIds(PROJECT).build();
1406+
ListLogEntriesRequest.newBuilder().addResourceNames(PROJECT_PB).build();
14041407
List<LogEntry> entriesList = ImmutableList.of(LOG_ENTRY1, LOG_ENTRY2);
14051408
ListLogEntriesResponse response =
14061409
ListLogEntriesResponse.newBuilder()
@@ -1421,9 +1424,12 @@ public void testListLogEntriesAsyncNextPage() {
14211424
EasyMock.replay(rpcFactoryMock);
14221425
logging = options.getService();
14231426
ListLogEntriesRequest request1 =
1424-
ListLogEntriesRequest.newBuilder().addProjectIds(PROJECT).build();
1427+
ListLogEntriesRequest.newBuilder().addResourceNames(PROJECT_PB).build();
14251428
ListLogEntriesRequest request2 =
1426-
ListLogEntriesRequest.newBuilder().addProjectIds(PROJECT).setPageToken(cursor1).build();
1429+
ListLogEntriesRequest.newBuilder()
1430+
.addResourceNames(PROJECT_PB)
1431+
.setPageToken(cursor1)
1432+
.build();
14271433
List<LogEntry> descriptorList1 = ImmutableList.of(LOG_ENTRY1, LOG_ENTRY2);
14281434
List<LogEntry> descriptorList2 = ImmutableList.of(LOG_ENTRY1);
14291435
ListLogEntriesResponse response1 =
@@ -1458,7 +1464,7 @@ public void testListLogEntriesAyncEmpty() throws ExecutionException, Interrupted
14581464
EasyMock.replay(rpcFactoryMock);
14591465
logging = options.getService();
14601466
ListLogEntriesRequest request =
1461-
ListLogEntriesRequest.newBuilder().addProjectIds(PROJECT).build();
1467+
ListLogEntriesRequest.newBuilder().addResourceNames(PROJECT_PB).build();
14621468
List<LogEntry> entriesList = ImmutableList.of();
14631469
ListLogEntriesResponse response =
14641470
ListLogEntriesResponse.newBuilder()
@@ -1480,7 +1486,7 @@ public void testListLogEntriesAsyncWithOptions() throws ExecutionException, Inte
14801486
logging = options.getService();
14811487
ListLogEntriesRequest request =
14821488
ListLogEntriesRequest.newBuilder()
1483-
.addProjectIds(PROJECT)
1489+
.addResourceNames(PROJECT_PB)
14841490
.setOrderBy("timestamp desc")
14851491
.setFilter("logName:syslog")
14861492
.build();

branches/pubsub-ordering-keys/google-cloud-clients/google-cloud-logging/src/test/java/com/google/cloud/logging/v2/testing/LocalLoggingHelper.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ public LocalLoggingImpl getLoggingImpl() {
5151
}
5252
/** Creates a channel for making requests to the in-memory service. */
5353
public ManagedChannel createChannel() {
54-
return InProcessChannelBuilder.forName(address).usePlaintext(true).build();
54+
return InProcessChannelBuilder.forName(address).usePlaintext().build();
5555
}
5656
/** Shuts down the in-memory service. */
5757
public void shutdownNow() {

0 commit comments

Comments
 (0)