You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@ozone.apache.org by "ASF GitHub Bot (Jira)" <ji...@apache.org> on 2020/01/22 14:36:00 UTC
[jira] [Updated] (HDDS-2927) Cache EndPoint tasks instead of
creating them all the time
[ https://issues.apache.org/jira/browse/HDDS-2927?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
ASF GitHub Bot updated HDDS-2927:
---------------------------------
Labels: pull-request-available (was: )
> Cache EndPoint tasks instead of creating them all the time
> ----------------------------------------------------------
>
> Key: HDDS-2927
> URL: https://issues.apache.org/jira/browse/HDDS-2927
> Project: Hadoop Distributed Data Store
> Issue Type: Improvement
> Reporter: Yiqun Lin
> Assignee: Yiqun Lin
> Priority: Minor
> Labels: pull-request-available
>
> Currently, we create EndPoint tasks all the time. This is an inefficient way, we could cache these task as TODO comment suggested.
> {code}
> //TODO : Cache some of these tasks instead of creating them
> //all the time.
> private Callable<EndpointStateMachine.EndPointStates>
> getEndPointTask(EndpointStateMachine endpoint) {
> switch (endpoint.getState()) {
> case GETVERSION:
> return new VersionEndpointTask(endpoint, conf, context.getParent()
> .getContainer());
> case REGISTER:
> return RegisterEndpointTask.newBuilder()
> .setConfig(conf)
> .setEndpointStateMachine(endpoint)
> .setContext(context)
> .setDatanodeDetails(context.getParent().getDatanodeDetails())
> .setOzoneContainer(context.getParent().getContainer())
> .build();
> case HEARTBEAT:
> return HeartbeatEndpointTask.newBuilder()
> .setConfig(conf)
> .setEndpointStateMachine(endpoint)
> .setDatanodeDetails(context.getParent().getDatanodeDetails())
> .setContext(context)
> .build();
> case SHUTDOWN:
> break;
> default:
> throw new IllegalArgumentException("Illegal Argument.");
> }
> return null;
> }
> {code}
--
This message was sent by Atlassian Jira
(v8.3.4#803005)
---------------------------------------------------------------------
To unsubscribe, e-mail: ozone-issues-unsubscribe@hadoop.apache.org
For additional commands, e-mail: ozone-issues-help@hadoop.apache.org