Package com.netflix.astyanax.serializers

Examples of com.netflix.astyanax.serializers.CompositeRangeBuilder$CompositeByteBufferRange


        if (!(serializer instanceof AnnotatedCompositeSerializer)) {
            return new RangeBuilder().setStart(start, serializerFor(start.getClass()))
                    .setEnd(end, serializerFor(end.getClass())).build();
        } else {
            AnnotatedCompositeSerializer compositeSerializer = (AnnotatedCompositeSerializer) serializer;
            CompositeRangeBuilder rangeBuilder = compositeSerializer.buildRange();
            List<ComponentField> componentFields = componentFieldsForClass(start.getClass());
            List<ComponentField> nonNullFields = new ArrayList<ComponentField>();
            for (ComponentField field : componentFields) {
                if ((field.getValue(start) != null) && field.getValue(end) != null) {
                    nonNullFields.add(field);
                }
            }

            for (int i = 0; i < nonNullFields.size(); i++) {
                Object objStart = nonNullFields.get(i).getValue(start);
                Object objEnd = nonNullFields.get(i).getValue(end);
                if (i + 1 != nonNullFields.size()) {
                    rangeBuilder.withPrefix(objStart);
                    LOG.debug("withPrefix(" + objStart + ")");
                } else {
                    rangeBuilder.greaterThanEquals(objStart);
                    LOG.debug("greaterThanEquals(" + objStart + ")");
                    rangeBuilder.lessThanEquals(objEnd);
                    LOG.debug("lessThanEquals(" + objEnd + ")");
                }
            }
            return rangeBuilder;
        }
View Full Code Here


      throw new UnsupportedOperationException("not done here yet");
  }
 
  public static CompositeRangeBuilder setupRangeBuilder(Key from, Key to, Info info1, boolean reverse) {
    AnnotatedCompositeSerializer serializer = info1.getCompositeSerializer();
    CompositeRangeBuilder range = serializer.buildRange();
    if(from != null) {
      if(from.isInclusive())
        range = range.greaterThanEquals(from.getKey());
      else
        range = range.greaterThan(from.getKey());
    }
    if(to != null) {
      if(to.isInclusive())
        range = range.lessThanEquals(to.getKey());
      else
        range = range.lessThan(to.getKey());
    }
    if (reverse)
      range = range.reverse();
    return range;
  }
View Full Code Here

     * For some dang reason with astyanax, we have to recreate the row query from scratch before we re-use it for
     * a NEsted join.
     * @return
     */
    public RowQuery<byte[], byte[]> createRowQuery() {
      CompositeRangeBuilder range = setupRangeBuilder(from, to, info1, false);
      if(batchSize != null)
        range = range.limit(batchSize);     
      return createBasicRowQuery(rowKey, info1, range);
    }
View Full Code Here

     * For some dang reason with astyanax, we have to recreate the row query from scratch before we re-use it for
     * a NEsted join.
     * @return
     */
    public RowQuery<byte[], byte[]> createRowQueryReverse() {
      CompositeRangeBuilder range = setupRangeBuilder(from, to, info1, true);
      if(batchSize != null)
        range = range.limit(batchSize);     
      return createBasicRowQuery(rowKey, info1, range);
    }
View Full Code Here

      throw new UnsupportedOperationException("not done here yet");
  }
 
  public static CompositeRangeBuilder setupRangeBuilder(Key from, Key to, Info info1, boolean reverse) {
    AnnotatedCompositeSerializer serializer = info1.getCompositeSerializer();
    CompositeRangeBuilder range = serializer.buildRange();
    if(from != null) {
      if(from.isInclusive())
        range = range.greaterThanEquals(from.getKey());
      else
        range = range.greaterThan(from.getKey());
    }
    if(to != null) {
      if(to.isInclusive())
        range = range.lessThanEquals(to.getKey());
      else
        range = range.lessThan(to.getKey());
    }
    if (reverse)
      range = range.reverse();
    return range;
  }
View Full Code Here

     * For some dang reason with astyanax, we have to recreate the row query from scratch before we re-use it for
     * a NEsted join.
     * @return
     */
    public RowQuery<byte[], byte[]> createRowQuery() {
      CompositeRangeBuilder range = setupRangeBuilder(from, to, info1, false);
      if(batchSize != null)
        range = range.limit(batchSize);     
      return createBasicRowQuery(rowKey, info1, range);
    }
View Full Code Here

     * For some dang reason with astyanax, we have to recreate the row query from scratch before we re-use it for
     * a NEsted join.
     * @return
     */
    public RowQuery<byte[], byte[]> createRowQueryReverse() {
      CompositeRangeBuilder range = setupRangeBuilder(from, to, info1, true);
      if(batchSize != null)
        range = range.limit(batchSize);     
      return createBasicRowQuery(rowKey, info1, range);
    }
View Full Code Here

      throw new UnsupportedOperationException("not done here yet");
  }
 
  public static CompositeRangeBuilder setupRangeBuilder(Key from, Key to, Info info1) {
    AnnotatedCompositeSerializer serializer = info1.getCompositeSerializer();
    CompositeRangeBuilder range = serializer.buildRange();
    if(from != null) {
      if(from.isInclusive())
        range = range.greaterThanEquals(from.getKey());
      else
        range = range.greaterThan(from.getKey());
    }
    if(to != null) {
      if(to.isInclusive())
        range = range.lessThanEquals(to.getKey());
      else
        range = range.lessThan(to.getKey());
    }
    return range;
  }
View Full Code Here

     * For some dang reason with astyanax, we have to recreate the row query from scratch before we re-use it for
     * a NEsted join.
     * @return
     */
    public RowQuery<byte[], byte[]> createRowQuery() {
      CompositeRangeBuilder range = setupRangeBuilder(from, to, info1);
      if(batchSize != null)
        range = range.limit(batchSize);     
      return createBasicRowQuery(rowKey, info1, range);
    }
View Full Code Here

      throw new UnsupportedOperationException("not done here yet");
  }
 
  public static CompositeRangeBuilder setupRangeBuilder(Key from, Key to, Info info1) {
    AnnotatedCompositeSerializer serializer = info1.getCompositeSerializer();
    CompositeRangeBuilder range = serializer.buildRange();
    if(from != null) {
      if(from.isInclusive())
        range = range.greaterThanEquals(from.getKey());
      else
        range = range.greaterThan(from.getKey());
    }
    if(to != null) {
      if(to.isInclusive())
        range = range.lessThanEquals(to.getKey());
      else
        range = range.lessThan(to.getKey());
    }
    return range;
  }
View Full Code Here

TOP

Related Classes of com.netflix.astyanax.serializers.CompositeRangeBuilder$CompositeByteBufferRange

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.