Initializes the local node and the local cloud with itself as the only member.
354277
private static void startLocalNode() {
    // Figure self out; this is surprisingly hard
    NetworkInit.initializeNetworkSockets();

    // Do not forget to put SELF into the static configuration (to simulate proper multicast behavior)
    if ( !ARGS.client && H2O.isFlatfileEnabled() && !H2O.isNodeInFlatfile(SELF)) {
      Log.warn("Flatfile configuration does not include self: " + SELF + ", but contains " + H2O.getFlatfile());
      H2O.addNodeToFlatfile(SELF);
    }

    Log.info("H2O cloud name: '" + ARGS.name + "' on " + SELF +
            (H2O.isFlatfileEnabled()
                    ? (", discovery address " + CLOUD_MULTICAST_GROUP + ":" + CLOUD_MULTICAST_PORT)
                    : ", static configuration based on -flatfile " + ARGS.flatfile));

    if (!H2O.ARGS.disable_web) {
      Log.info("If you have trouble connecting, try SSH tunneling from your local machine (e.g., via port 55555):\n" +
              "  1. Open a terminal and run 'ssh -L 55555:localhost:"
              + API_PORT + " " + System.getProperty("user.name") + "@" + SELF_ADDRESS.getHostAddress() + "'\n" +
              "  2. Point your browser to " + NetworkInit.h2oHttpView.getScheme() + "://localhost:55555");
    }

    // Create the starter Cloud with 1 member
    SELF._heartbeat._jar_md5 = JarHash.JARHASH;
    SELF._heartbeat._client = ARGS.client;
    SELF._heartbeat._cloud_name_hash = ARGS.name.hashCode();
  }
379123
public function initialize()
    {
        $this->initializeConnections();
        $this->_table and $this->setSource($this->_table);
        $this->keepSnapshots(true);
    }
190901
public void init() {
        this.session.getAgenda().getAgendaGroup( "register neighbor" ).setFocus();
        this.session.fireAllRules();
        this.session.getAgenda().getAgendaGroup( "calculate" ).clear();
    }
1195809
function () {
        var vertex = this.get('vertex');
        this._super();

        // Initialize data members
        this.setProperties({
          id: vertex.get('vertexName') + this.get('name'),
          depth: vertex.get('depth') + 1
        });
      }
1259417
@PostConstruct
  public void initialize() {

    if (this.initializationState.setInitializing()) {
      if (this.visibility == null) {
        this.visibility = VisibilityModifier.PUBLIC;
      }
      this.initializationState.setInitialized();
    }
  }
1116742
@PostConstruct
    public void init() throws Exception {

        if (hosts == null) {
            throw new IllegalArgumentException("Hosts property not set ");
        }

        determineHostsAsProperty();

        /**
         * quick fix for integration tests. if hosts property set to "embedded" then a local node is start.
         * maven dependencies need to be defined correctly for this to work
         */

        if (hosts.startsWith("embedded")) {
            synchronized (SYNC) {
                if (node == null) {
                    node = new ElasticsearchEmbeddedNode();
                }
            }
            client = node.getClient();
        } else {
            String[] hostsArray = hosts.split(",");
            Settings settings = ImmutableSettings.settingsBuilder().put("cluster.name", cluster).build();
            client = new TransportClient(settings);

            for (String aHostsArray : hostsArray) {
                String s = aHostsArray.trim();
                String[] host = s.split(":");

                if (log.isLoggable(Level.FINE)) {
                    log.fine(" Connecting to elasticsearch host. [" + host[0] + ":" + host[1] + "]");
                }

                client = ((TransportClient)client).addTransportAddress(new InetSocketTransportAddress(host[0],
                        new Integer(host[1])));
            }
        }
    }
725508
@PostConstruct
  public void initialize() {

    if (this.pojoDescriptorBuilderFactory == null) {
      this.pojoDescriptorBuilderFactory = PojoDescriptorBuilderFactoryImpl.getInstance();
    }
    if (this.pojoDescriptorBuilder == null) {
      this.pojoDescriptorBuilder = this.pojoDescriptorBuilderFactory.createPrivateFieldDescriptorBuilder();
    }
    this.descriptor = this.pojoDescriptorBuilder.getDescriptor(EntityTo.class);
  }
216305
public function initRelation()
    {
        switch ($this->direction)
        {
            case 'in':
                // Make them nodes
                $this->start = $this->asNode($this->related);
                $this->end   = $this->asNode($this->parent);
                // Setup relationship
                $this->relation = $this->makeRelationship($this->type, $this->relation, $this->parent, $this->attributes);
            break;

            case 'out':
                // Make them nodes
                $this->start = $this->asNode($this->parent);
                $this->end   = $this->asNode($this->related);
                // Setup relationship
                $this->relation = $this->makeRelationship($this->type, $this->parent, $this->related, $this->attributes);
            break;

            default:
                throw new NoEdgeDirectionException;
            break;
        }
    }
