Generate a default (fallback) clustering.

@return generated clustering
184750
private Clustering<Model> generateDefaultClustering() {
    final Database db = ResultUtil.findDatabase(hier);
    Clustering<Model> c = null;
    try {
      // Try to cluster by labels
      ByLabelHierarchicalClustering split = new ByLabelHierarchicalClustering();
      c = split.run(db);
    }
    catch(NoSupportedDataTypeException e) {
      // Put everything into one
      c = new TrivialAllInOne().run(db);
    }
    return c;
  }
554718
@Override
	public Clustering getClusteringResult() {
		List<double[]> microClustering;
		// If the buffer phase is active then the buffer (without duplicates) is
		// equal to the micro clustering
		if (this.bufferPhase) {
			microClustering = new ArrayList<double[]>(this.buffer.size());
			for (double[] pointA : this.buffer) {
				// Searches for a duplicate of the current point
				boolean duplicate = false;
				for (double[] pointB : microClustering) {
					int i;
					for (i = 0; i < pointA.length; i++) {
						if (pointA[i] != pointB[i + 1]) {
							break;
						}
					}
					if (i == pointA.length) {
						duplicate = true;
						pointB[0] += 1;
						break;
					}
				}

				if (!duplicate) {
					// Copies the point to an array with the weight in the first
					// element
					double[] pointWeighted = new double[pointA.length + 1];
					pointWeighted[0] = 1;
					System.arraycopy(pointA, 0, pointWeighted, 1, pointA.length);
					microClustering.add(pointWeighted);
				}
			}
		} else {
			// Collects all nodes as arrays with the weight in the first element
			microClustering = this.root
					.addToClusteringCenters(new ArrayList<double[]>(this.rootCount));
		}
		// Runs the k-means algorithm five times on the micro clustering
		List<double[]> result = null;
		double minValue = Double.POSITIVE_INFINITY;
		for (int i = 0; i < 5; i++) {
			// Creates the starting centroids
			List<double[]> newResult = CoresetKMeans
					.generatekMeansPlusPlusCentroids(this.numClusters,
							microClustering, this.clustererRandom);
			// Runs the k-means algorithm with changing the starting centroids
			double newValue = CoresetKMeans.kMeans(newResult, microClustering);
			// Selects the result with minimum costs
			if (newValue < minValue) {
				result = newResult;
				minValue = newValue;
			}
		}

		// Prepares the points for the clustering result
		AutoExpandVector<Cluster> resultClustering = new AutoExpandVector<Cluster>(
				result.size());
		for (double[] point : result) {
			resultClustering.add(new SphereCluster(point, 0.0));
		}
		return new Clustering(resultClustering);
	}
94412
private String getClusterMain() {
    if (clusterMain == null) {
      try {
        clusterMain = System.getProperty(CLUSTER_MAIN_PROPERTY_NAME);
      } catch (Exception e) {
      }
      clusterMain = ClusterAgent.class.getName();
    }
    return clusterMain;
  }
1325021
public Cluster getCluster(final ClusterId clusterId) {
        for(final Cluster cur: clusters)
            if(cur.getClusterId().equals(clusterId))
                return cur;
        return null;
    }
809294
public java.util.List<Cluster> getClusters() {
        if (clusters == null) {
            clusters = new com.amazonaws.internal.SdkInternalList<Cluster>();
        }
        return clusters;
    }
523346
public java.util.List<DBClusterSnapshot> getDBClusterSnapshots() {
        if (dBClusterSnapshots == null) {
            dBClusterSnapshots = new com.amazonaws.internal.SdkInternalList<DBClusterSnapshot>();
        }
        return dBClusterSnapshots;
    }
574985
private Cluster buildClusterSpecs() {
        Cluster.Builder builder = Cluster.builder();
        
        // dbhost
        String dbhost = getParamString("dbhost");
        String[] nodeAddresses = dbhost.split(",");
        for (String address : nodeAddresses) {
            builder.addContactPoint(address);
        }
        
        // dbport
        builder.withPort(getParamInt("dbport", 9042));
        
        // db_timeout_millis and db_connect_retry_wait_millis
        SocketOptions socketOpts = new SocketOptions();
        socketOpts.setReadTimeoutMillis(getParamInt("db_timeout_millis", 10000));
        socketOpts.setConnectTimeoutMillis(getParamInt("db_connect_retry_wait_millis", 5000));
        builder.withSocketOptions(socketOpts);
        
        // dbuser/dbpassword
        String dbuser = getParamString("dbuser");
        if (!Utils.isEmpty(dbuser)) {
            builder.withCredentials(dbuser, getParamString("dbpassword"));
        }
        
        // compression
        builder.withCompression(Compression.SNAPPY);
        
        // TLS/SSL
        if (getParamBoolean("dbtls")) {
            builder.withSSL(getSSLOptions());
        }
        
        return builder.build();
    }
