[
https://issues.apache.org/jira/browse/KYLIN-3061?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16290352#comment-16290352
]
peng.jianhua edited comment on KYLIN-3061 at 12/14/17 5:32 AM:
---------------------------------------------------------------
Hi [~Zhixiong Chen], I viewed the function 'getFilterObjectListByOrFilterVal'
in utils.js, maybe it will not fit for me, because I find the object in array
'cluster.brokers' is a bit different from the object 'cluster.newBroker', as
follow.
the object in array 'cluster.brokers' is like:
{code:java}
{id: 2, host: "10.10.10.3", port: 33}
{code}
When you add a new broke, the object cluster.newBroker is like:
{code:java}
host:"22"
id:"2"
port:"222"
{code}
You can find the different place is the data type of parameter 'id', one is
interger, the other is string, The reason for this phenomenon is that the array
coming from the kylin server have been delt with javabean, and the new broker
comes from the web input whose type is text, so I had added one function
'$scope.isIDExistentInArray', and use double '=' to compare the parameter 'id',
not to use triple '='.
was (Author: peng.jianhua):
Hi [~Zhixiong Chen], I viewed the function 'getFilterObjectListByOrFilterVal'
in utils.js, maybe it will not fit for me, because I find the object in array
'cluster.brokers' is a bit different from the object 'cluster.newBroker', as
follow.
the object in array 'cluster.brokers' is like:
{code:java}
{id: 2, host: "10.10.10.3", port: 33}
{code}
When you add a new broke, the object cluster.newBroker is like:
{code:java}
host:"22"
id:"2"
port:"222"
{code}
You can find the different place is the data type of parameter 'id', one is
interger, the other is string, so I had added one function
'$scope.isIDExistentInArray', and use double '=' to compare the parameter 'id',
not to use triple '='.
> When we cancel the Topic modification for 'Kafka Setting' of streaming table,
> the 'Cancel' operation will make a mistake.
> -------------------------------------------------------------------------------------------------------------------------
>
> Key: KYLIN-3061
> URL: https://issues.apache.org/jira/browse/KYLIN-3061
> Project: Kylin
> Issue Type: Bug
> Components: Web
> Affects Versions: v2.3.0
> Reporter: peng.jianhua
> Assignee: peng.jianhua
> Labels: patch
> Attachments:
> 0001-KYLIN-3061-When-we-cancel-the-Topic-modification-for.patch, MG140.jpeg,
> MG141.jpeg, MG146.jpeg, after_repaired.png, can_add_the_same_record.png,
> cancel_is_not_right.png, edit_kafka_setting.png, edit_streaming_table.png
>
>
> There are two bugs in this issue.
> First
> 1. Choose one streaming table, choose the 'Streaming Cluster' tab, then click
> 'Edit' button, refer to [^edit_streaming_table.png]
> 2. The edit page will be opened, then you can edit the value of topic of
> 'Kafka Setting'. As long as you modify the ID, Host, Port value, the original
> value tag will follow changes, refer to [^edit_kafka_setting.png];
> 3. When you click 'cancel' button, you will find the old values have been
> changed to the new values, and if you click the 'submit' button, you will
> also find the values to be canceled will be submitted, refer to
> [^cancel_is_not_right.png]
> But I think the correct way should be that 'cancel' button will not change
> any value.
> Second
> The follow code in streamingConfig.js has a bug, even if "cluster.newBroker"
> object matchs the one element of "cluster.brokers" array, this "if" decision
> will return false. Because even though the "cluster.newBroker" object has the
> same attribute values as an element in the array, their storage addresses may
> be different. The result is that you can add several same record, like
> [^can_add_the_same_record.png].
> {code:java}
> $scope.saveNewBroker = function(cluster) {
> if (cluster.brokers.indexOf(cluster.newBroker) === -1) {
> ......
> }
> }
> {code}
> So I have repaired these two bugs, please check the patch, thanks!
--
This message was sent by Atlassian JIRA
(v6.4.14#64029)