brooklyn-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ahgittin <...@git.apache.org>
Subject [GitHub] incubator-brooklyn pull request: Brooklyn node and cluster upgrade
Date Mon, 27 Oct 2014 17:03:07 GMT
Github user ahgittin commented on a diff in the pull request:

    https://github.com/apache/incubator-brooklyn/pull/272#discussion_r19419115
  
    --- Diff: software/base/src/main/java/brooklyn/entity/brooklynnode/BrooklynClusterImpl.java
---
    @@ -0,0 +1,119 @@
    +/*
    + * Licensed to the Apache Software Foundation (ASF) under one
    + * or more contributor license agreements.  See the NOTICE file
    + * distributed with this work for additional information
    + * regarding copyright ownership.  The ASF licenses this file
    + * to you under the Apache License, Version 2.0 (the
    + * "License"); you may not use this file except in compliance
    + * with the License.  You may obtain a copy of the License at
    + *
    + *     http://www.apache.org/licenses/LICENSE-2.0
    + *
    + * Unless required by applicable law or agreed to in writing,
    + * software distributed under the License is distributed on an
    + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
    + * KIND, either express or implied.  See the License for the
    + * specific language governing permissions and limitations
    + * under the License.
    + */
    +package brooklyn.entity.brooklynnode;
    +
    +import java.util.Collection;
    +import java.util.concurrent.Callable;
    +
    +import org.slf4j.Logger;
    +import org.slf4j.LoggerFactory;
    +
    +import brooklyn.enricher.Enrichers;
    +import brooklyn.entity.Entity;
    +import brooklyn.entity.basic.EntityFunctions;
    +import brooklyn.entity.basic.EntityPredicates;
    +import brooklyn.entity.basic.ServiceStateLogic;
    +import brooklyn.entity.basic.ServiceStateLogic.ServiceProblemsLogic;
    +import brooklyn.entity.brooklynnode.effector.BrooklynClusterUpgradeEffectorBody;
    +import brooklyn.entity.brooklynnode.effector.SelectMasterEffectorBody;
    +import brooklyn.entity.group.DynamicClusterImpl;
    +import brooklyn.event.feed.function.FunctionFeed;
    +import brooklyn.event.feed.function.FunctionPollConfig;
    +import brooklyn.management.ha.ManagementNodeState;
    +import brooklyn.util.time.Duration;
    +
    +import com.google.common.collect.FluentIterable;
    +import com.google.common.collect.Iterables;
    +
    +public class BrooklynClusterImpl extends DynamicClusterImpl implements BrooklynCluster
{
    +
    +    private static final String MSG_NO_MASTER = "No master node in cluster";
    +    private static final String MSG_TOO_MANY_MASTERS = "Too many master nodes in cluster";
    +
    +    private static final Logger LOG = LoggerFactory.getLogger(BrooklynClusterImpl.class);
    +
    +    // TODO should we set a default MEMBER_SPEC ?  difficult though because we'd need
to set a password
    +
    +    @SuppressWarnings("unused")
    +    private FunctionFeed scanMaster;
    +
    +    @Override
    +    public void init() {
    +        super.init();
    +        getMutableEntityType().addEffector(SelectMasterEffectorBody.SELECT_MASTER);
    +        getMutableEntityType().addEffector(BrooklynClusterUpgradeEffectorBody.UPGRADE_CLUSTER);
    +
    +        ServiceProblemsLogic.updateProblemsIndicator(this, MASTER_NODE, MSG_NO_MASTER);
    +        scanMaster = FunctionFeed.builder()
    --- End diff --
    
    i think you're right.  there is a feature enablement which controls whether `FunctionFeed.setEntity`
does the `addFeed` call but it defaults to false.  i think i vote in favour of the API adding
it explicitly, as is done for enrichers etc.  (but for true API parity we'd have `Spec` classes.)
 wdyt?
    
    without this it will work the first time but will not get updated on rebind.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

Mime
View raw message