Das method creates a cluster vm setting.

@param restartPriority
@return
430519
private ClusterDasVmSettings createClusterDasVmSettings(String restartPriority) {
        ClusterDasVmSettings clusterDasVmSettings = new ClusterDasVmSettings();
        clusterDasVmSettings.setRestartPriority(restartPriority);
        return clusterDasVmSettings;
    }
205484
@SuppressWarnings("WeakerAccess")
  public ApiFuture<Cluster> getClusterAsync(String instanceId, String clusterId) {
    String name = NameUtil.formatClusterName(projectId, instanceId, clusterId);

    com.google.bigtable.admin.v2.GetClusterRequest request =
        com.google.bigtable.admin.v2.GetClusterRequest.newBuilder().setName(name).build();

    return ApiFutures.transform(
        stub.getClusterCallable().futureCall(request),
        new ApiFunction<com.google.bigtable.admin.v2.Cluster, Cluster>() {
          @Override
          public Cluster apply(com.google.bigtable.admin.v2.Cluster proto) {
            return Cluster.fromProto(proto);
          }
        },
        MoreExecutors.directExecutor());
  }
408906
private boolean preCheckClusterState(ClusterService clusterService) {
        ClusterState initialState = clusterService.getClusterState();
        if (!initialState.isJoinAllowed()) {
            logger.warning("Could not prepare cluster state since it has been changed to " + initialState);
            return false;
        }

        return true;
    }
211301
@VisibleForTesting
  void restartTopologyHandler(String topologyName) throws TopologyRuntimeManagementException {
    assert !potentialStaleExecutionData;
    Integer containerId = Context.topologyContainerId(config);
    Scheduler.RestartTopologyRequest restartTopologyRequest =
        Scheduler.RestartTopologyRequest.newBuilder()
            .setTopologyName(topologyName)
            .setContainerIndex(containerId)
            .build();
    // If we restart the container including TMaster, wee need to clean TMasterLocation,
    // since when starting up, TMaster expects no other existing TMaster,
    // i.e. TMasterLocation does not exist
    if (containerId == -1 || containerId == 0) {
      // get the instance of state manager to clean state
      SchedulerStateManagerAdaptor stateManager = Runtime.schedulerStateManagerAdaptor(runtime);
      Boolean result = stateManager.deleteTMasterLocation(topologyName);
      if (result == null || !result) {
        throw new TopologyRuntimeManagementException(
            "Failed to clear TMaster location. Check whether TMaster set it correctly.");
      }
    }

    if (!schedulerClient.restartTopology(restartTopologyRequest)) {
      throw new TopologyRuntimeManagementException(String.format(
          "Failed to restart topology '%s'", topologyName));
    }
    // Clean the connection when we are done.
    LOG.fine("Scheduler restarted topology successfully.");
  }
1097160
def start_cluster_server(self, num_gpus=1, rdma=False):
    """"""
    return TFNode.start_cluster_server(self, num_gpus, rdma)
121456
static synchronized boolean restartSingleton(CloudWatchMetricConfig config) {
        if (singleton == null) {
            throw new IllegalStateException(MetricCollectorSupport.class.getSimpleName()
                + " has neven been initialized");
        }
        log.info("Re-initializing " + MetricCollectorSupport.class.getSimpleName());
        singleton.stop();
        // singleton is set to null at this point via the stop method
        return createAndStartCollector(config);
    }
904997
public long allocAppend(long cluster)
            throws IOException {
        
        testCluster(cluster);
        
        while (!isEofCluster(entries[(int) cluster])) {
            cluster = entries[(int) cluster];
        }
        
        long newCluster = allocNew();
        entries[(int) cluster] = newCluster;

        return newCluster;
    }
1169754
public void setClusterVersions(java.util.Collection<ClusterVersion> clusterVersions) {
        if (clusterVersions == null) {
            this.clusterVersions = null;
            return;
        }

        this.clusterVersions = new com.amazonaws.internal.SdkInternalList<ClusterVersion>(clusterVersions);
    }
