-
Notifications
You must be signed in to change notification settings - Fork 588
HDDS-10685. Short circuit read support in Ozone #7236
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -39,6 +39,51 @@ public class OzoneClientConfig { | |||||
| private static final Logger LOG = | ||||||
| LoggerFactory.getLogger(OzoneClientConfig.class); | ||||||
|
|
||||||
| public static final String OZONE_READ_SHORT_CIRCUIT = "ozone.client.read.short-circuit"; | ||||||
| public static final boolean OZONE_READ_SHORT_CIRCUIT_DEFAULT = false; | ||||||
| public static final String OZONE_DOMAIN_SOCKET_PATH = "ozone.domain.socket.path"; | ||||||
| public static final String OZONE_DOMAIN_SOCKET_PATH_DEFAULT = "/var/lib/ozone/dn_socket"; | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We need to document this property somewhere.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I plan to add a document about this feature. Will explain all these new properties there. |
||||||
| public static final String SHORT_CIRCUIT_PREFIX = "read.short-circuit."; | ||||||
| public static final int DATA_TRANSFER_VERSION = 28; | ||||||
|
|
||||||
| @Config(key = "read.short-circuit", | ||||||
| defaultValue = "false", | ||||||
| type = ConfigType.BOOLEAN, | ||||||
| description = "Whether read short-circuit is enabled or not", | ||||||
| tags = { ConfigTag.CLIENT, ConfigTag.DATANODE }) | ||||||
| private boolean shortCircuitEnabled = OZONE_READ_SHORT_CIRCUIT_DEFAULT; | ||||||
|
|
||||||
| @Config(key = SHORT_CIRCUIT_PREFIX + "buffer.size", | ||||||
| defaultValue = "128KB", | ||||||
| type = ConfigType.SIZE, | ||||||
| description = "Buffer size of reader/writer.", | ||||||
| tags = { ConfigTag.CLIENT, ConfigTag.DATANODE }) | ||||||
| private int shortCircuitBufferSize = 128 * 1024; | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. just curious to know how the default value is determined. The HDFS "dfs.client.read.shortcircuit.buffer.size" which is similar, is 1MB in size.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The short-circuit channel only exchange getBlock request and response. The value is determined by how big will a request and a response of a 256MB block size, 4MB chunk size, 16KB checksum size block. The request is round 500 bytes, and the response is around |
||||||
|
|
||||||
| @Config(key = SHORT_CIRCUIT_PREFIX + "disable.interval", | ||||||
| defaultValue = "600", | ||||||
| type = ConfigType.LONG, | ||||||
| description = "If some unknown IO error happens on Domain socket read, short circuit read will be disabled " + | ||||||
| "temporary for this period of time(seconds).", | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. typo
Suggested change
|
||||||
| tags = { ConfigTag.CLIENT }) | ||||||
| private long shortCircuitReadDisableInterval = 60 * 10; | ||||||
|
|
||||||
| public long getShortCircuitReadDisableInterval() { | ||||||
| return shortCircuitReadDisableInterval; | ||||||
| } | ||||||
|
|
||||||
| public void setShortCircuitReadDisableInterval(long value) { | ||||||
| shortCircuitReadDisableInterval = value; | ||||||
| } | ||||||
|
|
||||||
| public int getShortCircuitBufferSize() { | ||||||
| return shortCircuitBufferSize; | ||||||
| } | ||||||
|
|
||||||
| public void setShortCircuitBufferSize(int size) { | ||||||
| this.shortCircuitBufferSize = size; | ||||||
| } | ||||||
|
|
||||||
| /** | ||||||
| * Enum for indicating what mode to use when combining chunk and block | ||||||
| * checksums to define an aggregate FileChecksum. This should be considered | ||||||
|
|
@@ -558,4 +603,12 @@ public void setMaxConcurrentWritePerKey(int maxConcurrentWritePerKey) { | |||||
| public int getMaxConcurrentWritePerKey() { | ||||||
| return this.maxConcurrentWritePerKey; | ||||||
| } | ||||||
|
|
||||||
| public boolean isShortCircuitEnabled() { | ||||||
| return shortCircuitEnabled; | ||||||
| } | ||||||
|
|
||||||
| public void setShortCircuit(boolean enabled) { | ||||||
| shortCircuitEnabled = enabled; | ||||||
| } | ||||||
| } | ||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i believe this is redundant; See: shortCircuitEnabled.