Tabnine Logo
com.bazaarvoice.ostrich.partition
Code IndexAdd Tabnine to your IDE (free)

How to use com.bazaarvoice.ostrich.partition

Best Java code snippets using com.bazaarvoice.ostrich.partition (Showing top 20 results out of 315)

origin: com.bazaarvoice.ostrich/ostrich-core

@Override
public Iterable<ServiceEndPoint> filter(Iterable<ServiceEndPoint> endPoints, PartitionContext partitionContext) {
  HashCode partitionHash = getPartitionHash(partitionContext);
  if (partitionHash == null) {
    return endPoints;  // No partition hash means any server can handle the request.
  }
  // The choose() method is synchronized.  Do any prep work we can up front before calling into it.
  Map<String, ServiceEndPoint> endPointsById = indexById(endPoints);
  ServiceEndPoint endPoint = choose(endPointsById, partitionHash);
  return Collections.singleton(endPoint);
}
origin: bazaarvoice/emodb

  @Override
  public void purge(String apiKey, @PartitionKey String queue) {
    doPurge(apiKey, queue);
  }
}
origin: bazaarvoice/emodb

@Override
public void configure(ServicePoolBuilder<AuthQueueService> servicePoolBuilder) {
  servicePoolBuilder.withPartitionFilter(new ConsistentHashPartitionFilter())
      .withPartitionContextAnnotationsFrom(QueueClient.class);
}
origin: bazaarvoice/emodb

  @Override
  public void purge(String apiKey, @PartitionKey String queue) {
    doPurge(apiKey, queue);
  }
}
origin: bazaarvoice/emodb

@Override
public void configure(ServicePoolBuilder<QueueService> servicePoolBuilder) {
  servicePoolBuilder.withPartitionFilter(new ConsistentHashPartitionFilter())
      .withPartitionContextAnnotationsFrom(QueueServiceAuthenticatorProxy.class);
}
origin: bazaarvoice/ostrich

@Override
public Iterable<ServiceEndPoint> filter(Iterable<ServiceEndPoint> endPoints, PartitionContext partitionContext) {
  HashCode partitionHash = getPartitionHash(partitionContext);
  if (partitionHash == null) {
    return endPoints;  // No partition hash means any server can handle the request.
  }
  // The choose() method is synchronized.  Do any prep work we can up front before calling into it.
  Map<String, ServiceEndPoint> endPointsById = indexById(endPoints);
  ServiceEndPoint endPoint = choose(endPointsById, partitionHash);
  return Collections.singleton(endPoint);
}
origin: bazaarvoice/emodb

@Override
public long getClaimCount(String apiKey, @PartitionKey String queue) {
  return doGetClaimCount(apiKey, queue);
}
origin: bazaarvoice/emodb

@Override
public void configure(ServicePoolBuilder<SubjectDatabus> servicePoolBuilder) {
  servicePoolBuilder.withPartitionFilter(new ConsistentHashPartitionFilter())
      .withPartitionContextAnnotationsFrom(AbstractSubjectDatabus.class);
}
origin: bazaarvoice/emodb

@Override
public List<Message> poll(String apiKey, @PartitionKey String queue, Duration claimTtl, int limit) {
  return doPoll(apiKey, queue, claimTtl, limit);
}
origin: bazaarvoice/emodb

@Override
public void configure(ServicePoolBuilder<DedupQueueService> servicePoolBuilder) {
  servicePoolBuilder.withPartitionFilter(new ConsistentHashPartitionFilter())
      .withPartitionContextAnnotationsFrom(DedupQueueServiceAuthenticatorProxy.class);
}
origin: bazaarvoice/emodb

@Override
public void purge(@PartitionKey String queue) {
  _authDedupQueueService.purge(_apiKey, queue);
}
origin: bazaarvoice/emodb

@Override
public void configure(ServicePoolBuilder<AuthDatabus> servicePoolBuilder) {
  servicePoolBuilder.withPartitionFilter(new ConsistentHashPartitionFilter())
      .withPartitionContextAnnotationsFrom(DatabusClient.class);
}
origin: bazaarvoice/emodb

@Override
public List<Message> peek(@PartitionKey String queue, int limit) {
  return _authDedupQueueService.peek(_apiKey, queue, limit);
}
origin: bazaarvoice/emodb

@Override
public void configure(ServicePoolBuilder<Databus> servicePoolBuilder) {
  servicePoolBuilder.withPartitionFilter(new ConsistentHashPartitionFilter())
      .withPartitionContextAnnotationsFrom(DatabusAuthenticatorProxy.class);
}
origin: bazaarvoice/emodb

@Override
public long getEventCountUpTo(@PartitionKey String subscription, long limit) {
  return _authDatabus.getEventCountUpTo(_apiKey, subscription, limit);
}
origin: bazaarvoice/emodb

@Override
public void configure(ServicePoolBuilder<AuthDedupQueueService> servicePoolBuilder) {
  servicePoolBuilder.withPartitionFilter(new ConsistentHashPartitionFilter())
      .withPartitionContextAnnotationsFrom(DedupQueueClient.class);
}
origin: bazaarvoice/emodb

@Override
public void unclaimAll(@PartitionKey String queue) {
  _authDedupQueueService.unclaimAll(_apiKey, queue);
}
origin: bazaarvoice/emodb

@Override
public long getMessageCount(@PartitionKey String queue) {
  return _authDedupQueueService.getMessageCount(_apiKey, queue);
}
origin: bazaarvoice/emodb

@Override
public List<Message> poll(@PartitionKey String queue, Duration claimTtl, int limit) {
  return _authDedupQueueService.poll(_apiKey, queue, claimTtl, limit);
}
origin: bazaarvoice/emodb

@Override
public long getClaimCount(@PartitionKey String subscription) {
  return _authDatabus.getClaimCount(_apiKey, subscription);
}
com.bazaarvoice.ostrich.partition

Most used classes

  • PartitionKey
  • ConsistentHashPartitionFilter
    Uses consistent hashing to map service calls to end points. Partitions are mapped to servers based o
  • PartitionFilter
    Filters a set of end points based on a PartitionContext object.
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now