public int getVersion(String endpoint) throws UnknownHostException { return getVersion(InetAddress.getByName(endpoint)); }
public int getVersion(String endpoint) throws UnknownHostException { return getVersion(InetAddress.getByName(endpoint)); }
public int getVersion(String endpoint) throws UnknownHostException { return getVersion(InetAddress.getByName(endpoint)); }
public int getVersion(String endpoint) throws UnknownHostException { return getVersion(InetAddress.getByName(endpoint)); }
BatchlogEndpoints(Collection<InetAddress> endpoints) { all = endpoints; current = new ArrayList<>(2); legacy = new ArrayList<>(2); for (InetAddress ep : endpoints) { if (MessagingService.instance().getVersion(ep) >= MessagingService.VERSION_30) current.add(ep); else legacy.add(ep); } } }
BatchlogEndpoints(Collection<InetAddress> endpoints) { all = endpoints; current = new ArrayList<>(2); legacy = new ArrayList<>(2); for (InetAddress ep : endpoints) { if (MessagingService.instance().getVersion(ep) >= MessagingService.VERSION_30) current.add(ep); else legacy.add(ep); } } }
static HintsDispatcher create(File file, RateLimiter rateLimiter, InetAddress address, UUID hostId, BooleanSupplier abortRequested) { int messagingVersion = MessagingService.instance().getVersion(address); return new HintsDispatcher(HintsReader.open(file, rateLimiter), hostId, address, messagingVersion, abortRequested); }
static HintsDispatcher create(File file, RateLimiter rateLimiter, InetAddress address, UUID hostId, BooleanSupplier abortRequested) { int messagingVersion = MessagingService.instance().getVersion(address); return new HintsDispatcher(HintsReader.open(file, rateLimiter), hostId, address, messagingVersion, abortRequested); }
static HintsDispatcher create(File file, RateLimiter rateLimiter, InetAddress address, UUID hostId, BooleanSupplier abortRequested) { int messagingVersion = MessagingService.instance().getVersion(address); return new HintsDispatcher(HintsReader.open(file, rateLimiter), hostId, address, messagingVersion, abortRequested); }
public boolean isRpcReady(InetAddress endpoint) { if (MessagingService.instance().getVersion(endpoint) < MessagingService.VERSION_22) return true; EndpointState state = Gossiper.instance.getEndpointStateForEndpoint(endpoint); return state != null && state.isRpcReady(); }
public boolean isRpcReady(InetAddress endpoint) { if (MessagingService.instance().getVersion(endpoint) < MessagingService.VERSION_22) return true; EndpointState state = Gossiper.instance.getEndpointStateForEndpoint(endpoint); return state != null && state.isRpcReady(); }
public boolean isRpcReady(InetAddress endpoint) { if (MessagingService.instance().getVersion(endpoint) < MessagingService.VERSION_22) return true; EndpointState state = Gossiper.instance.getEndpointStateForEndpoint(endpoint); return state != null && state.isRpcReady(); }
AbstractReadExecutor(Keyspace keyspace, ReadCommand command, ConsistencyLevel consistencyLevel, List<InetAddress> targetReplicas, long queryStartNanoTime) { this.command = command; this.targetReplicas = targetReplicas; this.handler = new ReadCallback(new DigestResolver(keyspace, command, consistencyLevel, targetReplicas.size()), consistencyLevel, command, targetReplicas, queryStartNanoTime); this.traceState = Tracing.instance.get(); // Set the digest version (if we request some digests). This is the smallest version amongst all our target replicas since new nodes // knows how to produce older digest but the reverse is not true. // TODO: we need this when talking with pre-3.0 nodes. So if we preserve the digest format moving forward, we can get rid of this once // we stop being compatible with pre-3.0 nodes. int digestVersion = MessagingService.current_version; for (InetAddress replica : targetReplicas) digestVersion = Math.min(digestVersion, MessagingService.instance().getVersion(replica)); command.setDigestVersion(digestVersion); }
AbstractReadExecutor(Keyspace keyspace, ReadCommand command, ConsistencyLevel consistencyLevel, List<InetAddress> targetReplicas, long queryStartNanoTime) { this.command = command; this.targetReplicas = targetReplicas; this.handler = new ReadCallback(new DigestResolver(keyspace, command, consistencyLevel, targetReplicas.size()), consistencyLevel, command, targetReplicas, queryStartNanoTime); this.traceState = Tracing.instance.get(); // Set the digest version (if we request some digests). This is the smallest version amongst all our target replicas since new nodes // knows how to produce older digest but the reverse is not true. // TODO: we need this when talking with pre-3.0 nodes. So if we preserve the digest format moving forward, we can get rid of this once // we stop being compatible with pre-3.0 nodes. int digestVersion = MessagingService.current_version; for (InetAddress replica : targetReplicas) digestVersion = Math.min(digestVersion, MessagingService.instance().getVersion(replica)); command.setDigestVersion(digestVersion); }
public OutboundTcpConnection(OutboundTcpConnectionPool pool, String name) { super("MessagingService-Outgoing-" + pool.endPoint() + "-" + name); this.poolReference = pool; cs = newCoalescingStrategy(pool.endPoint().getHostAddress()); // We want to use the most precise version we know because while there is version detection on connect(), // the target version might be accessed by the pool (in getConnection()) before we actually connect (as we // connect when the first message is submitted). Note however that the only case where we'll connect // without knowing the true version of a node is if that node is a seed (otherwise, we can't know a node // unless it has been gossiped to us or it has connected to us and in both case this sets the version) and // in that case we won't rely on that targetVersion before we're actually connected and so the version // detection in connect() will do its job. targetVersion = MessagingService.instance().getVersion(pool.endPoint()); }
public OutboundTcpConnection(OutboundTcpConnectionPool pool, String name) { super("MessagingService-Outgoing-" + pool.endPoint() + "-" + name); this.poolReference = pool; cs = newCoalescingStrategy(pool.endPoint().getHostAddress()); // We want to use the most precise version we know because while there is version detection on connect(), // the target version might be accessed by the pool (in getConnection()) before we actually connect (as we // connect when the first message is submitted). Note however that the only case where we'll connect // without knowing the true version of a node is if that node is a seed (otherwise, we can't know a node // unless it has been gossiped to us or it has connected to us and in both case this sets the version) and // in that case we won't rely on that targetVersion before we're actually connected and so the version // detection in connect() will do its job. targetVersion = MessagingService.instance().getVersion(pool.endPoint()); }
public OutboundTcpConnection(OutboundTcpConnectionPool pool, String name) { super("MessagingService-Outgoing-" + pool.endPoint() + "-" + name); this.poolReference = pool; cs = newCoalescingStrategy(pool.endPoint().getHostAddress()); // We want to use the most precise version we know because while there is version detection on connect(), // the target version might be accessed by the pool (in getConnection()) before we actually connect (as we // connect when the first message is submitted). Note however that the only case where we'll connect // without knowing the true version of a node is if that node is a seed (otherwise, we can't know a node // unless it has been gossiped to us or it has connected to us and in both case this sets the version) and // in that case we won't rely on that targetVersion before we're actually connected and so the version // detection in connect() will do its job. targetVersion = MessagingService.instance().getVersion(pool.endPoint()); }
public static void syncWriteToBatchlog(WriteResponseHandler<?> handler, Batch batch, Collection<InetAddress> endpoints) throws WriteTimeoutException, WriteFailureException { for (InetAddress target : endpoints) { logger.trace("Sending legacy batchlog store request {} to {} for {} mutations", batch.id, target, batch.size()); int targetVersion = MessagingService.instance().getVersion(target); MessagingService.instance().sendRR(getStoreMutation(batch, targetVersion).createMessage(MessagingService.Verb.MUTATION), target, handler, false); } }
public static void syncWriteToBatchlog(WriteResponseHandler<?> handler, Batch batch, Collection<InetAddress> endpoints) throws WriteTimeoutException, WriteFailureException { for (InetAddress target : endpoints) { logger.trace("Sending legacy batchlog store request {} to {} for {} mutations", batch.id, target, batch.size()); int targetVersion = MessagingService.instance().getVersion(target); MessagingService.instance().sendRR(getStoreMutation(batch, targetVersion).createMessage(MessagingService.Verb.MUTATION), target, handler, false); } }
public static void syncWriteToBatchlog(WriteResponseHandler<?> handler, Batch batch, Collection<InetAddress> endpoints) throws WriteTimeoutException, WriteFailureException { for (InetAddress target : endpoints) { logger.trace("Sending legacy batchlog store request {} to {} for {} mutations", batch.id, target, batch.size()); int targetVersion = MessagingService.instance().getVersion(target); MessagingService.instance().sendRR(getStoreMutation(batch, targetVersion).createMessage(MessagingService.Verb.MUTATION), target, handler, false); } }