/** Returns the name of the cluster */ public String getClusterName() { return DatabaseDescriptor.getClusterName(); }
/** * Get the embedded cassandra cluster name * * @return the cluster name */ public static String getClusterName() { return DatabaseDescriptor.getClusterName(); }
/** Returns the name of the cluster */ public String getClusterName() { return DatabaseDescriptor.getClusterName(); }
/** * Get the embedded cassandra cluster name * * @return the cluster name */ public static String getClusterName() { return DatabaseDescriptor.getClusterName(); }
/** Returns the name of the cluster */ public String getClusterName() { return DatabaseDescriptor.getClusterName(); }
/** * Get the embedded cassandra cluster name * * @return the cluster name */ public static String getClusterName() { return DatabaseDescriptor.getClusterName(); }
public String describe_cluster_name() throws TException { return DatabaseDescriptor.getClusterName(); }
/** Returns the name of the cluster */ public String getClusterName() { return DatabaseDescriptor.getClusterName(); }
/** * Get the embedded cassandra cluster name. * * @return the cluster name */ public static String getClusterName() { return DatabaseDescriptor.getClusterName(); }
public String describe_cluster_name() throws TException { return DatabaseDescriptor.getClusterName(); }
/** * Get the embedded cassandra cluster name. * * @return the cluster name */ public static String getClusterName() { return DatabaseDescriptor.getClusterName(); }
public String describe_cluster_name() throws TException { return DatabaseDescriptor.getClusterName(); }
public static String getElasticsearchClusterName(Settings settings) { String clusterName = DatabaseDescriptor.getClusterName(); String datacenterGroup = settings.get(ClusterService.SETTING_CLUSTER_DATACENTER_GROUP); if (datacenterGroup != null) { clusterName = DatabaseDescriptor.getClusterName() + "@" + datacenterGroup.trim(); } return clusterName; }
Void insertFirstMetaRow(final MetaData metadata, final String metaDataString) { try { logger.info(insertMetadataQuery); process(ConsistencyLevel.LOCAL_ONE, ClientState.forInternalCalls(), insertMetadataQuery, DatabaseDescriptor.getClusterName(), UUID.fromString(StorageService.instance.getLocalHostId()), metadata.version(), metaDataString); } catch (Exception e) { logger.error((Supplier<?>) () -> new ParameterizedMessage("Failed insert first row into table {}.{}", elasticAdminKeyspaceName, ELASTIC_ADMIN_METADATA_TABLE), e); throw e; } return null; }
public MetaData readInternalMetaDataAsRow() throws NoPersistedMetaDataException { try { UntypedResultSet rs = QueryProcessor.executeInternal(selectMetadataQuery, DatabaseDescriptor.getClusterName()); if (rs != null && !rs.isEmpty()) { Row row = rs.one(); if (row.has("metadata")) return parseMetaDataString(row.getString("metadata")); } } catch (Exception e) { logger.warn("Cannot read metadata locally",e); } return null; }
public Long readMetaDataVersion(ConsistencyLevel cl) throws NoPersistedMetaDataException { try { UntypedResultSet rs = process(cl, ClientState.forInternalCalls(), selectVersionMetadataQuery, DatabaseDescriptor.getClusterName()); if (rs != null && !rs.isEmpty()) { Row row = rs.one(); if (row.has("version")) return row.getLong("version"); } } catch (Exception e) { logger.warn("unexpected error", e); } return -1L; } public static String getElasticsearchClusterName(Settings settings) {
public MetaData readMetaDataAsRow(ConsistencyLevel cl) throws NoPersistedMetaDataException { try { UntypedResultSet rs = process(cl, ClientState.forInternalCalls(), selectMetadataQuery, DatabaseDescriptor.getClusterName()); if (rs != null && !rs.isEmpty()) { Row row = rs.one(); if (row.has("metadata")) return parseMetaDataString(row.getString("metadata")); } } catch (UnavailableException e) { logger.warn("Cannot read metadata with consistency="+cl,e); return null; } catch (KeyspaceNotDefinedException e) { logger.warn("Keyspace {} not yet defined", ELASTIC_ADMIN_KEYSPACE); return null; } catch (Exception e) { throw new NoPersistedMetaDataException("Unexpected error",e); } throw new NoPersistedMetaDataException("Unexpected error"); }
executeOnceInternal(String.format(req, LOCAL), LOCAL, DatabaseDescriptor.getClusterName(), FBUtilities.getReleaseVersionString(), QueryProcessor.CQL_VERSION.toString(),
executeOnceInternal(String.format(req, LOCAL), LOCAL, DatabaseDescriptor.getClusterName(), FBUtilities.getReleaseVersionString(), QueryProcessor.CQL_VERSION.toString(),
public void persistMetaData(MetaData oldMetaData, MetaData newMetaData, String source) throws IOException, InvalidRequestException, RequestExecutionException, RequestValidationException { if (!newMetaData.clusterUUID().equals(localNode().getId())) { logger.error("should not push metadata updated from another node {}/{}", newMetaData.clusterUUID(), newMetaData.version()); return; } if (newMetaData.clusterUUID().equals(state().metaData().clusterUUID()) && newMetaData.version() < state().metaData().version()) { logger.warn("don't push obsolete metadata uuid={} version {} < {}", newMetaData.clusterUUID(), newMetaData.version(), state().metaData().version()); return; } String metaDataString = MetaData.Builder.toXContent(newMetaData, MetaData.CASSANDRA_FORMAT_PARAMS); UUID owner = UUID.fromString(localNode().getId()); boolean applied = processWriteConditional( this.metadataWriteCL, this.metadataSerialCL, ClientState.forInternalCalls(), updateMetaDataQuery, new Object[] { owner, newMetaData.version(), metaDataString, DatabaseDescriptor.getClusterName(), newMetaData.version() }); if (applied) { logger.debug("PAXOS Succefully update metadata source={} newMetaData={} in cluster {}", source, metaDataString, DatabaseDescriptor.getClusterName()); writeMetaDataAsComment(metaDataString, newMetaData.version()); return; } else { logger.warn("PAXOS Failed to update metadata oldMetadata={}/{} currentMetaData={}/{} in cluster {}", oldMetaData.clusterUUID(), oldMetaData.version(), localNode().getId(), newMetaData.version(), DatabaseDescriptor.getClusterName()); throw new ConcurrentMetaDataUpdateException(owner, newMetaData.version()); } }