Package co.cask.tigon.data.queue

Examples of co.cask.tigon.data.queue.ConsumerConfig


*/
public class DequeueScanObserver extends BaseRegionObserver {
  @Override
  public RegionScanner preScannerOpen(ObserverContext<RegionCoprocessorEnvironment> e, Scan scan, RegionScanner s)
    throws IOException {
    ConsumerConfig consumerConfig = DequeueScanAttributes.getConsumerConfig(scan);
    Transaction tx = DequeueScanAttributes.getTx(scan);
    byte[] queueRowPrefix = DequeueScanAttributes.getQueueRowPrefix(scan);

    if (consumerConfig == null || tx == null || queueRowPrefix == null) {
      return super.preScannerOpen(e, scan, s);
View Full Code Here


   * @param groupSize New group size.
   */
  void open(int groupSize) {
    try {
      close();
      ConsumerConfig config = consumerConfig;
      if (groupSize != config.getGroupSize()) {
        config = new ConsumerConfig(consumerConfig.getGroupId(),
                                    consumerConfig.getInstanceId(),
                                    groupSize,
                                    consumerConfig.getDequeueStrategy(),
                                    consumerConfig.getHashKey());
      }
View Full Code Here

        ProcessMethod processMethod = processMethodFactory.create(method, maxRetries);
        Set<String> inputNames;
        Schema schema;
        TypeToken<?> dataType;
        ConsumerConfig consumerConfig;
        int batchSize = 1;

        if (tickAnnotation != null) {
          inputNames = ImmutableSet.of();
          consumerConfig = new ConsumerConfig(0, 0, 1, DequeueStrategy.FIFO, null);
          schema = Schema.of(Schema.Type.NULL);
          dataType = TypeToken.of(void.class);
        } else {
          inputNames = Sets.newHashSet(processInputAnnotation.value());
          if (inputNames.isEmpty()) {
View Full Code Here

      Preconditions.checkArgument(!hashKey.isEmpty(), "Partition key cannot be empty: %s", method.getName());
    } else if (roundRobin != null) {
      strategy = DequeueStrategy.ROUND_ROBIN;
    }

    return new ConsumerConfig(flowletContext.getGroupId(), flowletContext.getInstanceId(),
                              flowletContext.getInstanceCount(), strategy, hashKey);
  }
View Full Code Here

*/
public class DequeueScanObserver extends BaseRegionObserver {
  @Override
  public RegionScanner preScannerOpen(ObserverContext<RegionCoprocessorEnvironment> e, Scan scan, RegionScanner s)
    throws IOException {
    ConsumerConfig consumerConfig = DequeueScanAttributes.getConsumerConfig(scan);
    Transaction tx = DequeueScanAttributes.getTx(scan);
    byte[] queueRowPrefix = DequeueScanAttributes.getQueueRowPrefix(scan);

    if (consumerConfig == null || tx == null || queueRowPrefix == null) {
      return super.preScannerOpen(e, scan, s);
View Full Code Here

    int groupSize = dataInput.readInt();
    int instanceId = dataInput.readInt();
    DequeueStrategy strategy = WritableUtils.readEnum(dataInput, DequeueStrategy.class);
    String hashKey = WritableUtils.readString(dataInput);

    return new ConsumerConfig(groupId, instanceId, groupSize, strategy, hashKey);
  }
View Full Code Here

TOP

Related Classes of co.cask.tigon.data.queue.ConsumerConfig

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.