735882
@SuppressWarnings("checkstyle:MissingSwitchDefault")
    private PriorityQueue<CrawlCandidate> createPriorityQueue() {
        Function crawlDepthGetter
                = (Function<CrawlCandidate, Integer> & Serializable) CrawlCandidate::getCrawlDepth;
        Function priorityGetter
                = (Function<CrawlCandidate, Integer> & Serializable) CrawlCandidate::getPriority;

        switch (config.getCrawlStrategy()) {
            case BREADTH_FIRST:
                Comparator breadthFirstComparator = Comparator.comparing(crawlDepthGetter)
                        .thenComparing(priorityGetter, Comparator.reverseOrder());

                return new PriorityQueue<>(breadthFirstComparator);
            case DEPTH_FIRST:
                Comparator depthFirstComparator
                        = Comparator.comparing(crawlDepthGetter, Comparator.reverseOrder())
                                .thenComparing(priorityGetter, Comparator.reverseOrder());

                return new PriorityQueue<>(depthFirstComparator);
        }

        throw new IllegalArgumentException("Unsupported crawl strategy.");
    }
1099685
private long restartInternal(long oldExecutionId,
                                 Properties restartParameters) throws JobExecutionAlreadyCompleteException, NoSuchJobExecutionException, JobExecutionNotMostRecentException, JobRestartException, JobSecurityException {

        if (authService != null) {
            authService.authorizedJobRestartByExecution(oldExecutionId);
        }

        if (logger.isLoggable(Level.FINE)) {
            logger.fine("JobOperator restart, with old executionId = " + oldExecutionId + "\n" + traceJobParameters(restartParameters));
        }

        //Check if there are no job executions and step executions running.
        BatchStatusValidator.validateStatusAtExecutionRestart(oldExecutionId, restartParameters);
        //Set instance state to submitted to be consistent with start
        long instanceId = getPersistenceManagerService().getJobInstanceIdFromExecutionId(oldExecutionId);
        getPersistenceManagerService().updateJobInstanceOnRestart(instanceId, new Date());

        WSJobExecution jobExecution = getPersistenceManagerService().createJobExecution(instanceId, restartParameters, new Date());
        long newExecutionId = getBatchKernelService().restartJob(jobExecution.getExecutionId(), restartParameters).getKey();

        if (logger.isLoggable(Level.FINE)) {
            logger.fine("Restarted job with new executionId: " + newExecutionId + ", and old executionID: " + oldExecutionId);
        }

        return newExecutionId;
    }
644585
public void setPriority(SessionPriority prio) throws IOException {
    if (failException != null) {
      throw failException;
    }

    sessionInfo.priority = prio;

    SessionInfo newInfo = new SessionInfo(sessionInfo);
    cmNotifier.addCall(
        new ClusterManagerService.sessionUpdateInfo_args(sessionId, newInfo));
  }
51776
public ClusterInfo getClusterInfoOrNull() {
        String clusterName = getProperty(InternalConfigurationOptions.INTERNAL_ES_CLUSTER_NAME);
        if (clusterName == null) {
            return null;
        }
        String clusterUUID = getProperty(InternalConfigurationOptions.INTERNAL_ES_CLUSTER_UUID);
        EsMajorVersion version = getInternalVersionOrThrow();
        return new ClusterInfo(new ClusterName(clusterName, clusterUUID), version);
    }
557538
public static RedisClusterManager newInstance(String host, int port, String password) {
        return newInstance(buildRedisConfig(host, port, password));
    }
1096055
public Config createPrimaryRuntime(TopologyAPI.Topology topology) {
    return Config.newBuilder()
        .put(Key.TOPOLOGY_ID, topology.getId())
        .put(Key.TOPOLOGY_NAME, topology.getName())
        .put(Key.TOPOLOGY_DEFINITION, topology)
        .put(Key.NUM_CONTAINERS, 1 + TopologyUtils.getNumContainers(topology))
        .build();
  }