143516
function init(pluginInterface) {
    pi = pluginInterface;
    log = pi.log;
    localStorage = pi.localStorage;
}
1073083
protected function Init()
    {
        $this->member = new Member(Request::GetData('member'));
        $this->groupsExist = Membergroup::Schema()->Count() > 0;
        $this->AddNameField();
        $this->AddEMailField();
        $this->AddPasswordField();
        $this->AddMemberGroupField();
        $this->AddSubmit();
        return parent::Init();
    }
606138
private function initialize()
    {
        if ($this->isInitialized()) {
            return;
        }

        if (!$this->nodes) {
            throw new EmptyRingException('Cannot initialize an empty hashring.');
        }

        $this->ring = array();
        $totalWeight = $this->computeTotalWeight();
        $nodesCount = count($this->nodes);

        foreach ($this->nodes as $node) {
            $weightRatio = $node['weight'] / $totalWeight;
            $this->addNodeToRing($this->ring, $node, $nodesCount, $this->replicas, $weightRatio);
        }

        ksort($this->ring, SORT_NUMERIC);
        $this->ringKeys = array_keys($this->ring);
        $this->ringKeysCount = count($this->ringKeys);
    }
1075696
private Node createNewMembershipTypeNode(Session session, MembershipTypeImpl mType) throws Exception
   {
      Node storageTypesNode = utils.getMembershipTypeStorageNode(session);
      return storageTypesNode.addNode(mType.getName());
   }
294203
public void initalizeTreeState()
    {
        _lastNodeExpandedImage = IMAGE_NODE_EXPAND_LAST;
        _nodeExpandedImage = IMAGE_NODE_EXPAND;
        _lastNodeCollapsedImage = IMAGE_NODE_COLLAPSE_LAST;
        _nodeCollapsedImage = IMAGE_NODE_COLLAPSE;
        _lastLineJoinImage = IMAGE_LINE_JOIN_LAST;
        _lineJoinImage = IMAGE_LINE_JOIN;
        _verticalLineImage = IMAGE_LINE_VERTICAL;
        _imageSpacer = IMAGE_SPACER;
        _defaultIcon = DEFAULT_ICON;
        _imageRoot = null;

        _selectionAction = null;
        _expansionAction = null;
    }
404093
public void init ()
    {
        if (_initers == null) {
            log.warning("Refusing repeat init() request.");
            return;
        }

        ObserverList<InitComponent> list = _initers.toObserverList();
        _initers = null;
        list.apply(new ObserverList.ObserverOp<InitComponent>() {
            public boolean apply (InitComponent comp) {
                log.debug("Initializing component", "comp", comp);
                comp.init();
                return true;
            }
        });
    }
