private boolean hasRemoteNode(List<InetAddress> l) { String localDc = DatabaseDescriptor.getLocalDataCenter(); for (InetAddress ep : l) { if (!localDc.equals(getDatacenter(ep))) return true; } return false; } }
private boolean hasRemoteNode(List<InetAddress> l) { String localDc = DatabaseDescriptor.getLocalDataCenter(); for (InetAddress ep : l) { if (!localDc.equals(getDatacenter(ep))) return true; } return false; } }
private boolean hasRemoteNode(List<InetAddress> l) { String localDc = DatabaseDescriptor.getLocalDataCenter(); for (InetAddress ep : l) { if (!localDc.equals(getDatacenter(ep))) return true; } return false; } }
private boolean hasRemoteNode(List<InetAddress> l) { String localDc = DatabaseDescriptor.getLocalDataCenter(); for (InetAddress ep : l) { if (!localDc.equals(getDatacenter(ep))) return true; } return false; } }
public int getLocalDataCenterSize() { int count = 1; for (UntypedResultSet.Row row : executeInternal("SELECT data_center, rpc_address FROM system." + SystemKeyspace.PEERS)) if (row.has("rpc_address") && DatabaseDescriptor.getLocalDataCenter().equals(row.getString("data_center"))) count++; logger.info(" datacenter=[{}] size={} from peers", DatabaseDescriptor.getLocalDataCenter(), count); return count; }
public boolean isLocal(InetAddress endpoint) { return DatabaseDescriptor.getLocalDataCenter().equals(DatabaseDescriptor.getEndpointSnitch().getDatacenter(endpoint)); }
public boolean isLocal(InetAddress endpoint) { return DatabaseDescriptor.getLocalDataCenter().equals(DatabaseDescriptor.getEndpointSnitch().getDatacenter(endpoint)); }
/** * @return true if the message counts towards the blockfor threshold */ private boolean waitingFor(MessageIn message) { return consistencyLevel.isDatacenterLocal() ? DatabaseDescriptor.getLocalDataCenter().equals(DatabaseDescriptor.getEndpointSnitch().getDatacenter(message.from)) : true; }
private FutureTask<Object> createRepairTask(final int cmd, final String keyspace, final RepairOption options, boolean legacy) { if (!options.getDataCenters().isEmpty() && !options.getDataCenters().contains(DatabaseDescriptor.getLocalDataCenter())) { throw new IllegalArgumentException("the local data center must be part of the repair"); } RepairRunnable task = new RepairRunnable(this, cmd, options, keyspace); task.addProgressListener(progressSupport); if (legacy) task.addProgressListener(legacyProgressSupport); return new FutureTask<>(task, null); }
/** * @return true if the message counts towards the blockfor threshold */ private boolean waitingFor(InetAddress from) { return consistencyLevel.isDatacenterLocal() ? DatabaseDescriptor.getLocalDataCenter().equals(DatabaseDescriptor.getEndpointSnitch().getDatacenter(from)) : true; }
/** * @return true if the message counts towards the blockfor threshold */ private boolean waitingFor(InetAddress from) { return consistencyLevel.isDatacenterLocal() ? DatabaseDescriptor.getLocalDataCenter().equals(DatabaseDescriptor.getEndpointSnitch().getDatacenter(from)) : true; }
/** * @return true if the message counts towards the blockfor threshold */ private boolean waitingFor(InetAddress from) { return consistencyLevel.isDatacenterLocal() ? DatabaseDescriptor.getLocalDataCenter().equals(DatabaseDescriptor.getEndpointSnitch().getDatacenter(from)) : true; }
private FutureTask<Object> createRepairTask(final int cmd, final String keyspace, final RepairOption options, boolean legacy) { if (!options.getDataCenters().isEmpty() && !options.getDataCenters().contains(DatabaseDescriptor.getLocalDataCenter())) { throw new IllegalArgumentException("the local data center must be part of the repair"); } RepairRunnable task = new RepairRunnable(this, cmd, options, keyspace); task.addProgressListener(progressSupport); if (legacy) task.addProgressListener(legacyProgressSupport); return new FutureTask<>(task, null); }
private FutureTask<Object> createRepairTask(final int cmd, final String keyspace, final RepairOption options, boolean legacy) { if (!options.getDataCenters().isEmpty() && !options.getDataCenters().contains(DatabaseDescriptor.getLocalDataCenter())) { throw new IllegalArgumentException("the local data center must be part of the repair"); } RepairRunnable task = new RepairRunnable(this, cmd, options, keyspace); task.addProgressListener(progressSupport); if (legacy) task.addProgressListener(legacyProgressSupport); return new FutureTask<>(task, null); }
public StreamRateLimiter(InetAddress peer) { double throughput = DatabaseDescriptor.getStreamThroughputOutboundMegabitsPerSec() * BYTES_PER_MEGABIT; mayUpdateThroughput(throughput, limiter); double interDCThroughput = DatabaseDescriptor.getInterDCStreamThroughputOutboundMegabitsPerSec() * BYTES_PER_MEGABIT; mayUpdateThroughput(interDCThroughput, interDCLimiter); if (DatabaseDescriptor.getLocalDataCenter() != null && DatabaseDescriptor.getEndpointSnitch() != null) isLocalDC = DatabaseDescriptor.getLocalDataCenter().equals( DatabaseDescriptor.getEndpointSnitch().getDatacenter(peer)); else isLocalDC = true; }
public StreamRateLimiter(InetAddress peer) { double throughput = DatabaseDescriptor.getStreamThroughputOutboundMegabitsPerSec() * BYTES_PER_MEGABIT; mayUpdateThroughput(throughput, limiter); double interDCThroughput = DatabaseDescriptor.getInterDCStreamThroughputOutboundMegabitsPerSec() * BYTES_PER_MEGABIT; mayUpdateThroughput(interDCThroughput, interDCLimiter); if (DatabaseDescriptor.getLocalDataCenter() != null && DatabaseDescriptor.getEndpointSnitch() != null) isLocalDC = DatabaseDescriptor.getLocalDataCenter().equals( DatabaseDescriptor.getEndpointSnitch().getDatacenter(peer)); else isLocalDC = true; }
public StreamRateLimiter(InetAddress peer) { double throughput = ((double) DatabaseDescriptor.getStreamThroughputOutboundMegabitsPerSec()) * BYTES_PER_MEGABIT; mayUpdateThroughput(throughput, limiter); double interDCThroughput = ((double) DatabaseDescriptor.getInterDCStreamThroughputOutboundMegabitsPerSec()) * BYTES_PER_MEGABIT; mayUpdateThroughput(interDCThroughput, interDCLimiter); if (DatabaseDescriptor.getLocalDataCenter() != null && DatabaseDescriptor.getEndpointSnitch() != null) isLocalDC = DatabaseDescriptor.getLocalDataCenter().equals( DatabaseDescriptor.getEndpointSnitch().getDatacenter(peer)); else isLocalDC = true; }
public StreamRateLimiter(InetAddress peer) { double throughput = DatabaseDescriptor.getStreamThroughputOutboundMegabitsPerSec() * BYTES_PER_MEGABIT; mayUpdateThroughput(throughput, limiter); double interDCThroughput = DatabaseDescriptor.getInterDCStreamThroughputOutboundMegabitsPerSec() * BYTES_PER_MEGABIT; mayUpdateThroughput(interDCThroughput, interDCLimiter); if (DatabaseDescriptor.getLocalDataCenter() != null && DatabaseDescriptor.getEndpointSnitch() != null) isLocalDC = DatabaseDescriptor.getLocalDataCenter().equals( DatabaseDescriptor.getEndpointSnitch().getDatacenter(peer)); else isLocalDC = true; }
public static int replicationFactor(String keyspace) { if (Schema.instance != null && Schema.instance.getKeyspaceInstance(keyspace) != null) { AbstractReplicationStrategy replicationStrategy = Schema.instance.getKeyspaceInstance(keyspace).getReplicationStrategy(); int rf = replicationStrategy.getReplicationFactor(); if (replicationStrategy instanceof NetworkTopologyStrategy) { rf = ((NetworkTopologyStrategy)replicationStrategy).getReplicationFactor(DatabaseDescriptor.getLocalDataCenter()); } return rf; } return 0; }
public ShardInfo shardInfo(String index, ConsistencyLevel cl) { Keyspace keyspace = Schema.instance.getKeyspaceInstance(state().metaData().index(index).keyspace()); AbstractReplicationStrategy replicationStrategy = keyspace.getReplicationStrategy(); int rf = replicationStrategy.getReplicationFactor(); if (replicationStrategy instanceof NetworkTopologyStrategy) rf = ((NetworkTopologyStrategy)replicationStrategy).getReplicationFactor(DatabaseDescriptor.getLocalDataCenter()); return new ShardInfo(rf, cl.blockFor(keyspace)); }