[
https://issues.jboss.org/browse/JBIDE-15766?page=com.atlassian.jira.plugi...
]
Andre Dietisheim edited comment on JBIDE-15766 at 10/24/13 6:36 AM:
--------------------------------------------------------------------
[~mwigglesworth-redhat] very valid concerns, did not think about them when rushing for the
rest of the UI, thanks for fiddling this out.
But thinking this API through a 2nd time I pretend that the whole backend API is broken.
The general rule of thumb is that you need the diff to be done as close as possible to the
peer that stores it. Having to do the diff in the remote client is imho the worst possible
solution, it requires the client to constantly refresh while not gaining any significant
guarantee, just increasing likelyhood. The constant refreshing also forces the user
program (a UI or any other) to also constantly update it's env vars.
My personal opinion is that - also given the normal pattern of explicit refreshes we have
- we should not refresh constantly. We could eventually refresh when there's an error,
sticking to the explicit refresh.
On the long run we should IMHO ask the OpenShift team to change this API and switch to an
API where we submit the whole map of vars at once, letting the backend fiddling out what
operations are required (removal, addition, update)
was (Author: adietish):
[~mwigglesworth-redhat] very valid concerns, did not think about them when rushing for
the rest of the UI. But thinking this API through a 2nd time I pretend that the whole
backend API is broken. The general rule of thumb is that you need the diff to be done as
close as possible to the peer that stores it. Having to do the diff in the remote client
is imho the worst possible solution, it requires the client to constantly refresh while
not gaining any significant guarantee, just increasing likelyhood. The constant refreshing
also forces the user program (a UI or any other) to also constantly update it's env
vars.
My personal opinion is that - also given the normal pattern of explicit refreshes we have
- we should not refresh constantly. We could eventually refresh when there's an error,
sticking to the explicit refresh.
openshift-java-client: dont refresh env variables on each
addition/removal
--------------------------------------------------------------------------
Key: JBIDE-15766
URL:
https://issues.jboss.org/browse/JBIDE-15766
Project: Tools (JBoss Tools)
Issue Type: Bug
Components: openshift
Affects Versions: 4.1.1.Beta1, 4.2.0.Alpha1
Reporter: Andre Dietisheim
Assignee: Andre Dietisheim
Fix For: 4.1.1.Beta1, 4.2.0.Alpha1
When adding/removing environment variables, the openshift-java-client would always
request the backend for the full list. This should not be required and avoided
{code:title=ApplicationResource#addEnvironmentVariable}
EnvironmentVariableResourceDTO environmentVariableResourceDTO =
new AddEnvironmentVariableRequest().execute(name, value);
IEnvironmentVariable environmentVariable = new
EnvironmentVariableResource(environmentVariableResourceDTO, this);
updateEnvironmentVariables();
return environmentVariable;
{code}
{code:title=ApplicationResource#updateEnvironmentVariables}
protected void updateEnvironmentVariables() throws OpenShiftException {
if (environmentVariableByName == null) {
environmentVariableByName = loadEnvironmentVariables();
} else {
environmentVariableByName.clear();
environmentVariableByName.putAll(loadEnvironmentVariables());
}
}
{code}
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see:
http://www.atlassian.com/software/jira