224394
def create(name, num_cache_nodes=None, engine=None, cache_node_type=None,
           replication_group_id=None, engine_version=None,
           cache_parameter_group_name=None, cache_subnet_group_name=None,
           cache_security_group_names=None, security_group_ids=None,
           snapshot_arns=None, preferred_availability_zone=None,
           preferred_maintenance_window=None, port=None,
           notification_topic_arn=None, auto_minor_version_upgrade=None,
           wait=None, region=None, key=None, keyid=None, profile=None):
    '''
    
    '''
    conn = _get_conn(region=region, key=key, keyid=keyid, profile=profile)

    try:
        conn.create_cache_cluster(
            name, num_cache_nodes, cache_node_type, engine,
            replication_group_id, engine_version, cache_parameter_group_name,
            cache_subnet_group_name, cache_security_group_names,
            security_group_ids, snapshot_arns, preferred_availability_zone,
            preferred_maintenance_window, port, notification_topic_arn,
            auto_minor_version_upgrade)
        if not wait:
            log.info('Created cache cluster %s.', name)
            return True
        while True:
            time.sleep(3)
            config = get_config(name, region, key, keyid, profile)
            if not config:
                return True
            if config['cache_cluster_status'] == 'available':
                return True
        log.info('Created cache cluster %s.', name)
    except boto.exception.BotoServerError as e:
        msg = 'Failed to create cache cluster {0}.'.format(name)
        log.error(msg)
        log.debug(e)
        return False