950767
private void initLocalFSM() {
        this.localFSM = new FSM(this.name + "_LOCAL");

        // Define states
        this.localFSM.createState(AsState.DOWN.toString()).setOnEnter(new SEHLocalAsStateEnterDown(this));
        this.localFSM.createState(AsState.ACTIVE.toString()).setOnEnter(new SEHLocalAsStateEnterActive(this));
        this.localFSM.createState(AsState.INACTIVE.toString()).setOnEnter(new SEHLocalAsStateEnterInactive(this));
        this.localFSM.createState(AsState.PENDING.toString()).setOnTimeOut(new RemAsStatePenTimeout(this, this.localFSM), 2000)
                .setOnEnter(new SEHLocalAsStateEnterPen(this, this.localFSM));

        this.localFSM.setStart(AsState.DOWN.toString());
        this.localFSM.setEnd(AsState.DOWN.toString());
        // Define Transitions

        // ******************************************************************/
        // STATE DOWN /
        // ******************************************************************/
        this.localFSM.createTransition(TransitionState.ASP_UP, AsState.DOWN.toString(), AsState.INACTIVE.toString())
                .setHandler(new THLocalAsDwnToInact(this, this.localFSM));
        this.localFSM.createTransition(TransitionState.ASP_DOWN, AsState.DOWN.toString(), AsState.DOWN.toString());

        // ******************************************************************/
        // STATE INACTIVE /
        // ******************************************************************/
        // TODO : Add Pluggable policy for AS?
        this.localFSM.createTransition(TransitionState.ASP_ACTIVE, AsState.INACTIVE.toString(), AsState.ACTIVE.toString())
                .setHandler(new THLocalAsInactToAct(this, this.localFSM));

        this.localFSM.createTransition(TransitionState.ASP_DOWN, AsState.INACTIVE.toString(), AsState.DOWN.toString())
                .setHandler(new THLocalAsInactToDwn(this, this.localFSM));

        this.localFSM.createTransition(TransitionState.ASP_UP, AsState.INACTIVE.toString(), AsState.INACTIVE.toString())
                .setHandler(new THLocalAsInactToInact(this, this.localFSM));

        // ******************************************************************/
        // STATE ACTIVE /
        // ******************************************************************/
        this.localFSM.createTransition(TransitionState.ASP_INACTIVE, AsState.ACTIVE.toString(), AsState.PENDING.toString())
                .setHandler(new THLocalAsActToPendRemAspInac(this, this.localFSM));

        this.localFSM.createTransition(TransitionState.ASP_DOWN, AsState.ACTIVE.toString(), AsState.PENDING.toString())
                .setHandler(new THLocalAsActToPendRemAspDwn(this, this.localFSM));

        this.localFSM.createTransition(TransitionState.ASP_ACTIVE, AsState.ACTIVE.toString(), AsState.ACTIVE.toString())
                .setHandler(new THLocalAsActToActRemAspAct(this, this.localFSM));

        this.localFSM.createTransition(TransitionState.ASP_UP, AsState.ACTIVE.toString(), AsState.PENDING.toString())
                .setHandler(new THLocalAsActToPendRemAspInac(this, this.localFSM));

        // ******************************************************************/
        // STATE PENDING /
        // ******************************************************************/
        this.localFSM.createTransition(TransitionState.ASP_DOWN, AsState.PENDING.toString(), AsState.DOWN.toString())
                .setHandler(new THNoTrans());

        this.localFSM.createTransition(TransitionState.ASP_UP, AsState.PENDING.toString(), AsState.INACTIVE.toString())
                .setHandler(new THNoTrans());

        this.localFSM.createTransition(TransitionState.ASP_ACTIVE, AsState.PENDING.toString(), AsState.ACTIVE.toString())
                .setHandler(new THLocalAsPendToAct(this, this.localFSM));

        this.localFSM.createTransition(TransitionState.AS_DOWN, AsState.PENDING.toString(), AsState.DOWN.toString());
        this.localFSM.createTransition(TransitionState.AS_INACTIVE, AsState.PENDING.toString(), AsState.INACTIVE.toString());
    }
769132
@Override
    public void init()
    {
        this.log.debug("Initializing the chaining uberspector.");
        // Create the chain
        // TODO Since we're in Plexus already, should we use components?
        String[] chainClassnames = this.runtime.getConfiguration().getStringArray(UBERSPECT_CHAIN_CLASSNAMES);
        for (String classname : chainClassnames) {
            initializeUberspector(classname);
        }
        // If the chain is empty, use a SecureUberspector
        if (this.inner == null) {
            this.log.error("No chained uberspectors defined! "
                + "This uberspector is just a placeholder that relies on a real uberspector "
                + "to actually allow method calls. Using SecureUberspect instead as a fallback.");
            initializeUberspector(SecureUberspector.class.getCanonicalName());
        }
        // Initialize all the uberspectors in the chain
        try {
            this.inner.init();
        } catch (Exception e) {
            this.log.warn(e.getMessage());
        }
    }
27884
private void init(InetSocketAddress namenodeAddress) throws IOException {
    this.namenodeAddress = namenodeAddress;
    this.myMetrics = new BalancerMetrics(conf, namenodeAddress);
    this.fetchBlocksSize = conf.getLong(BalancerConfigKeys.DFS_BALANCER_FETCH_SIZE_KEY,
        BalancerConfigKeys.DFS_BALANCER_FETCH_SIZE_DEFAULT);
    this.minBlockReplicas = conf.getInt(BalancerConfigKeys.DFS_BALANCER_MIN_REPLICAS_KEY,
        BalancerConfigKeys.DFS_BALANCER_MIN_REPLICAS_DEFAULT);
    this.maxFetchCount = conf.getInt(BalancerConfigKeys.DFS_BALANCER_FETCH_COUNT_KEY,
        BalancerConfigKeys.DFS_BALANCER_FETCH_COUNT_DEFAULT);
    initFS();
    initNameNodes();
    this.moverExecutor = Executors.newFixedThreadPool(moveThreads);
    int dispatchThreads = (int)Math.max(1, moveThreads/maxConcurrentMoves);
    this.dispatcherExecutor = Executors.newFixedThreadPool(dispatchThreads);
    /* Check if there is another balancer running.
     * Exit if there is another one running.
     */
    this.out = checkAndMarkRunningBalancer();
    if (out == null) {
      throw new IOException("Another balancer is running");
    }
    // get namespace id
    LocatedBlocksWithMetaInfo locations = client.openAndFetchMetaInfo(BALANCER_ID_PATH.toString(), 0L, 1L);
    this.namespaceId = locations.getNamespaceID();
  }