Added allocator-related RntbdTransportClient.Options

This commit is contained in:
David.Noble@microsoft.com 2019-07-17 01:46:29 -07:00
Родитель 4ee69c0f05
Коммит 805261b476
1 изменённых файлов: 10 добавлений и 0 удалений

Просмотреть файл

@ -91,6 +91,10 @@ public interface RntbdEndpoint extends AutoCloseable {
return this.allocator; return this.allocator;
} }
public int bufferPageSize() {
return this.options.bufferPageSize();
}
public int connectionTimeout() { public int connectionTimeout() {
final long value = this.options.connectionTimeout().toMillis(); final long value = this.options.connectionTimeout().toMillis();
assert value <= Integer.MAX_VALUE; assert value <= Integer.MAX_VALUE;
@ -101,6 +105,10 @@ public interface RntbdEndpoint extends AutoCloseable {
return this.options.idleTimeout().toNanos(); return this.options.idleTimeout().toNanos();
} }
public int maxBufferCapacity() {
return this.options.maxBufferCapacity();
}
public int maxChannelsPerEndpoint() { public int maxChannelsPerEndpoint() {
return this.options.maxChannelsPerEndpoint(); return this.options.maxChannelsPerEndpoint();
} }
@ -151,8 +159,10 @@ public interface RntbdEndpoint extends AutoCloseable {
@Override @Override
public void serialize(Config value, JsonGenerator generator, SerializerProvider provider) throws IOException { public void serialize(Config value, JsonGenerator generator, SerializerProvider provider) throws IOException {
generator.writeStartObject(); generator.writeStartObject();
generator.writeNumberField("bufferPageSize", value.bufferPageSize());
generator.writeNumberField("connectionTimeout", value.connectionTimeout()); generator.writeNumberField("connectionTimeout", value.connectionTimeout());
generator.writeNumberField("idleConnectionTimeout", value.idleConnectionTimeout()); generator.writeNumberField("idleConnectionTimeout", value.idleConnectionTimeout());
generator.writeNumberField("maxBufferCapacity", value.maxBufferCapacity());
generator.writeNumberField("maxChannelPerEndpoint", value.maxChannelsPerEndpoint()); generator.writeNumberField("maxChannelPerEndpoint", value.maxChannelsPerEndpoint());
generator.writeNumberField("maxRequestsPerChannel", value.maxChannelsPerEndpoint()); generator.writeNumberField("maxRequestsPerChannel", value.maxChannelsPerEndpoint());
generator.writeNumberField("receiveHangDetectionTime", value.receiveHangDetectionTime()); generator.writeNumberField("receiveHangDetectionTime", value.receiveHangDetectionTime());