602397
def create_minimal_scaleio_cluster(self, mdmPassword, liaPassword):
        
        """
        self.read_cluster_config_from_disk("minimal-cluster.json")
        #self._cluster_config_cached.setMdmPassword(setMdmPassword)
        #self._cluster_config_cached.setLiaPassword(setLiaPassword)
        self.push_cached_cluster_configuration(setMdmPassword, setLiaPassword)
        """
        
        ###########################
        # Create a ScaleIO System #
        ###########################
        # Flow:
        # Create Nodes
        # Create basic info. mdmPass, liaPass and some others
        # Construct MDM and TB and basic info
        # Create list of SDS
        # Create list of SDC
        
        
        ###################
        # Construct nodes #
        ###################
        nodeUsername = 'root'
        nodePassword = 'password'
        #node1 = ScaleIO_Node_Object(None, None, ['192.168.102.11'], None, 'linux', nodePassword, nodeUsername)
        #node2 = ScaleIO_Node_Object(None, None, ['192.168.102.12'], None, 'linux', nodePassword, nodeUsername)
        #node3 = ScaleIO_Node_Object(None, None, ['192.168.102.13'], None, 'linux', nodePassword, nodeUsername)
        node1 = ScaleIO_Node_Object(None, None, ['192.168.100.101'], None, 'linux', nodePassword, nodeUsername)
        node2 = ScaleIO_Node_Object(None, None, ['192.168.100.102'], None, 'linux', nodePassword, nodeUsername)
        node3 = ScaleIO_Node_Object(None, None, ['192.168.100.103'], None, 'linux', nodePassword, nodeUsername)
        print "Node Object:"
        pprint (node1.to_JSON())
        pprint (node2.to_JSON())
        pprint (node2.to_JSON())
        print ""
            
        ##########################################
        # Construct basic info for System_Object #
        ##########################################
        mdmIPs = ['192.168.100.101','192.168.100.102']
        sdcList = []
        sdsList = []
        #mdmPassword = 'Scaleio123'
        #liaPassword = 'Scaleio123'
        licenseKey = None
        installationId = None
     
        ########################################
        # Create MDMs and TB for System_Object #
        ########################################
        primaryMdm = Mdm_Object(json.loads(node2.to_JSON()), None, None, node2.nodeIPs) # WHY ISNT ManagementIPs pupulated???? Its not in a working config either. mdmIPs need to be populated though
        secondaryMdm = Mdm_Object(json.loads(node3.to_JSON()), None, None, node3.nodeIPs)
        tb = Tb_Object(json.loads(node1.to_JSON()), None, node1.nodeIPs)
        callHomeConfiguration = None # {'callHomeConfiguration':'None'}
        remoteSyslogConfiguration = None # {'remoteSysogConfiguration':'None'}
        
        ################################################################
        #Create SDS objects - To be added to SDS list in System_Object #
        ################################################################
        sds1 = Sds_Object(json.loads(node1.to_JSON()), None, 'SDS_' + str(node1.nodeIPs[0]), 'default', None, node1.nodeIPs, None, None, None, False, '7072')
        sds1.addDevice("/dev/sdb", None, None)
        sds2 = Sds_Object(json.loads(node2.to_JSON()), None, 'SDS_' + str(node2.nodeIPs[0]), 'default', None, node2.nodeIPs, None, None, None, False, '7072')
        sds2.addDevice("/dev/sdb", None, None)
        sds3 = Sds_Object(json.loads(node3.to_JSON()), None, 'SDS_' + str(node3.nodeIPs[0]), 'default', None, node3.nodeIPs, None, None, None, False, '7072')
        sds3.addDevice("/dev/sdb", None, None)
        sdsList.append(json.loads(sds1.to_JSON()))
        sdsList.append(json.loads(sds2.to_JSON()))
        sdsList.append(json.loads(sds3.to_JSON()))
        print "sdsList:"
        pprint (sdsList)
    
        #############################################################
        # Create SDC objects - To be added as list to System_Object #
        #############################################################
        """
        node=None,
        nodeInfo=None,
        splitterRpaIp=None
        """
        sdc1 = Sdc_Object(json.loads(node1.to_JSON()), None, None)
        sdc2 = Sdc_Object(json.loads(node2.to_JSON()), None, None)
        sdc3 = Sdc_Object(json.loads(node3.to_JSON()), None, None)
        
        sdcList.append(json.loads(sdc1.to_JSON()))
        sdcList.append(json.loads(sdc2.to_JSON()))
        sdcList.append(json.loads(sdc3.to_JSON()))
        
        ######################################################
        # Construct a complete ScaleIO cluster configuration #
        ######################################################
        sioobj = ScaleIO_System_Object(installationId,
                                       mdmIPs,
                                       mdmPassword,
                                       liaPassword,
                                       licenseKey,
                                       json.loads(primaryMdm.to_JSON()),
                                       json.loads(secondaryMdm.to_JSON()),
                                       json.loads(tb.to_JSON()),
                                       sdsList,
                                       sdcList,
                                       callHomeConfiguration,
                                       remoteSyslogConfiguration
                                       )
    
        # Export sioobj to JSON (should upload clean in IM)
        

        ###########################################################################
        # Push System_Object JSON - To be used by IM to install ScaleIO on nodes #
        ###########################################################################
        #pprint (sioobj.to_JSON())
        self._cluster_config_cached = sioobj.to_JSON() # PUSH CONFIGURATION INTO CONFIGURATION CACHE
        self._cache_contains_uncommitted= False # New config pushed into cache - Nothing oncommitted
        self.push_cluster_configuration(self._cluster_config_cached)
799700
public void buildCluster(String secured) {
        if (secured == null) {
            this.cluster = Cluster.builder().addContactPoint(this.host).build();
            this.cluster.getConfiguration().getQueryOptions()
                    .setConsistencyLevel(ConsistencyLevel.ONE);
        } else {
            try {
                this.cluster = Cluster.builder().addContactPoint(this.host).withCredentials("user", "pass").withSSL().build();
            } catch (Exception e) {
                e.printStackTrace();
            }
        }
    }