453529
public List<Pair<Subspace, ModifiableDBIDs>> determineClusters() {
    List<Pair<Subspace, ModifiableDBIDs>> clusters = new ArrayList<>();

    for(CLIQUEUnit unit : denseUnits) {
      if(!unit.isAssigned()) {
        ModifiableDBIDs cluster = DBIDUtil.newHashSet();
        CLIQUESubspace model = new CLIQUESubspace(getDimensions());
        clusters.add(new Pair<Subspace, ModifiableDBIDs>(model, cluster));
        dfs(unit, cluster, model);
      }
    }
    return clusters;
  }
953219
public Sort sort() {
        SortField[] partitionKeySort = tokenMapper.sortFields();
        SortField[] clusteringKeySort = clusteringKeyMapper.sortFields();
        return new Sort(ArrayUtils.addAll(partitionKeySort, clusteringKeySort));
    }
712561
@Deprecated
    public Set<InetAddress> clusterNodes() {
        Set<InetAddress> nodes = new HashSet<InetAddress>();
        for (NetworkAddress na : clusterNodes) {
            try {
                nodes.add(InetAddress.getByName(na.address()));
            } catch (UnknownHostException e) {
                throw new IllegalStateException(e);
            }

        }
        return nodes;
    }
1260183
private final int getDefaultIsolationLevel() {
        int defaultIsolationLevel = resRefInfo == null ? Connection.TRANSACTION_NONE : resRefInfo.getIsolationLevel();
        if (defaultIsolationLevel == Connection.TRANSACTION_NONE)
            defaultIsolationLevel = dsConfig.get().isolationLevel;
        if (defaultIsolationLevel == -1)
            defaultIsolationLevel = mcf.getHelper().getDefaultIsolationLevel();
        return defaultIsolationLevel;
    }
430519
private ClusterDasVmSettings createClusterDasVmSettings(String restartPriority) {
        ClusterDasVmSettings clusterDasVmSettings = new ClusterDasVmSettings();
        clusterDasVmSettings.setRestartPriority(restartPriority);
        return clusterDasVmSettings;
    }
696083
protected boolean isHadoopCluster() {
        boolean isHadoopCluster = false;
        try {
            isHadoopCluster = Shell.getHadoopHome() != null;
        } catch (IOException e) {
            // ignore - false is default setting
        }
        return isHadoopCluster;
    }
1191328
@SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        setBorder(javax.swing.BorderFactory.createTitledBorder(null, "Cluster Algorithm Setup", javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, javax.swing.border.TitledBorder.DEFAULT_POSITION, new java.awt.Font("Tahoma", 1, 11))); // NOI18N
        setLayout(new java.awt.GridBagLayout());
    }
566780
public static Cluster getCluster(Config config, Context context) {
    Cluster cluster = null;
    if (config != null && context != null) {
      String clusterName = context.getCluster();
      if (clusterName != null) {
        List<NamedCluster> clusters = config.getClusters();
        if (clusters != null) {
          for (NamedCluster namedCluster : clusters) {
            if (clusterName.equals(namedCluster.getName())) {
              cluster = namedCluster.getCluster();
            }
          }
        }
      }
    }
    return cluster;
  }
1199134
public Clustering addToClustering(Clustering clustering) {
		if (center != null && getClusteringFeature() != null) {
			clustering.add(getClusteringFeature().toCluster());
		}
		for (ClusteringTreeNode child : children) {
			child.addToClustering(clustering);
		}
		return clustering;
	}
1135036
public java.util.List<ClusterVersion> getClusterVersions() {
        if (clusterVersions == null) {
            clusterVersions = new com.amazonaws.internal.SdkInternalList<ClusterVersion>();
        }
        return clusterVersions;
    }