Skip to content

Commit b109595

Browse files
authored
core: move Instrumented, LogId, WithLogId to io.grpc.internal as public (grpc#3995)
1 parent 2a93e6b commit b109595

28 files changed

+65
-175
lines changed

core/src/main/java/io/grpc/InternalInstrumented.java

Lines changed: 0 additions & 24 deletions
This file was deleted.

core/src/main/java/io/grpc/InternalLogId.java

Lines changed: 0 additions & 37 deletions
This file was deleted.

core/src/main/java/io/grpc/InternalWithLogId.java

Lines changed: 0 additions & 28 deletions
This file was deleted.

core/src/main/java/io/grpc/inprocess/InProcessTransport.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@
2626
import io.grpc.Decompressor;
2727
import io.grpc.DecompressorRegistry;
2828
import io.grpc.Grpc;
29-
import io.grpc.InternalLogId;
3029
import io.grpc.InternalTransportStats;
3130
import io.grpc.Metadata;
3231
import io.grpc.MethodDescriptor;
@@ -36,6 +35,7 @@
3635
import io.grpc.internal.ClientStreamListener;
3736
import io.grpc.internal.ConnectionClientTransport;
3837
import io.grpc.internal.GrpcUtil;
38+
import io.grpc.internal.LogId;
3939
import io.grpc.internal.ManagedClientTransport;
4040
import io.grpc.internal.NoopClientStream;
4141
import io.grpc.internal.ObjectPool;
@@ -64,7 +64,7 @@
6464
final class InProcessTransport implements ServerTransport, ConnectionClientTransport {
6565
private static final Logger log = Logger.getLogger(InProcessTransport.class.getName());
6666

67-
private final InternalLogId logId = InternalLogId.allocate(getClass().getName());
67+
private final LogId logId = LogId.allocate(getClass().getName());
6868
private final String name;
6969
private final String authority;
7070
private final String userAgent;
@@ -210,7 +210,7 @@ public String toString() {
210210
}
211211

212212
@Override
213-
public InternalLogId getLogId() {
213+
public LogId getLogId() {
214214
return logId;
215215
}
216216

core/src/main/java/io/grpc/internal/AbstractSubchannel.java

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,6 @@
1717
package io.grpc.internal;
1818

1919
import io.grpc.InternalChannelStats;
20-
import io.grpc.InternalInstrumented;
21-
import io.grpc.InternalLogId;
2220
import io.grpc.LoadBalancer;
2321
import javax.annotation.Nullable;
2422

@@ -27,8 +25,8 @@
2725
* io.grpc.LoadBalancer.Helper#createSubchannel}.
2826
*/
2927
abstract class AbstractSubchannel extends LoadBalancer.Subchannel
30-
implements InternalInstrumented<InternalChannelStats> {
31-
private final InternalLogId logId = InternalLogId.allocate(getClass().getName());
28+
implements Instrumented<InternalChannelStats> {
29+
private final LogId logId = LogId.allocate(getClass().getName());
3230

3331
/**
3432
* Same as {@link InternalSubchannel#obtainActiveTransport}.
@@ -37,7 +35,7 @@ abstract class AbstractSubchannel extends LoadBalancer.Subchannel
3735
abstract ClientTransport obtainActiveTransport();
3836

3937
@Override
40-
public InternalLogId getLogId() {
38+
public LogId getLogId() {
4139
return logId;
4240
}
4341
}

core/src/main/java/io/grpc/internal/ClientTransport.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@
1717
package io.grpc.internal;
1818

1919
import io.grpc.CallOptions;
20-
import io.grpc.InternalInstrumented;
2120
import io.grpc.InternalTransportStats;
2221
import io.grpc.Metadata;
2322
import io.grpc.MethodDescriptor;
@@ -31,7 +30,7 @@
3130
* are expected to execute quickly.
3231
*/
3332
@ThreadSafe
34-
public interface ClientTransport extends InternalInstrumented<InternalTransportStats> {
33+
public interface ClientTransport extends Instrumented<InternalTransportStats> {
3534

3635
/**
3736
* Creates a new stream for sending messages to a remote end-point.

core/src/main/java/io/grpc/internal/DelayedClientTransport.java

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@
2121
import com.google.common.util.concurrent.SettableFuture;
2222
import io.grpc.CallOptions;
2323
import io.grpc.Context;
24-
import io.grpc.InternalLogId;
2524
import io.grpc.InternalTransportStats;
2625
import io.grpc.LoadBalancer.PickResult;
2726
import io.grpc.LoadBalancer.PickSubchannelArgs;
@@ -48,7 +47,7 @@
4847
* thus the delayed transport stops owning the stream.
4948
*/
5049
final class DelayedClientTransport implements ManagedClientTransport {
51-
private final InternalLogId lodId = InternalLogId.allocate(getClass().getName());
50+
private final LogId lodId = LogId.allocate(getClass().getName());
5251

5352
private final Object lock = new Object();
5453

@@ -338,7 +337,7 @@ public void run() {
338337

339338
// TODO(carl-mastrangelo): remove this once the Subchannel change is in.
340339
@Override
341-
public InternalLogId getLogId() {
340+
public LogId getLogId() {
342341
return lodId;
343342
}
344343

core/src/main/java/io/grpc/internal/FailingClientTransport.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@
2121
import com.google.common.util.concurrent.ListenableFuture;
2222
import com.google.common.util.concurrent.SettableFuture;
2323
import io.grpc.CallOptions;
24-
import io.grpc.InternalLogId;
2524
import io.grpc.InternalTransportStats;
2625
import io.grpc.Metadata;
2726
import io.grpc.MethodDescriptor;
@@ -63,7 +62,7 @@ public ListenableFuture<InternalTransportStats> getStats() {
6362
}
6463

6564
@Override
66-
public InternalLogId getLogId() {
65+
public LogId getLogId() {
6766
throw new UnsupportedOperationException("Not a real transport");
6867
}
6968
}

core/src/main/java/io/grpc/internal/ForwardingConnectionClientTransport.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@
1919
import com.google.common.util.concurrent.ListenableFuture;
2020
import io.grpc.Attributes;
2121
import io.grpc.CallOptions;
22-
import io.grpc.InternalLogId;
2322
import io.grpc.InternalTransportStats;
2423
import io.grpc.Metadata;
2524
import io.grpc.MethodDescriptor;
@@ -54,7 +53,7 @@ public void ping(PingCallback callback, Executor executor) {
5453
}
5554

5655
@Override
57-
public InternalLogId getLogId() {
56+
public LogId getLogId() {
5857
return delegate().getLogId();
5958
}
6059

core/src/main/java/io/grpc/internal/GrpcUtil.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@
2929
import com.google.common.util.concurrent.ThreadFactoryBuilder;
3030
import io.grpc.CallOptions;
3131
import io.grpc.ClientStreamTracer;
32-
import io.grpc.InternalLogId;
3332
import io.grpc.InternalMetadata;
3433
import io.grpc.InternalMetadata.TrustedAsciiMarshaller;
3534
import io.grpc.InternalTransportStats;
@@ -684,7 +683,7 @@ public void ping(PingCallback callback, Executor executor) {
684683
}
685684

686685
@Override
687-
public InternalLogId getLogId() {
686+
public LogId getLogId() {
688687
return transport.getLogId();
689688
}
690689

0 commit comments

Comments
 (0)