/** * Get embedded cassandra host. * * @return the cassandra host */ public static String getHost() { return DatabaseDescriptor.getRpcAddress().getHostName(); }
/** * Get embedded cassandra host. * * @return the cassandra host */ public static String getHost() { return DatabaseDescriptor.getRpcAddress().getHostName(); }
/** * Get embedded cassandra host. * * @return the cassandra host */ public static String getHost() { return DatabaseDescriptor.getRpcAddress().getHostName(); }
/** * Get embedded cassandra host. * * @return the cassandra host */ public static String getHost() { return DatabaseDescriptor.getRpcAddress().getHostName(); }
/** * Get embedded cassandra host. * * @return the cassandra host */ public static String getHost() { return DatabaseDescriptor.getRpcAddress().getHostName(); }
public static InetAddress getBroadcastRpcAddress() { if (broadcastRpcAddress == null) broadcastRpcAddress = DatabaseDescriptor.getBroadcastRpcAddress() == null ? DatabaseDescriptor.getRpcAddress() : DatabaseDescriptor.getBroadcastRpcAddress(); return broadcastRpcAddress; }
public static InetAddress getBroadcastRpcAddress() { if (broadcastRpcAddress == null) broadcastRpcAddress = DatabaseDescriptor.getBroadcastRpcAddress() == null ? DatabaseDescriptor.getRpcAddress() : DatabaseDescriptor.getBroadcastRpcAddress(); return broadcastRpcAddress; }
public static InetAddress getBroadcastRpcAddress() { if (broadcastRpcAddress == null) broadcastRpcAddress = DatabaseDescriptor.getBroadcastRpcAddress() == null ? DatabaseDescriptor.getRpcAddress() : DatabaseDescriptor.getBroadcastRpcAddress(); return broadcastRpcAddress; }
public static InetAddress getBroadcastRpcAddress() { if (broadcastRpcAddress == null) broadcastRpcAddress = DatabaseDescriptor.getBroadcastRpcAddress() == null ? DatabaseDescriptor.getRpcAddress() : DatabaseDescriptor.getBroadcastRpcAddress(); return broadcastRpcAddress; }
@Override public ConditionOutcome getMatchOutcome(ConditionContext context, AnnotatedTypeMetadata metadata) { return (DatabaseDescriptor.isDaemonInitialized() && DatabaseDescriptor.getRpcAddress() != null) ? ConditionOutcome.match() : ConditionOutcome.noMatch("Cassandra Daemon is not initialized."); } }
public Settings nodeSettings(Settings settings) { return Settings.builder() // overloadable settings from elasticsearch.yml // by default, HTTP is bound to C* rpc address, Transport is bound to C* internal listen address. .put("network.bind_host", DatabaseDescriptor.getRpcAddress().getHostAddress()) .put("network.publish_host", FBUtilities.getBroadcastRpcAddress().getHostAddress()) .put("transport.bind_host", FBUtilities.getLocalAddress().getHostAddress()) .put("transport.publish_host", FBUtilities.getBroadcastAddress().getHostAddress()) .put("path.data",getElasticsearchDataDir()) .put(settings) // not overloadable settings. .put("discovery.type","cassandra") .put("node.data",true) .put("node.master",true) .put("node.name", CassandraDiscovery.buildNodeName(DatabaseDescriptor.getListenAddress())) .put("node.attr.dc", DatabaseDescriptor.getLocalDataCenter()) .put("node.attr.rack", DatabaseDescriptor.getEndpointSnitch().getRack(FBUtilities.getBroadcastAddress())) .put("cluster.name", ClusterService.getElasticsearchClusterName(env.settings())) .build(); }
private static void dropKeyspaces() { String host = DatabaseDescriptor.getRpcAddress().getHostName(); int port = DatabaseDescriptor.getRpcPort(); log.debug("Cleaning cassandra keyspaces on " + host + ":" + port); Cluster cluster = HFactory.getOrCreateCluster("TestCluster", new CassandraHostConfigurator(host + ":" + port)); /* get all keyspace */ List<KeyspaceDefinition> keyspaces = cluster.describeKeyspaces(); /* drop all keyspace except internal cassandra keyspace */ for (KeyspaceDefinition keyspaceDefinition : keyspaces) { String keyspaceName = keyspaceDefinition.getName(); if (!INTERNAL_CASSANDRA_KEYSPACE.equals(keyspaceName)) { cluster.dropKeyspace(keyspaceName); } } }
private static void dropKeyspaces() { String host = DatabaseDescriptor.getRpcAddress().getHostName(); int port = DatabaseDescriptor.getRpcPort(); log.debug("Cleaning cassandra keyspaces on " + host + ":" + port); Cluster cluster = HFactory.getOrCreateCluster("TestCluster", new CassandraHostConfigurator(host + ":" + port)); /* get all keyspace */ List<KeyspaceDefinition> keyspaces = cluster.describeKeyspaces(); /* drop all keyspace except internal cassandra keyspace */ for (KeyspaceDefinition keyspaceDefinition : keyspaces) { String keyspaceName = keyspaceDefinition.getName(); if (!INTERNAL_CASSANDRA_KEYSPACE.equals(keyspaceName)) { cluster.dropKeyspace(keyspaceName); } } }
@Bean @Order(0) @Conditional(CassandraDaemonCondition.class) public ClusterBuilderCustomizer cassandraDaemonClusterBuilderCustomizer() { return builder -> { InetAddress rpcAddress = DatabaseDescriptor.getRpcAddress(); int port = DatabaseDescriptor.getNativeTransportPort(); builder.addContactPoints(rpcAddress).withPort(port); if (DatabaseDescriptor.getClientEncryptionOptions().enabled) { int sslPort = DatabaseDescriptor.getNativeTransportPortSSL(); if (sslPort == port) { builder.withSSL(); } } }; }
private static void setupVersion() { String req = "INSERT INTO system.%s (key, release_version, cql_version, thrift_version, native_protocol_version, data_center, rack, partitioner, rpc_address, broadcast_address, listen_address) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)"; IEndpointSnitch snitch = DatabaseDescriptor.getEndpointSnitch(); executeOnceInternal(String.format(req, LOCAL_CF), LOCAL_KEY, FBUtilities.getReleaseVersionString(), QueryProcessor.CQL_VERSION.toString(), cassandraConstants.VERSION, String.valueOf(Server.CURRENT_VERSION), snitch.getDatacenter(FBUtilities.getBroadcastAddress()), snitch.getRack(FBUtilities.getBroadcastAddress()), DatabaseDescriptor.getPartitioner().getClass().getName(), DatabaseDescriptor.getRpcAddress(), FBUtilities.getBroadcastAddress(), FBUtilities.getLocalAddress()); }
private static void dropKeyspaces() { String host = DatabaseDescriptor.getRpcAddress().getHostName(); int port = DatabaseDescriptor.getNativeTransportPort(); try (com.datastax.driver.core.Cluster cluster = com.datastax.driver.core.Cluster.builder().addContactPoint(host) .withPort(port).build(); com.datastax.driver.core.Session session = cluster.connect()) { List<String> keyspaces = new ArrayList<String>(); for (com.datastax.driver.core.KeyspaceMetadata keyspace : cluster.getMetadata().getKeyspaces()) { if (!isSystemKeyspaceName(keyspace.getName())) { keyspaces.add(keyspace.getName()); } } for (String keyspace : keyspaces) { session.execute("DROP KEYSPACE " + keyspace); } } }
private static void dropKeyspaces() { String host = DatabaseDescriptor.getRpcAddress().getHostName(); int port = DatabaseDescriptor.getNativeTransportPort(); try (com.datastax.driver.core.Cluster cluster = com.datastax.driver.core.Cluster.builder().addContactPoint(host) .withPort(port).build(); com.datastax.driver.core.Session session = cluster.connect()) { List<String> keyspaces = new ArrayList<String>(); for (com.datastax.driver.core.KeyspaceMetadata keyspace : cluster.getMetadata().getKeyspaces()) { if (!isSystemKeyspaceName(keyspace.getName())) { keyspaces.add(keyspace.getName()); } } for (String keyspace : keyspaces) { session.execute("DROP KEYSPACE " + keyspace); } } }
snitch.getRack(FBUtilities.getBroadcastAddress()), DatabaseDescriptor.getPartitioner().getClass().getName(), DatabaseDescriptor.getRpcAddress(), FBUtilities.getBroadcastAddress(), FBUtilities.getLocalAddress());
snitch.getRack(FBUtilities.getBroadcastAddress()), DatabaseDescriptor.getPartitioner().getClass().getName(), DatabaseDescriptor.getRpcAddress(), FBUtilities.getBroadcastAddress(), FBUtilities.getLocalAddress());
snitch.getRack(FBUtilities.getBroadcastAddress()), DatabaseDescriptor.getPartitioner().getClass().getName(), DatabaseDescriptor.getRpcAddress(), FBUtilities.getBroadcastAddress(), FBUtilities.getLocalAddress());