accumulo-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From e..@apache.org
Subject svn commit: r1437820 [4/4] - in /accumulo/trunk: core/src/main/java/org/apache/accumulo/core/client/admin/ proxy/ proxy/src/main/java/org/apache/accumulo/proxy/ proxy/src/main/java/org/apache/accumulo/proxy/thrift/ proxy/src/main/thrift/ proxy/src/test...
Date Thu, 24 Jan 2013 01:13:25 GMT
Added: accumulo/trunk/proxy/src/main/java/org/apache/accumulo/proxy/thrift/ScanOptions.java
URL: http://svn.apache.org/viewvc/accumulo/trunk/proxy/src/main/java/org/apache/accumulo/proxy/thrift/ScanOptions.java?rev=1437820&view=auto
==============================================================================
--- accumulo/trunk/proxy/src/main/java/org/apache/accumulo/proxy/thrift/ScanOptions.java (added)
+++ accumulo/trunk/proxy/src/main/java/org/apache/accumulo/proxy/thrift/ScanOptions.java Thu Jan 24 01:13:24 2013
@@ -0,0 +1,972 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+/**
+ * Autogenerated by Thrift Compiler (0.9.0)
+ *
+ * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
+ *  @generated
+ */
+package org.apache.accumulo.proxy.thrift;
+
+import org.apache.thrift.scheme.IScheme;
+import org.apache.thrift.scheme.SchemeFactory;
+import org.apache.thrift.scheme.StandardScheme;
+
+import org.apache.thrift.scheme.TupleScheme;
+import org.apache.thrift.protocol.TTupleProtocol;
+import org.apache.thrift.protocol.TProtocolException;
+import org.apache.thrift.EncodingUtils;
+import org.apache.thrift.TException;
+import java.util.List;
+import java.util.ArrayList;
+import java.util.Map;
+import java.util.HashMap;
+import java.util.EnumMap;
+import java.util.Set;
+import java.util.HashSet;
+import java.util.EnumSet;
+import java.util.Collections;
+import java.util.BitSet;
+import java.nio.ByteBuffer;
+import java.util.Arrays;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+@SuppressWarnings("all") public class ScanOptions implements org.apache.thrift.TBase<ScanOptions, ScanOptions._Fields>, java.io.Serializable, Cloneable {
+  private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("ScanOptions");
+
+  private static final org.apache.thrift.protocol.TField AUTHORIZATIONS_FIELD_DESC = new org.apache.thrift.protocol.TField("authorizations", org.apache.thrift.protocol.TType.SET, (short)1);
+  private static final org.apache.thrift.protocol.TField RANGE_FIELD_DESC = new org.apache.thrift.protocol.TField("range", org.apache.thrift.protocol.TType.STRUCT, (short)2);
+  private static final org.apache.thrift.protocol.TField COLUMNS_FIELD_DESC = new org.apache.thrift.protocol.TField("columns", org.apache.thrift.protocol.TType.LIST, (short)3);
+  private static final org.apache.thrift.protocol.TField ITERATORS_FIELD_DESC = new org.apache.thrift.protocol.TField("iterators", org.apache.thrift.protocol.TType.LIST, (short)4);
+  private static final org.apache.thrift.protocol.TField BUFFER_SIZE_FIELD_DESC = new org.apache.thrift.protocol.TField("bufferSize", org.apache.thrift.protocol.TType.I32, (short)5);
+
+  private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
+  static {
+    schemes.put(StandardScheme.class, new ScanOptionsStandardSchemeFactory());
+    schemes.put(TupleScheme.class, new ScanOptionsTupleSchemeFactory());
+  }
+
+  public Set<ByteBuffer> authorizations; // optional
+  public Range range; // optional
+  public List<ScanColumn> columns; // optional
+  public List<IteratorSetting> iterators; // optional
+  public int bufferSize; // optional
+
+  /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
+  @SuppressWarnings("all") public enum _Fields implements org.apache.thrift.TFieldIdEnum {
+    AUTHORIZATIONS((short)1, "authorizations"),
+    RANGE((short)2, "range"),
+    COLUMNS((short)3, "columns"),
+    ITERATORS((short)4, "iterators"),
+    BUFFER_SIZE((short)5, "bufferSize");
+
+    private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
+
+    static {
+      for (_Fields field : EnumSet.allOf(_Fields.class)) {
+        byName.put(field.getFieldName(), field);
+      }
+    }
+
+    /**
+     * Find the _Fields constant that matches fieldId, or null if its not found.
+     */
+    public static _Fields findByThriftId(int fieldId) {
+      switch(fieldId) {
+        case 1: // AUTHORIZATIONS
+          return AUTHORIZATIONS;
+        case 2: // RANGE
+          return RANGE;
+        case 3: // COLUMNS
+          return COLUMNS;
+        case 4: // ITERATORS
+          return ITERATORS;
+        case 5: // BUFFER_SIZE
+          return BUFFER_SIZE;
+        default:
+          return null;
+      }
+    }
+
+    /**
+     * Find the _Fields constant that matches fieldId, throwing an exception
+     * if it is not found.
+     */
+    public static _Fields findByThriftIdOrThrow(int fieldId) {
+      _Fields fields = findByThriftId(fieldId);
+      if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
+      return fields;
+    }
+
+    /**
+     * Find the _Fields constant that matches name, or null if its not found.
+     */
+    public static _Fields findByName(String name) {
+      return byName.get(name);
+    }
+
+    private final short _thriftId;
+    private final String _fieldName;
+
+    _Fields(short thriftId, String fieldName) {
+      _thriftId = thriftId;
+      _fieldName = fieldName;
+    }
+
+    public short getThriftFieldId() {
+      return _thriftId;
+    }
+
+    public String getFieldName() {
+      return _fieldName;
+    }
+  }
+
+  // isset id assignments
+  private static final int __BUFFERSIZE_ISSET_ID = 0;
+  private byte __isset_bitfield = 0;
+  private _Fields optionals[] = {_Fields.AUTHORIZATIONS,_Fields.RANGE,_Fields.COLUMNS,_Fields.ITERATORS,_Fields.BUFFER_SIZE};
+  public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
+  static {
+    Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
+    tmpMap.put(_Fields.AUTHORIZATIONS, new org.apache.thrift.meta_data.FieldMetaData("authorizations", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
+        new org.apache.thrift.meta_data.SetMetaData(org.apache.thrift.protocol.TType.SET, 
+            new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING            , true))));
+    tmpMap.put(_Fields.RANGE, new org.apache.thrift.meta_data.FieldMetaData("range", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
+        new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, Range.class)));
+    tmpMap.put(_Fields.COLUMNS, new org.apache.thrift.meta_data.FieldMetaData("columns", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
+        new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST, 
+            new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, ScanColumn.class))));
+    tmpMap.put(_Fields.ITERATORS, new org.apache.thrift.meta_data.FieldMetaData("iterators", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
+        new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST, 
+            new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, IteratorSetting.class))));
+    tmpMap.put(_Fields.BUFFER_SIZE, new org.apache.thrift.meta_data.FieldMetaData("bufferSize", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
+        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32)));
+    metaDataMap = Collections.unmodifiableMap(tmpMap);
+    org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(ScanOptions.class, metaDataMap);
+  }
+
+  public ScanOptions() {
+  }
+
+  /**
+   * Performs a deep copy on <i>other</i>.
+   */
+  public ScanOptions(ScanOptions other) {
+    __isset_bitfield = other.__isset_bitfield;
+    if (other.isSetAuthorizations()) {
+      Set<ByteBuffer> __this__authorizations = new HashSet<ByteBuffer>();
+      for (ByteBuffer other_element : other.authorizations) {
+        ByteBuffer temp_binary_element = org.apache.thrift.TBaseHelper.copyBinary(other_element);
+;
+        __this__authorizations.add(temp_binary_element);
+      }
+      this.authorizations = __this__authorizations;
+    }
+    if (other.isSetRange()) {
+      this.range = new Range(other.range);
+    }
+    if (other.isSetColumns()) {
+      List<ScanColumn> __this__columns = new ArrayList<ScanColumn>();
+      for (ScanColumn other_element : other.columns) {
+        __this__columns.add(new ScanColumn(other_element));
+      }
+      this.columns = __this__columns;
+    }
+    if (other.isSetIterators()) {
+      List<IteratorSetting> __this__iterators = new ArrayList<IteratorSetting>();
+      for (IteratorSetting other_element : other.iterators) {
+        __this__iterators.add(new IteratorSetting(other_element));
+      }
+      this.iterators = __this__iterators;
+    }
+    this.bufferSize = other.bufferSize;
+  }
+
+  public ScanOptions deepCopy() {
+    return new ScanOptions(this);
+  }
+
+  @Override
+  public void clear() {
+    this.authorizations = null;
+    this.range = null;
+    this.columns = null;
+    this.iterators = null;
+    setBufferSizeIsSet(false);
+    this.bufferSize = 0;
+  }
+
+  public int getAuthorizationsSize() {
+    return (this.authorizations == null) ? 0 : this.authorizations.size();
+  }
+
+  public java.util.Iterator<ByteBuffer> getAuthorizationsIterator() {
+    return (this.authorizations == null) ? null : this.authorizations.iterator();
+  }
+
+  public void addToAuthorizations(ByteBuffer elem) {
+    if (this.authorizations == null) {
+      this.authorizations = new HashSet<ByteBuffer>();
+    }
+    this.authorizations.add(elem);
+  }
+
+  public Set<ByteBuffer> getAuthorizations() {
+    return this.authorizations;
+  }
+
+  public ScanOptions setAuthorizations(Set<ByteBuffer> authorizations) {
+    this.authorizations = authorizations;
+    return this;
+  }
+
+  public void unsetAuthorizations() {
+    this.authorizations = null;
+  }
+
+  /** Returns true if field authorizations is set (has been assigned a value) and false otherwise */
+  public boolean isSetAuthorizations() {
+    return this.authorizations != null;
+  }
+
+  public void setAuthorizationsIsSet(boolean value) {
+    if (!value) {
+      this.authorizations = null;
+    }
+  }
+
+  public Range getRange() {
+    return this.range;
+  }
+
+  public ScanOptions setRange(Range range) {
+    this.range = range;
+    return this;
+  }
+
+  public void unsetRange() {
+    this.range = null;
+  }
+
+  /** Returns true if field range is set (has been assigned a value) and false otherwise */
+  public boolean isSetRange() {
+    return this.range != null;
+  }
+
+  public void setRangeIsSet(boolean value) {
+    if (!value) {
+      this.range = null;
+    }
+  }
+
+  public int getColumnsSize() {
+    return (this.columns == null) ? 0 : this.columns.size();
+  }
+
+  public java.util.Iterator<ScanColumn> getColumnsIterator() {
+    return (this.columns == null) ? null : this.columns.iterator();
+  }
+
+  public void addToColumns(ScanColumn elem) {
+    if (this.columns == null) {
+      this.columns = new ArrayList<ScanColumn>();
+    }
+    this.columns.add(elem);
+  }
+
+  public List<ScanColumn> getColumns() {
+    return this.columns;
+  }
+
+  public ScanOptions setColumns(List<ScanColumn> columns) {
+    this.columns = columns;
+    return this;
+  }
+
+  public void unsetColumns() {
+    this.columns = null;
+  }
+
+  /** Returns true if field columns is set (has been assigned a value) and false otherwise */
+  public boolean isSetColumns() {
+    return this.columns != null;
+  }
+
+  public void setColumnsIsSet(boolean value) {
+    if (!value) {
+      this.columns = null;
+    }
+  }
+
+  public int getIteratorsSize() {
+    return (this.iterators == null) ? 0 : this.iterators.size();
+  }
+
+  public java.util.Iterator<IteratorSetting> getIteratorsIterator() {
+    return (this.iterators == null) ? null : this.iterators.iterator();
+  }
+
+  public void addToIterators(IteratorSetting elem) {
+    if (this.iterators == null) {
+      this.iterators = new ArrayList<IteratorSetting>();
+    }
+    this.iterators.add(elem);
+  }
+
+  public List<IteratorSetting> getIterators() {
+    return this.iterators;
+  }
+
+  public ScanOptions setIterators(List<IteratorSetting> iterators) {
+    this.iterators = iterators;
+    return this;
+  }
+
+  public void unsetIterators() {
+    this.iterators = null;
+  }
+
+  /** Returns true if field iterators is set (has been assigned a value) and false otherwise */
+  public boolean isSetIterators() {
+    return this.iterators != null;
+  }
+
+  public void setIteratorsIsSet(boolean value) {
+    if (!value) {
+      this.iterators = null;
+    }
+  }
+
+  public int getBufferSize() {
+    return this.bufferSize;
+  }
+
+  public ScanOptions setBufferSize(int bufferSize) {
+    this.bufferSize = bufferSize;
+    setBufferSizeIsSet(true);
+    return this;
+  }
+
+  public void unsetBufferSize() {
+    __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __BUFFERSIZE_ISSET_ID);
+  }
+
+  /** Returns true if field bufferSize is set (has been assigned a value) and false otherwise */
+  public boolean isSetBufferSize() {
+    return EncodingUtils.testBit(__isset_bitfield, __BUFFERSIZE_ISSET_ID);
+  }
+
+  public void setBufferSizeIsSet(boolean value) {
+    __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __BUFFERSIZE_ISSET_ID, value);
+  }
+
+  public void setFieldValue(_Fields field, Object value) {
+    switch (field) {
+    case AUTHORIZATIONS:
+      if (value == null) {
+        unsetAuthorizations();
+      } else {
+        setAuthorizations((Set<ByteBuffer>)value);
+      }
+      break;
+
+    case RANGE:
+      if (value == null) {
+        unsetRange();
+      } else {
+        setRange((Range)value);
+      }
+      break;
+
+    case COLUMNS:
+      if (value == null) {
+        unsetColumns();
+      } else {
+        setColumns((List<ScanColumn>)value);
+      }
+      break;
+
+    case ITERATORS:
+      if (value == null) {
+        unsetIterators();
+      } else {
+        setIterators((List<IteratorSetting>)value);
+      }
+      break;
+
+    case BUFFER_SIZE:
+      if (value == null) {
+        unsetBufferSize();
+      } else {
+        setBufferSize((Integer)value);
+      }
+      break;
+
+    }
+  }
+
+  public Object getFieldValue(_Fields field) {
+    switch (field) {
+    case AUTHORIZATIONS:
+      return getAuthorizations();
+
+    case RANGE:
+      return getRange();
+
+    case COLUMNS:
+      return getColumns();
+
+    case ITERATORS:
+      return getIterators();
+
+    case BUFFER_SIZE:
+      return Integer.valueOf(getBufferSize());
+
+    }
+    throw new IllegalStateException();
+  }
+
+  /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
+  public boolean isSet(_Fields field) {
+    if (field == null) {
+      throw new IllegalArgumentException();
+    }
+
+    switch (field) {
+    case AUTHORIZATIONS:
+      return isSetAuthorizations();
+    case RANGE:
+      return isSetRange();
+    case COLUMNS:
+      return isSetColumns();
+    case ITERATORS:
+      return isSetIterators();
+    case BUFFER_SIZE:
+      return isSetBufferSize();
+    }
+    throw new IllegalStateException();
+  }
+
+  @Override
+  public boolean equals(Object that) {
+    if (that == null)
+      return false;
+    if (that instanceof ScanOptions)
+      return this.equals((ScanOptions)that);
+    return false;
+  }
+
+  public boolean equals(ScanOptions that) {
+    if (that == null)
+      return false;
+
+    boolean this_present_authorizations = true && this.isSetAuthorizations();
+    boolean that_present_authorizations = true && that.isSetAuthorizations();
+    if (this_present_authorizations || that_present_authorizations) {
+      if (!(this_present_authorizations && that_present_authorizations))
+        return false;
+      if (!this.authorizations.equals(that.authorizations))
+        return false;
+    }
+
+    boolean this_present_range = true && this.isSetRange();
+    boolean that_present_range = true && that.isSetRange();
+    if (this_present_range || that_present_range) {
+      if (!(this_present_range && that_present_range))
+        return false;
+      if (!this.range.equals(that.range))
+        return false;
+    }
+
+    boolean this_present_columns = true && this.isSetColumns();
+    boolean that_present_columns = true && that.isSetColumns();
+    if (this_present_columns || that_present_columns) {
+      if (!(this_present_columns && that_present_columns))
+        return false;
+      if (!this.columns.equals(that.columns))
+        return false;
+    }
+
+    boolean this_present_iterators = true && this.isSetIterators();
+    boolean that_present_iterators = true && that.isSetIterators();
+    if (this_present_iterators || that_present_iterators) {
+      if (!(this_present_iterators && that_present_iterators))
+        return false;
+      if (!this.iterators.equals(that.iterators))
+        return false;
+    }
+
+    boolean this_present_bufferSize = true && this.isSetBufferSize();
+    boolean that_present_bufferSize = true && that.isSetBufferSize();
+    if (this_present_bufferSize || that_present_bufferSize) {
+      if (!(this_present_bufferSize && that_present_bufferSize))
+        return false;
+      if (this.bufferSize != that.bufferSize)
+        return false;
+    }
+
+    return true;
+  }
+
+  @Override
+  public int hashCode() {
+    return 0;
+  }
+
+  public int compareTo(ScanOptions other) {
+    if (!getClass().equals(other.getClass())) {
+      return getClass().getName().compareTo(other.getClass().getName());
+    }
+
+    int lastComparison = 0;
+    ScanOptions typedOther = (ScanOptions)other;
+
+    lastComparison = Boolean.valueOf(isSetAuthorizations()).compareTo(typedOther.isSetAuthorizations());
+    if (lastComparison != 0) {
+      return lastComparison;
+    }
+    if (isSetAuthorizations()) {
+      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.authorizations, typedOther.authorizations);
+      if (lastComparison != 0) {
+        return lastComparison;
+      }
+    }
+    lastComparison = Boolean.valueOf(isSetRange()).compareTo(typedOther.isSetRange());
+    if (lastComparison != 0) {
+      return lastComparison;
+    }
+    if (isSetRange()) {
+      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.range, typedOther.range);
+      if (lastComparison != 0) {
+        return lastComparison;
+      }
+    }
+    lastComparison = Boolean.valueOf(isSetColumns()).compareTo(typedOther.isSetColumns());
+    if (lastComparison != 0) {
+      return lastComparison;
+    }
+    if (isSetColumns()) {
+      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.columns, typedOther.columns);
+      if (lastComparison != 0) {
+        return lastComparison;
+      }
+    }
+    lastComparison = Boolean.valueOf(isSetIterators()).compareTo(typedOther.isSetIterators());
+    if (lastComparison != 0) {
+      return lastComparison;
+    }
+    if (isSetIterators()) {
+      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.iterators, typedOther.iterators);
+      if (lastComparison != 0) {
+        return lastComparison;
+      }
+    }
+    lastComparison = Boolean.valueOf(isSetBufferSize()).compareTo(typedOther.isSetBufferSize());
+    if (lastComparison != 0) {
+      return lastComparison;
+    }
+    if (isSetBufferSize()) {
+      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.bufferSize, typedOther.bufferSize);
+      if (lastComparison != 0) {
+        return lastComparison;
+      }
+    }
+    return 0;
+  }
+
+  public _Fields fieldForId(int fieldId) {
+    return _Fields.findByThriftId(fieldId);
+  }
+
+  public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
+    schemes.get(iprot.getScheme()).getScheme().read(iprot, this);
+  }
+
+  public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
+    schemes.get(oprot.getScheme()).getScheme().write(oprot, this);
+  }
+
+  @Override
+  public String toString() {
+    StringBuilder sb = new StringBuilder("ScanOptions(");
+    boolean first = true;
+
+    if (isSetAuthorizations()) {
+      sb.append("authorizations:");
+      if (this.authorizations == null) {
+        sb.append("null");
+      } else {
+        sb.append(this.authorizations);
+      }
+      first = false;
+    }
+    if (isSetRange()) {
+      if (!first) sb.append(", ");
+      sb.append("range:");
+      if (this.range == null) {
+        sb.append("null");
+      } else {
+        sb.append(this.range);
+      }
+      first = false;
+    }
+    if (isSetColumns()) {
+      if (!first) sb.append(", ");
+      sb.append("columns:");
+      if (this.columns == null) {
+        sb.append("null");
+      } else {
+        sb.append(this.columns);
+      }
+      first = false;
+    }
+    if (isSetIterators()) {
+      if (!first) sb.append(", ");
+      sb.append("iterators:");
+      if (this.iterators == null) {
+        sb.append("null");
+      } else {
+        sb.append(this.iterators);
+      }
+      first = false;
+    }
+    if (isSetBufferSize()) {
+      if (!first) sb.append(", ");
+      sb.append("bufferSize:");
+      sb.append(this.bufferSize);
+      first = false;
+    }
+    sb.append(")");
+    return sb.toString();
+  }
+
+  public void validate() throws org.apache.thrift.TException {
+    // check for required fields
+    // check for sub-struct validity
+    if (range != null) {
+      range.validate();
+    }
+  }
+
+  private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
+    try {
+      write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
+    } catch (org.apache.thrift.TException te) {
+      throw new java.io.IOException(te);
+    }
+  }
+
+  private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
+    try {
+      // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor.
+      __isset_bitfield = 0;
+      read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
+    } catch (org.apache.thrift.TException te) {
+      throw new java.io.IOException(te);
+    }
+  }
+
+  private static class ScanOptionsStandardSchemeFactory implements SchemeFactory {
+    public ScanOptionsStandardScheme getScheme() {
+      return new ScanOptionsStandardScheme();
+    }
+  }
+
+  private static class ScanOptionsStandardScheme extends StandardScheme<ScanOptions> {
+
+    public void read(org.apache.thrift.protocol.TProtocol iprot, ScanOptions struct) throws org.apache.thrift.TException {
+      org.apache.thrift.protocol.TField schemeField;
+      iprot.readStructBegin();
+      while (true)
+      {
+        schemeField = iprot.readFieldBegin();
+        if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { 
+          break;
+        }
+        switch (schemeField.id) {
+          case 1: // AUTHORIZATIONS
+            if (schemeField.type == org.apache.thrift.protocol.TType.SET) {
+              {
+                org.apache.thrift.protocol.TSet _set18 = iprot.readSetBegin();
+                struct.authorizations = new HashSet<ByteBuffer>(2*_set18.size);
+                for (int _i19 = 0; _i19 < _set18.size; ++_i19)
+                {
+                  ByteBuffer _elem20; // required
+                  _elem20 = iprot.readBinary();
+                  struct.authorizations.add(_elem20);
+                }
+                iprot.readSetEnd();
+              }
+              struct.setAuthorizationsIsSet(true);
+            } else { 
+              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+            }
+            break;
+          case 2: // RANGE
+            if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
+              struct.range = new Range();
+              struct.range.read(iprot);
+              struct.setRangeIsSet(true);
+            } else { 
+              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+            }
+            break;
+          case 3: // COLUMNS
+            if (schemeField.type == org.apache.thrift.protocol.TType.LIST) {
+              {
+                org.apache.thrift.protocol.TList _list21 = iprot.readListBegin();
+                struct.columns = new ArrayList<ScanColumn>(_list21.size);
+                for (int _i22 = 0; _i22 < _list21.size; ++_i22)
+                {
+                  ScanColumn _elem23; // required
+                  _elem23 = new ScanColumn();
+                  _elem23.read(iprot);
+                  struct.columns.add(_elem23);
+                }
+                iprot.readListEnd();
+              }
+              struct.setColumnsIsSet(true);
+            } else { 
+              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+            }
+            break;
+          case 4: // ITERATORS
+            if (schemeField.type == org.apache.thrift.protocol.TType.LIST) {
+              {
+                org.apache.thrift.protocol.TList _list24 = iprot.readListBegin();
+                struct.iterators = new ArrayList<IteratorSetting>(_list24.size);
+                for (int _i25 = 0; _i25 < _list24.size; ++_i25)
+                {
+                  IteratorSetting _elem26; // required
+                  _elem26 = new IteratorSetting();
+                  _elem26.read(iprot);
+                  struct.iterators.add(_elem26);
+                }
+                iprot.readListEnd();
+              }
+              struct.setIteratorsIsSet(true);
+            } else { 
+              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+            }
+            break;
+          case 5: // BUFFER_SIZE
+            if (schemeField.type == org.apache.thrift.protocol.TType.I32) {
+              struct.bufferSize = iprot.readI32();
+              struct.setBufferSizeIsSet(true);
+            } else { 
+              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+            }
+            break;
+          default:
+            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+        }
+        iprot.readFieldEnd();
+      }
+      iprot.readStructEnd();
+
+      // check for required fields of primitive type, which can't be checked in the validate method
+      struct.validate();
+    }
+
+    public void write(org.apache.thrift.protocol.TProtocol oprot, ScanOptions struct) throws org.apache.thrift.TException {
+      struct.validate();
+
+      oprot.writeStructBegin(STRUCT_DESC);
+      if (struct.authorizations != null) {
+        if (struct.isSetAuthorizations()) {
+          oprot.writeFieldBegin(AUTHORIZATIONS_FIELD_DESC);
+          {
+            oprot.writeSetBegin(new org.apache.thrift.protocol.TSet(org.apache.thrift.protocol.TType.STRING, struct.authorizations.size()));
+            for (ByteBuffer _iter27 : struct.authorizations)
+            {
+              oprot.writeBinary(_iter27);
+            }
+            oprot.writeSetEnd();
+          }
+          oprot.writeFieldEnd();
+        }
+      }
+      if (struct.range != null) {
+        if (struct.isSetRange()) {
+          oprot.writeFieldBegin(RANGE_FIELD_DESC);
+          struct.range.write(oprot);
+          oprot.writeFieldEnd();
+        }
+      }
+      if (struct.columns != null) {
+        if (struct.isSetColumns()) {
+          oprot.writeFieldBegin(COLUMNS_FIELD_DESC);
+          {
+            oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, struct.columns.size()));
+            for (ScanColumn _iter28 : struct.columns)
+            {
+              _iter28.write(oprot);
+            }
+            oprot.writeListEnd();
+          }
+          oprot.writeFieldEnd();
+        }
+      }
+      if (struct.iterators != null) {
+        if (struct.isSetIterators()) {
+          oprot.writeFieldBegin(ITERATORS_FIELD_DESC);
+          {
+            oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, struct.iterators.size()));
+            for (IteratorSetting _iter29 : struct.iterators)
+            {
+              _iter29.write(oprot);
+            }
+            oprot.writeListEnd();
+          }
+          oprot.writeFieldEnd();
+        }
+      }
+      if (struct.isSetBufferSize()) {
+        oprot.writeFieldBegin(BUFFER_SIZE_FIELD_DESC);
+        oprot.writeI32(struct.bufferSize);
+        oprot.writeFieldEnd();
+      }
+      oprot.writeFieldStop();
+      oprot.writeStructEnd();
+    }
+
+  }
+
+  private static class ScanOptionsTupleSchemeFactory implements SchemeFactory {
+    public ScanOptionsTupleScheme getScheme() {
+      return new ScanOptionsTupleScheme();
+    }
+  }
+
+  private static class ScanOptionsTupleScheme extends TupleScheme<ScanOptions> {
+
+    @Override
+    public void write(org.apache.thrift.protocol.TProtocol prot, ScanOptions struct) throws org.apache.thrift.TException {
+      TTupleProtocol oprot = (TTupleProtocol) prot;
+      BitSet optionals = new BitSet();
+      if (struct.isSetAuthorizations()) {
+        optionals.set(0);
+      }
+      if (struct.isSetRange()) {
+        optionals.set(1);
+      }
+      if (struct.isSetColumns()) {
+        optionals.set(2);
+      }
+      if (struct.isSetIterators()) {
+        optionals.set(3);
+      }
+      if (struct.isSetBufferSize()) {
+        optionals.set(4);
+      }
+      oprot.writeBitSet(optionals, 5);
+      if (struct.isSetAuthorizations()) {
+        {
+          oprot.writeI32(struct.authorizations.size());
+          for (ByteBuffer _iter30 : struct.authorizations)
+          {
+            oprot.writeBinary(_iter30);
+          }
+        }
+      }
+      if (struct.isSetRange()) {
+        struct.range.write(oprot);
+      }
+      if (struct.isSetColumns()) {
+        {
+          oprot.writeI32(struct.columns.size());
+          for (ScanColumn _iter31 : struct.columns)
+          {
+            _iter31.write(oprot);
+          }
+        }
+      }
+      if (struct.isSetIterators()) {
+        {
+          oprot.writeI32(struct.iterators.size());
+          for (IteratorSetting _iter32 : struct.iterators)
+          {
+            _iter32.write(oprot);
+          }
+        }
+      }
+      if (struct.isSetBufferSize()) {
+        oprot.writeI32(struct.bufferSize);
+      }
+    }
+
+    @Override
+    public void read(org.apache.thrift.protocol.TProtocol prot, ScanOptions struct) throws org.apache.thrift.TException {
+      TTupleProtocol iprot = (TTupleProtocol) prot;
+      BitSet incoming = iprot.readBitSet(5);
+      if (incoming.get(0)) {
+        {
+          org.apache.thrift.protocol.TSet _set33 = new org.apache.thrift.protocol.TSet(org.apache.thrift.protocol.TType.STRING, iprot.readI32());
+          struct.authorizations = new HashSet<ByteBuffer>(2*_set33.size);
+          for (int _i34 = 0; _i34 < _set33.size; ++_i34)
+          {
+            ByteBuffer _elem35; // required
+            _elem35 = iprot.readBinary();
+            struct.authorizations.add(_elem35);
+          }
+        }
+        struct.setAuthorizationsIsSet(true);
+      }
+      if (incoming.get(1)) {
+        struct.range = new Range();
+        struct.range.read(iprot);
+        struct.setRangeIsSet(true);
+      }
+      if (incoming.get(2)) {
+        {
+          org.apache.thrift.protocol.TList _list36 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, iprot.readI32());
+          struct.columns = new ArrayList<ScanColumn>(_list36.size);
+          for (int _i37 = 0; _i37 < _list36.size; ++_i37)
+          {
+            ScanColumn _elem38; // required
+            _elem38 = new ScanColumn();
+            _elem38.read(iprot);
+            struct.columns.add(_elem38);
+          }
+        }
+        struct.setColumnsIsSet(true);
+      }
+      if (incoming.get(3)) {
+        {
+          org.apache.thrift.protocol.TList _list39 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, iprot.readI32());
+          struct.iterators = new ArrayList<IteratorSetting>(_list39.size);
+          for (int _i40 = 0; _i40 < _list39.size; ++_i40)
+          {
+            IteratorSetting _elem41; // required
+            _elem41 = new IteratorSetting();
+            _elem41.read(iprot);
+            struct.iterators.add(_elem41);
+          }
+        }
+        struct.setIteratorsIsSet(true);
+      }
+      if (incoming.get(4)) {
+        struct.bufferSize = iprot.readI32();
+        struct.setBufferSizeIsSet(true);
+      }
+    }
+  }
+
+}
+

Propchange: accumulo/trunk/proxy/src/main/java/org/apache/accumulo/proxy/thrift/ScanOptions.java
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: accumulo/trunk/proxy/src/main/thrift/proxy.thrift
URL: http://svn.apache.org/viewvc/accumulo/trunk/proxy/src/main/thrift/proxy.thrift?rev=1437820&r1=1437819&r2=1437820&view=diff
==============================================================================
--- accumulo/trunk/proxy/src/main/thrift/proxy.thrift (original)
+++ accumulo/trunk/proxy/src/main/thrift/proxy.thrift Thu Jan 24 01:13:24 2013
@@ -17,11 +17,11 @@
 namespace java org.apache.accumulo.proxy.thrift
 
 struct Key {
-	1:binary row;
-	2:binary colFamily;
-	3:binary colQualifier;
-	4:binary colVisibility;
-	5:optional i64 timestamp
+  1:binary row;
+  2:binary colFamily;
+  3:binary colQualifier;
+  4:binary colVisibility;
+  5:optional i64 timestamp
 }
 
 enum PartialKey {
@@ -34,47 +34,67 @@ enum PartialKey {
 }
 
 struct ColumnUpdate {
-	1:binary colFamily;
-	2:binary colQualifier;
-	3:optional binary colVisibility;
-	4:optional i64 timestamp;
-	5:optional binary value;
-	6:optional bool deleteCell;
+  1:binary colFamily,
+  2:binary colQualifier,
+  3:optional binary colVisibility,
+  4:optional i64 timestamp,
+  5:optional binary value,
+  6:optional bool deleteCell
 }
 
 struct KeyValue {
-	1:Key key,
-	2:binary value
+  1:Key key,
+  2:binary value
 }
 
 struct ScanResult {
-	1:list<KeyValue> results,
-	2:bool more
+  1:list<KeyValue> results,
+  2:bool more
 }
 
 struct Range {
-        1:Key start,
-	2:bool startInclusive
-        3:Key stop,
-	4:bool stopInclusive
+  1:Key start,
+  2:bool startInclusive
+  3:Key stop,
+  4:bool stopInclusive
 }
 
-struct UserPass
-{
-  1:string username;
-  2:binary password;
+struct ScanColumn {
+  1:binary colFamily,
+  2:optional binary colQualifier
 }
 
-struct IteratorSetting {
-  1: i32 priority;
-  2: string name;
-  3: string iteratorClass;
-  4: map<string,string> properties;
+struct UserPass {
+  1:string username,
+  2:binary password
 }
 
-struct KeyValueAndPeek{
-    1:KeyValue keyValue;
-    2:bool hasNext;
+struct IteratorSetting {
+  1: i32 priority,
+  2: string name,
+  3: string iteratorClass,
+  4: map<string,string> properties
+}
+
+struct ScanOptions {
+  1:optional set<binary> authorizations;
+  2:optional Range range,
+  3:optional list<ScanColumn> columns;
+  4:optional list<IteratorSetting> iterators;
+  5:optional i32 bufferSize;
+} 
+
+struct BatchScanOptions {
+  1:optional set<binary> authorizations;
+  2:optional list<Range> ranges,
+  3:optional list<ScanColumn> columns;
+  4:optional list<IteratorSetting> iterators;
+  5:optional i32 bufferSize;
+} 
+
+struct KeyValueAndPeek {
+  1:KeyValue keyValue,
+  2:bool hasNext
 }
 
 enum TablePermission {
@@ -121,17 +141,17 @@ struct Column {
 }
 
 struct ActiveScan {
-    1:string client
-    2:string user
-    3:string table
-    4:i64 age
-    5:i64 idleTime
-    6:ScanType type
-    7:ScanState state
-    8:KeyExtent extent
-    9:list<Column> columns
-    10:list<IteratorSetting> iterators
-    11:list<binary> authorizations
+  1:string client
+  2:string user
+  3:string table
+  4:i64 age
+  5:i64 idleTime
+  6:ScanType type
+  7:ScanState state
+  8:KeyExtent extent
+  9:list<Column> columns
+  10:list<IteratorSetting> iterators
+  11:list<binary> authorizations
 }
 
 enum CompactionType {
@@ -150,16 +170,16 @@ enum CompactionReason {
 }
 
 struct ActiveCompaction {
-    1:KeyExtent extent
-    2:i64 age
-    3:list<string> inputFiles
-    4:string outputFile
-    5:CompactionType type
-    6:CompactionReason reason
-    7:string localityGroup
-    8:i64 entriesRead
-    9:i64 entriesWritten
-    10:list<IteratorSetting> iterators;
+  1:KeyExtent extent
+  2:i64 age
+  3:list<string> inputFiles
+  4:string outputFile
+  5:CompactionType type
+  6:CompactionReason reason
+  7:string localityGroup
+  8:i64 entriesRead
+  9:i64 entriesWritten
+  10:list<IteratorSetting> iterators;
 }
 
 enum IteratorScope {
@@ -173,37 +193,32 @@ enum TimeType {
   MILLIS
 }
 
-exception UnknownScanner
-{
- 1:string msg;
+exception UnknownScanner {
+  1:string msg
 }
 
-exception UnknownWriter
-{
- 1:string msg;
+exception UnknownWriter {
+  1:string msg
 }
 
-exception NoMoreEntriesException
-{
- 1:string msg;
+exception NoMoreEntriesException {
+  1:string msg
 }
 
-exception AccumuloException
-{
-  1:string msg;
+exception AccumuloException {
+  1:string msg
 }
-exception AccumuloSecurityException
-{
-  1:string msg;
+
+exception AccumuloSecurityException {
+  1:string msg
 }
-exception TableNotFoundException
-{
-  1:string msg;
+
+exception TableNotFoundException {
+  1:string msg
 }
 
-exception TableExistsException
-{
-  1:string msg;
+exception TableExistsException {
+  1:string msg
 }
 
 service AccumuloProxy
@@ -211,81 +226,99 @@ service AccumuloProxy
   bool ping (1:UserPass userpass);
 
   // table operations
-  i32 addConstraint (1:UserPass userpass, 2:string tableName, 3:string constraintClassName) throws (1:AccumuloException ouch1, 2:AccumuloSecurityException ouch2, 3:TableNotFoundException ouch3);
-  void addSplits (1:UserPass userpass, 2:string tableName, 3:set<binary> splits) throws (1:TableNotFoundException ouch1, 2:AccumuloException ouch2, 3:AccumuloSecurityException ouch3);
-  void attachIterator (1:UserPass userpass, 2:string tableName, 3:IteratorSetting setting, 4:set<IteratorScope> scopes) throws (1:AccumuloSecurityException ouch1, 2:AccumuloException ouch2, 3:TableNotFoundException ouch3);
-  void checkIteratorConflicts (1:UserPass userpass, 2:string tableName, 3:IteratorSetting setting, 4:set<IteratorScope> scopes) throws (1:AccumuloException ouch1, 2:TableNotFoundException ouch2);
-  void clearLocatorCache (1:UserPass userpass, 2:string tableName) throws (1:TableNotFoundException ouch1);
-  void cloneTable (1:UserPass userpass, 2:string tableName, 3:string newTableName, 4:bool flush, 5:map<string,string> propertiesToSet, 6:set<string> propertiesToExclude) throws (1:AccumuloException ouch1, 2:AccumuloSecurityException ouch2, 3:TableNotFoundException ouch3, 4:TableExistsException ouch4);
-  void compactTable (1:UserPass userpass, 2:string tableName, 3:binary startRow, 4:binary endRow, 5:list<IteratorSetting> iterators, 6:bool flush, 7:bool wait) throws (1:AccumuloSecurityException ouch1, 2:TableNotFoundException ouch2, 3:AccumuloException ouch3);
-  void createTable (1:UserPass userpass, 2:string tableName, 3:bool versioningIter, 4:TimeType type) throws (1:AccumuloException ouch1, 2:AccumuloSecurityException ouch2, 3:TableExistsException ouch3);
-  void deleteTable (1:UserPass userpass, 2:string tableName) throws (1:AccumuloException ouch1, 2:AccumuloSecurityException ouch2, 3:TableNotFoundException ouch3);
-  void deleteRows (1:UserPass userpass, 2:string tableName, 3:binary startRow, 4:binary endRow) throws (1:AccumuloException ouch1, 2:AccumuloSecurityException ouch2, 3:TableNotFoundException ouch3);
-  void exportTable (1:UserPass userpass, 2:string tableName, 3:string exportDir) throws (1:TableNotFoundException ouch1, 2:AccumuloException ouch2, 3:AccumuloSecurityException ouch3);
-  void flushTable (1:UserPass userpass, 2:string tableName, 3:binary startRow, 4:binary endRow, 5:bool wait) throws (1:AccumuloException ouch1, 2:AccumuloSecurityException ouch2);
-  map<string,set<string>> getLocalityGroups (1:UserPass userpass, 2:string tableName) throws (1:AccumuloException ouch1, 2:TableNotFoundException ouch2);
-  IteratorSetting getIteratorSetting (1:UserPass userpass, 2:string tableName, 3:string iteratorName, 4:IteratorScope scope) throws (1:AccumuloSecurityException ouch1, 2:AccumuloException ouch2, 3:TableNotFoundException ouch3);
-  binary getMaxRow (1:UserPass userpass, 2:string tableName, 3:list<binary> auths, 4:binary startRow, 5:bool startInclusive, 6:binary endRow, 7:bool endInclusive) throws (1:TableNotFoundException ouch1, 2:AccumuloException ouch2, 3:AccumuloSecurityException ouch3);
-  map<string,string> getTableProperties (1:UserPass userpass, 2:string tableName) throws (1:AccumuloException ouch1, 2:TableNotFoundException ouch2);
-  list<binary> getSplits (1:UserPass userpass, 2:string tableName, 3:i32 maxSplits) throws (1:TableNotFoundException ouch1);
-  void importDirectory (1:UserPass userpass, 2:string tableName, 3:string importDir, 4:string failureDir, 5:bool setTime) throws (1:TableNotFoundException ouch1, 2:AccumuloException ouch3, 3:AccumuloSecurityException ouch4);
-  void importTable (1:UserPass userpass, 2:string tableName, 3:string importDir) throws (1:TableExistsException ouch1, 2:AccumuloException ouch2, 3:AccumuloSecurityException ouch3);
+  i32 addConstraint (1:UserPass userpass, 2:string tableName, 3:string constraintClassName)                 throws (1:AccumuloException ouch1, 2:AccumuloSecurityException ouch2, 3:TableNotFoundException ouch3);
+  void addSplits (1:UserPass userpass, 2:string tableName, 3:set<binary> splits)                            throws (1:TableNotFoundException ouch1, 2:AccumuloException ouch2, 3:AccumuloSecurityException ouch3);
+  void attachIterator (1:UserPass userpass, 2:string tableName, 3:IteratorSetting setting, 
+                       4:set<IteratorScope> scopes) 
+                                                                                                            throws (1:AccumuloSecurityException ouch1, 2:AccumuloException ouch2, 3:TableNotFoundException ouch3);
+  void checkIteratorConflicts (1:UserPass userpass, 2:string tableName, 3:IteratorSetting setting, 
+                               4:set<IteratorScope> scopes) 
+                                                                                                            throws (1:AccumuloException ouch1, 2:TableNotFoundException ouch2);
+  void clearLocatorCache (1:UserPass userpass, 2:string tableName)                                          throws (1:TableNotFoundException ouch1);
+  void cloneTable (1:UserPass userpass, 2:string tableName, 3:string newTableName, 4:bool flush, 
+                   5:map<string,string> propertiesToSet, 6:set<string> propertiesToExclude) 
+                                                                                                            throws (1:AccumuloException ouch1, 2:AccumuloSecurityException ouch2, 3:TableNotFoundException ouch3, 4:TableExistsException ouch4);
+  void compactTable (1:UserPass userpass, 2:string tableName, 3:binary startRow, 4:binary endRow, 
+		     5:list<IteratorSetting> iterators, 6:bool flush, 7:bool wait) 
+                                                                                                            throws (1:AccumuloSecurityException ouch1, 2:TableNotFoundException ouch2, 3:AccumuloException ouch3);
+  void createTable (1:UserPass userpass, 2:string tableName, 3:bool versioningIter, 4:TimeType type)        throws (1:AccumuloException ouch1, 2:AccumuloSecurityException ouch2, 3:TableExistsException ouch3);
+  void deleteTable (1:UserPass userpass, 2:string tableName)                                                throws (1:AccumuloException ouch1, 2:AccumuloSecurityException ouch2, 3:TableNotFoundException ouch3);
+  void deleteRows (1:UserPass userpass, 2:string tableName, 3:binary startRow, 4:binary endRow)             throws (1:AccumuloException ouch1, 2:AccumuloSecurityException ouch2, 3:TableNotFoundException ouch3);
+  void exportTable (1:UserPass userpass, 2:string tableName, 3:string exportDir)                            throws (1:TableNotFoundException ouch1, 2:AccumuloException ouch2, 3:AccumuloSecurityException ouch3);
+  void flushTable (1:UserPass userpass, 2:string tableName, 3:binary startRow, 4:binary endRow, 
+                   5:bool wait)
+                                                                                                            throws (1:AccumuloException ouch1, 2:AccumuloSecurityException ouch2);
+  map<string,set<string>> getLocalityGroups (1:UserPass userpass, 2:string tableName)                       throws (1:AccumuloException ouch1, 2:TableNotFoundException ouch2);
+  IteratorSetting getIteratorSetting (1:UserPass userpass, 2:string tableName, 
+                                      3:string iteratorName, 4:IteratorScope scope) 
+                                                                                                            throws (1:AccumuloSecurityException ouch1, 2:AccumuloException ouch2, 3:TableNotFoundException ouch3);
+  binary getMaxRow (1:UserPass userpass, 2:string tableName, 3:list<binary> auths, 4:binary startRow, 
+                    5:bool startInclusive, 6:binary endRow, 7:bool endInclusive) 
+                                                                                                            throws (1:TableNotFoundException ouch1, 2:AccumuloException ouch2, 3:AccumuloSecurityException ouch3);
+  map<string,string> getTableProperties (1:UserPass userpass, 2:string tableName)                           throws (1:AccumuloException ouch1, 2:TableNotFoundException ouch2);
+  list<binary> getSplits (1:UserPass userpass, 2:string tableName, 3:i32 maxSplits)                         throws (1:TableNotFoundException ouch1);
+  void importDirectory (1:UserPass userpass, 2:string tableName, 3:string importDir, 
+                        4:string failureDir, 5:bool setTime) 
+                                                                                                            throws (1:TableNotFoundException ouch1, 2:AccumuloException ouch3, 3:AccumuloSecurityException ouch4);
+  void importTable (1:UserPass userpass, 2:string tableName, 3:string importDir)                            throws (1:TableExistsException ouch1, 2:AccumuloException ouch2, 3:AccumuloSecurityException ouch3);
   set<string> listTables (1:UserPass userpass);
-  map<string,set<IteratorScope>> listIterators (1:UserPass userpass, 2:string tableName) throws (1:AccumuloSecurityException ouch1, 2:AccumuloException ouch2, 3:TableNotFoundException ouch3);
-  map<string,i32> listConstraints (1:UserPass userpass, 2:string tableName) throws (1:AccumuloException ouch1, 2:TableNotFoundException ouch2);
-  void mergeTablets (1:UserPass userpass, 2:string tableName, 3:binary startRow, 4:binary endRow) throws (1:AccumuloException ouch1, 2:AccumuloSecurityException ouch2, 3:TableNotFoundException ouch3);
-  void offlineTable (1:UserPass userpass, 2:string tableName) throws (1:AccumuloSecurityException ouch1, 2:AccumuloException ouch2, 3:TableNotFoundException ouch3);
-  void onlineTable (1:UserPass userpass, 2:string tableName) throws (1:AccumuloSecurityException ouch1, 2:AccumuloException ouch2, 3:TableNotFoundException ouch3);
-  void removeConstraint (1:UserPass userpass, 2:string tableName, 3:i32 constraint) throws (1:AccumuloException ouch1, 2:AccumuloSecurityException ouch2);
-  void removeIterator (1:UserPass userpass, 2:string tableName, 3:string iterName, 4:set<IteratorScope> scopes) throws (1:AccumuloSecurityException ouch1, 2:AccumuloException ouch2, 3:TableNotFoundException ouch3);
-  void removeTableProperty (1:UserPass userpass, 2:string tableName, 3:string property) throws (1:AccumuloException ouch1, 2:AccumuloSecurityException ouch2);
-  void renameTable (1:UserPass userpass, 2:string oldTableName, 3:string newTableName) throws (1:AccumuloSecurityException ouch1, 2:TableNotFoundException ouch2, 3:AccumuloException ouch3, 4:TableExistsException ouch4);
-  void setLocalityGroups (1:UserPass userpass, 2:string tableName, 3:map<string,set<string>> groups) throws (1:AccumuloException ouch1, 2:AccumuloSecurityException ouch2, 3:TableNotFoundException ouch3);
-  void setTableProperty (1:UserPass userpass, 2:string tableName, 3:string property, 4:string value) throws (1:AccumuloException ouch1, 2:AccumuloSecurityException ouch2);
-  set<Range> splitRangeByTablets (1:UserPass userpass, 2:string tableName, 3:Range range, 4:i32 maxSplits) throws (1:AccumuloException ouch1, 2:AccumuloSecurityException ouch2, 3:TableNotFoundException ouch3);
+  map<string,set<IteratorScope>> listIterators (1:UserPass userpass, 2:string tableName)                    throws (1:AccumuloSecurityException ouch1, 2:AccumuloException ouch2, 3:TableNotFoundException ouch3);
+  map<string,i32> listConstraints (1:UserPass userpass, 2:string tableName)                                 throws (1:AccumuloException ouch1, 2:TableNotFoundException ouch2);
+  void mergeTablets (1:UserPass userpass, 2:string tableName, 3:binary startRow, 4:binary endRow)           throws (1:AccumuloException ouch1, 2:AccumuloSecurityException ouch2, 3:TableNotFoundException ouch3);
+  void offlineTable (1:UserPass userpass, 2:string tableName)                                               throws (1:AccumuloSecurityException ouch1, 2:AccumuloException ouch2, 3:TableNotFoundException ouch3);
+  void onlineTable (1:UserPass userpass, 2:string tableName)                                                throws (1:AccumuloSecurityException ouch1, 2:AccumuloException ouch2, 3:TableNotFoundException ouch3);
+  void removeConstraint (1:UserPass userpass, 2:string tableName, 3:i32 constraint)                         throws (1:AccumuloException ouch1, 2:AccumuloSecurityException ouch2);
+  void removeIterator (1:UserPass userpass, 2:string tableName, 3:string iterName, 
+                       4:set<IteratorScope> scopes)
+                                                                                                            throws (1:AccumuloSecurityException ouch1, 2:AccumuloException ouch2, 3:TableNotFoundException ouch3);
+  void removeTableProperty (1:UserPass userpass, 2:string tableName, 3:string property)                     throws (1:AccumuloException ouch1, 2:AccumuloSecurityException ouch2);
+  void renameTable (1:UserPass userpass, 2:string oldTableName, 3:string newTableName)                      throws (1:AccumuloSecurityException ouch1, 2:TableNotFoundException ouch2, 3:AccumuloException ouch3, 4:TableExistsException ouch4);
+  void setLocalityGroups (1:UserPass userpass, 2:string tableName, 3:map<string,set<string>> groups)        throws (1:AccumuloException ouch1, 2:AccumuloSecurityException ouch2, 3:TableNotFoundException ouch3);
+  void setTableProperty (1:UserPass userpass, 2:string tableName, 3:string property, 4:string value)        throws (1:AccumuloException ouch1, 2:AccumuloSecurityException ouch2);
+  set<Range> splitRangeByTablets (1:UserPass userpass, 2:string tableName, 3:Range range, 4:i32 maxSplits)  throws (1:AccumuloException ouch1, 2:AccumuloSecurityException ouch2, 3:TableNotFoundException ouch3);
   bool tableExists (1:UserPass userpass, 2:string tableName);
   map<string,string> tableIdMap (1:UserPass userpass);
 
   // instance operations
-  void pingTabletServer(1:UserPass userpass, 2:string tserver) throws (1:AccumuloException ouch1, 2:AccumuloSecurityException ouch2);
-  list<ActiveScan> getActiveScans (1:UserPass userpass, 2:string tserver) throws (1:AccumuloException ouch1, 2:AccumuloSecurityException ouch2);
-  list<ActiveCompaction> getActiveCompactions(1:UserPass userpass, 2:string tserver) throws (1:AccumuloException ouch1, 2:AccumuloSecurityException ouch2);
-  map<string,string> getSiteConfiguration (1:UserPass userpass) throws (1:AccumuloException ouch1, 2:AccumuloSecurityException ouch2);
-  map<string,string> getSystemConfiguration (1:UserPass userpass) throws (1:AccumuloException ouch1, 2:AccumuloSecurityException ouch2);
+  void pingTabletServer(1:UserPass userpass, 2:string tserver)                                            throws (1:AccumuloException ouch1, 2:AccumuloSecurityException ouch2);
+  list<ActiveScan> getActiveScans (1:UserPass userpass, 2:string tserver)                                 throws (1:AccumuloException ouch1, 2:AccumuloSecurityException ouch2);
+  list<ActiveCompaction> getActiveCompactions(1:UserPass userpass, 2:string tserver)                      throws (1:AccumuloException ouch1, 2:AccumuloSecurityException ouch2);
+  map<string,string> getSiteConfiguration (1:UserPass userpass)                                           throws (1:AccumuloException ouch1, 2:AccumuloSecurityException ouch2);
+  map<string,string> getSystemConfiguration (1:UserPass userpass)                                         throws (1:AccumuloException ouch1, 2:AccumuloSecurityException ouch2);
   list<string> getTabletServers (1:UserPass userpass);
-  void removeProperty (1:UserPass userpass, 2:string property) throws (1:AccumuloException ouch1, 2:AccumuloSecurityException ouch2);
-  void setProperty (1:UserPass userpass, 2:string property, 3:string value) throws (1:AccumuloException ouch1, 2:AccumuloSecurityException ouch2);
-  bool testClassLoad (1:UserPass userpass, 2:string className, 3:string asTypeName) throws (1:AccumuloException ouch1, 2:AccumuloSecurityException ouch2);
+  void removeProperty (1:UserPass userpass, 2:string property)                                            throws (1:AccumuloException ouch1, 2:AccumuloSecurityException ouch2);
+  void setProperty (1:UserPass userpass, 2:string property, 3:string value)                               throws (1:AccumuloException ouch1, 2:AccumuloSecurityException ouch2);
+  bool testClassLoad (1:UserPass userpass, 2:string className, 3:string asTypeName)                       throws (1:AccumuloException ouch1, 2:AccumuloSecurityException ouch2);
 
   // security operations
-  bool authenticateUser (1:UserPass userpass, 2:string user, 3:binary password) throws (1:AccumuloException ouch1, 2:AccumuloSecurityException ouch2);
-  void changeUserAuthorizations (1:UserPass userpass, 2:string user, 3:set<binary> authorizations) throws (1:AccumuloException ouch1, 2:AccumuloSecurityException ouch2);
-  void changeUserPassword (1:UserPass userpass, 2:string user, 3:binary password) throws (1:AccumuloException ouch1, 2:AccumuloSecurityException ouch2);
-  void createUser (1:UserPass userpass, 2:string user, 3:binary password) throws (1:AccumuloException ouch1, 2:AccumuloSecurityException ouch2);
-  void dropUser (1:UserPass userpass, 2:string user) throws (1:AccumuloException ouch1, 2:AccumuloSecurityException ouch2);
-  list<binary> getUserAuthorizations (1:UserPass userpass, 2:string user) throws (1:AccumuloException ouch1, 2:AccumuloSecurityException ouch2);
-  void grantSystemPermission (1:UserPass userpass, 2:string user, 3:SystemPermission perm) throws (1:AccumuloException ouch1, 2:AccumuloSecurityException ouch2);
-  void grantTablePermission (1:UserPass userpass, 2:string user, 3:string table, 4:TablePermission perm) throws (1:AccumuloException ouch1, 2:AccumuloSecurityException ouch2);
-  bool hasSystemPermission (1:UserPass userpass, 2:string user, 3:SystemPermission perm) throws (1:AccumuloException ouch1, 2:AccumuloSecurityException ouch2);
-  bool hasTablePermission (1:UserPass userpass, 2:string user, 3:string table, 4:TablePermission perm) throws (1:AccumuloException ouch1, 2:AccumuloSecurityException ouch2);
-  set<string> listUsers (1:UserPass userpass) throws (1:AccumuloException ouch1, 2:AccumuloSecurityException ouch2);
-  void revokeSystemPermission (1:UserPass userpass, 2:string user, 3:SystemPermission perm) throws (1:AccumuloException ouch1, 2:AccumuloSecurityException ouch2);
+  bool authenticateUser (1:UserPass userpass, 2:string user, 3:binary password)                           throws (1:AccumuloException ouch1, 2:AccumuloSecurityException ouch2);
+  void changeUserAuthorizations (1:UserPass userpass, 2:string user, 3:set<binary> authorizations)        throws (1:AccumuloException ouch1, 2:AccumuloSecurityException ouch2);
+  void changeUserPassword (1:UserPass userpass, 2:string user, 3:binary password)                         throws (1:AccumuloException ouch1, 2:AccumuloSecurityException ouch2);
+  void createUser (1:UserPass userpass, 2:string user, 3:binary password)                                 throws (1:AccumuloException ouch1, 2:AccumuloSecurityException ouch2);
+  void dropUser (1:UserPass userpass, 2:string user)                                                      throws (1:AccumuloException ouch1, 2:AccumuloSecurityException ouch2);
+  list<binary> getUserAuthorizations (1:UserPass userpass, 2:string user)                                 throws (1:AccumuloException ouch1, 2:AccumuloSecurityException ouch2);
+  void grantSystemPermission (1:UserPass userpass, 2:string user, 3:SystemPermission perm)                throws (1:AccumuloException ouch1, 2:AccumuloSecurityException ouch2);
+  void grantTablePermission (1:UserPass userpass, 2:string user, 3:string table, 4:TablePermission perm)  throws (1:AccumuloException ouch1, 2:AccumuloSecurityException ouch2);
+  bool hasSystemPermission (1:UserPass userpass, 2:string user, 3:SystemPermission perm)                  throws (1:AccumuloException ouch1, 2:AccumuloSecurityException ouch2);
+  bool hasTablePermission (1:UserPass userpass, 2:string user, 3:string table, 4:TablePermission perm)    throws (1:AccumuloException ouch1, 2:AccumuloSecurityException ouch2);
+  set<string> listUsers (1:UserPass userpass)                                                             throws (1:AccumuloException ouch1, 2:AccumuloSecurityException ouch2);
+  void revokeSystemPermission (1:UserPass userpass, 2:string user, 3:SystemPermission perm)               throws (1:AccumuloException ouch1, 2:AccumuloSecurityException ouch2);
   void revokeTablePermission (1:UserPass userpass, 2:string user, 3:string table, 4:TablePermission perm) throws (1:AccumuloException ouch1, 2:AccumuloSecurityException ouch2);
 
 
   // scanning
-  string createBatchScanner(1:UserPass userpass, 2:string tableName, 3:set<binary> authorizations, 4:list<IteratorSetting> iteratorSetting, 5:list<Range> range);
-  string createScanner(1:UserPass userpass, 2:string tableName, 3:set<binary> authorizations, 4:list<IteratorSetting> iteratorSetting, 5:Range range);
+  string createBatchScanner(1:UserPass userpass, 2:string tableName, 3:BatchScanOptions options)          throws (1:AccumuloException ouch1, 2:AccumuloSecurityException ouch2);
+  string createScanner(1:UserPass userpass, 2:string tableName, 3:ScanOptions options)                    throws (1:AccumuloException ouch1, 2:AccumuloSecurityException ouch2);
 
   // use the scanner
-  bool scanner_hasnext(1:string scanner) throws (1:UnknownScanner ouch1);
-  KeyValueAndPeek scanner_next(1:string scanner) throws(1:NoMoreEntriesException ouch1, 2:UnknownScanner ouch2, 3:AccumuloSecurityException ouch3);
-  ScanResult scanner_next_k(1:string scanner, 2:i32 k) throws(1:NoMoreEntriesException ouch1, 2:UnknownScanner ouch2, 3:AccumuloSecurityException ouch3);
-  void close_scanner(1:string scanner) throws (1:UnknownScanner ouch1);
+  bool scanner_hasnext(1:string scanner)                                                                throws(1:UnknownScanner ouch1);
+  KeyValueAndPeek scanner_next(1:string scanner)                                                        throws(1:NoMoreEntriesException ouch1, 2:UnknownScanner ouch2, 3:AccumuloSecurityException ouch3);
+  ScanResult scanner_next_k(1:string scanner, 2:i32 k)                                                  throws(1:NoMoreEntriesException ouch1, 2:UnknownScanner ouch2, 3:AccumuloSecurityException ouch3);
+  void close_scanner(1:string scanner)                                                                  throws (1:UnknownScanner ouch1);
 
   // writing
-  void updateAndFlush(1:UserPass userpass, 2:string tableName, 3:map<binary, list<ColumnUpdate>> cells);
-  string createWriter(1:UserPass userpass, 2:string tableName);
+  void updateAndFlush(1:UserPass userpass, 2:string tableName, 3:map<binary, list<ColumnUpdate>> cells) throws(1:AccumuloException outch1, 2:AccumuloSecurityException ouch2);
+  string createWriter(1:UserPass userpass, 2:string tableName)                                          throws(1:AccumuloException outch1, 2:AccumuloSecurityException ouch2);
 
   // use the writer
   oneway void writer_update(1:string writer, 2:map<binary, list<ColumnUpdate>> cells);

Modified: accumulo/trunk/proxy/src/test/java/org/apache/accumulo/proxy/SimpleTest.java
URL: http://svn.apache.org/viewvc/accumulo/trunk/proxy/src/test/java/org/apache/accumulo/proxy/SimpleTest.java?rev=1437820&r1=1437819&r2=1437820&view=diff
==============================================================================
--- accumulo/trunk/proxy/src/test/java/org/apache/accumulo/proxy/SimpleTest.java (original)
+++ accumulo/trunk/proxy/src/test/java/org/apache/accumulo/proxy/SimpleTest.java Thu Jan 24 01:13:24 2013
@@ -10,6 +10,7 @@ import java.nio.ByteBuffer;
 import java.util.Arrays;
 import java.util.Collections;
 import java.util.EnumSet;
+import java.util.HashMap;
 import java.util.HashSet;
 import java.util.List;
 import java.util.Map;
@@ -19,8 +20,9 @@ import java.util.Set;
 
 import org.apache.accumulo.core.iterators.DevNull;
 import org.apache.accumulo.core.iterators.SortedKeyValueIterator;
+import org.apache.accumulo.core.iterators.user.SummingCombiner;
 import org.apache.accumulo.core.util.UtilWaitThread;
-import org.apache.accumulo.proxy.Proxy;
+import org.apache.accumulo.examples.simple.constraints.NumericValueConstraint;
 import org.apache.accumulo.proxy.thrift.AccumuloProxy.Client;
 import org.apache.accumulo.proxy.thrift.ActiveCompaction;
 import org.apache.accumulo.proxy.thrift.ActiveScan;
@@ -29,6 +31,11 @@ import org.apache.accumulo.proxy.thrift.
 import org.apache.accumulo.proxy.thrift.CompactionType;
 import org.apache.accumulo.proxy.thrift.IteratorScope;
 import org.apache.accumulo.proxy.thrift.IteratorSetting;
+import org.apache.accumulo.proxy.thrift.Key;
+import org.apache.accumulo.proxy.thrift.Range;
+import org.apache.accumulo.proxy.thrift.ScanColumn;
+import org.apache.accumulo.proxy.thrift.ScanOptions;
+import org.apache.accumulo.proxy.thrift.ScanResult;
 import org.apache.accumulo.proxy.thrift.ScanState;
 import org.apache.accumulo.proxy.thrift.ScanType;
 import org.apache.accumulo.proxy.thrift.SystemPermission;
@@ -139,7 +146,7 @@ public class SimpleTest {
         String scanner;
         try {
           Client client2 = new TestProxyClient("localhost", proxyPort).proxy();
-          scanner = client2.createScanner(creds, "slow", null, null, null);
+          scanner = client2.createScanner(creds, "slow", null);
           client2.scanner_next_k(scanner, 10);
           client2.close_scanner(scanner);
         } catch (TException e) {
@@ -208,7 +215,7 @@ public class SimpleTest {
     assertTrue(c.outputFile.contains("default_tablet"));
   }
   
-  @Test
+  //@Test
   public void testSecurityOperations() throws Exception {
     // check password
     assertTrue(client.authenticateUser(creds, "root", s2bb(secret)));
@@ -256,7 +263,7 @@ public class SimpleTest {
     client.createTable(creds, "test", true, TimeType.MILLIS);
     // denied!
     try {
-      String scanner = client.createScanner(stooge, "test", null, null, null);
+      String scanner = client.createScanner(stooge, "test", null);
       client.scanner_next_k(scanner, 100);
       fail("stooge should not read table test");
     } catch (TException ex) {
@@ -265,14 +272,14 @@ public class SimpleTest {
     assertFalse(client.hasTablePermission(creds, "stooge", "test", TablePermission.READ));
     client.grantTablePermission(creds, "stooge", "test", TablePermission.READ);
     assertTrue(client.hasTablePermission(creds, "stooge", "test", TablePermission.READ));
-    String scanner = client.createScanner(stooge, "test", null, null, null);
+    String scanner = client.createScanner(stooge, "test", null);
     client.scanner_next_k(scanner, 10);
     client.close_scanner(scanner);
     // revoke
     client.revokeTablePermission(creds, "stooge", "test", TablePermission.READ);
     assertFalse(client.hasTablePermission(creds, "stooge", "test", TablePermission.READ));
     try {
-      scanner = client.createScanner(stooge, "test", null, null, null);
+      scanner = client.createScanner(stooge, "test", null);
       client.scanner_next_k(scanner, 100);
       fail("stooge should not read table test");
     } catch (TException ex) {
@@ -285,6 +292,100 @@ public class SimpleTest {
     
   }
   
+  @Test
+  public void testTableOperations() throws Exception {
+    client.createTable(creds, "test", true, TimeType.MILLIS);
+    // constraints
+    client.addConstraint(creds, "test", NumericValueConstraint.class.getName());
+    client.updateAndFlush(creds, "test", mutation("row1", "cf", "cq", "123"));
+    try {
+      client.updateAndFlush(creds, "test", mutation("row1", "cf", "cq", "x"));
+      fail("constraint did not fire");
+    } catch (Exception ex) {
+    }
+    client.removeConstraint(creds, "test", 1);
+    client.updateAndFlush(creds, "test", mutation("row1", "cf", "cq", "x"));
+    String scanner = client.createScanner(creds, "test", null);
+    ScanResult more = client.scanner_next_k(scanner, 2);
+    client.close_scanner(scanner);
+    assertFalse(more.isMore());
+    assertEquals(1, more.getResults().size());
+    assertEquals(s2bb("x"), more.getResults().get(0).value);
+    // splits, merge
+    client.addSplits(creds, "test", new HashSet<ByteBuffer>(Arrays.asList(s2bb("a"), s2bb("m"), s2bb("z"))));
+    List<ByteBuffer> splits = client.getSplits(creds, "test", 1);
+    assertEquals(Arrays.asList(s2bb("m")), splits);
+    client.mergeTablets(creds, "test", null, s2bb("m"));
+    splits = client.getSplits(creds, "test", 10);
+    assertEquals(Arrays.asList(s2bb("m"), s2bb("z")), splits);
+    client.mergeTablets(creds, "test", null, null);
+    splits = client.getSplits(creds, "test", 10);
+    List<ByteBuffer> empty = Collections.emptyList();
+    assertEquals(empty, splits);
+    // iterators
+    client.deleteTable(creds, "test");
+    client.createTable(creds, "test", true, TimeType.MILLIS);
+    HashMap<String, String> options = new HashMap<String, String>();
+    options.put("type", "STRING");
+    options.put("columns", "cf");
+    IteratorSetting setting = new IteratorSetting(10, "test", SummingCombiner.class.getName(), options);
+    client.attachIterator(creds, "test", setting, EnumSet.allOf(IteratorScope.class));
+    for (int i = 0; i < 10; i++) {
+      client.updateAndFlush(creds, "test", mutation("row1", "cf", "cq", "1"));
+    }
+    scanner = client.createScanner(creds, "test", null);
+    more = client.scanner_next_k(scanner, 2);
+    assertEquals("10", new String(more.getResults().get(0).getValue()));
+    try {
+      client.checkIteratorConflicts(creds, "test", setting, EnumSet.allOf(IteratorScope.class));
+      fail("checkIteratorConflicts did not throw and exception");
+    } catch (Exception ex) {
+    }
+    client.deleteRows(creds, "test", null, null);
+    client.removeIterator(creds, "test", "test", EnumSet.allOf(IteratorScope.class));
+    for (int i = 0; i < 10; i++) {
+      client.updateAndFlush(creds, "test", mutation("row1", "cf", "cq", "1"));
+      client.flushTable(creds, "test", null, null, true);
+    }
+    scanner = client.createScanner(creds, "test", null);
+    more = client.scanner_next_k(scanner, 2);
+    assertEquals("1", new String(more.getResults().get(0).getValue()));
+    // clone
+    client.cloneTable(creds, "test", "test2", true, null, null);
+    scanner = client.createScanner(creds, "test2", null);
+    more = client.scanner_next_k(scanner, 2);
+    assertEquals("1", new String(more.getResults().get(0).getValue()));
+    
+    // don't know how to test this 
+    client.clearLocatorCache(creds, "test");
+    
+    // compact
+    assertEquals(10, countFiles("test"));
+    client.compactTable(creds, "test", null, null, null, true, true);
+    assertEquals(1, countFiles("test"));
+  }
+  
+  private int countFiles(String table) throws Exception {
+    Map<String,String> tableIdMap = client.tableIdMap(creds);
+    String tableId = tableIdMap.get(table);
+    Key start = new Key();
+    start.row = s2bb(tableId + ";");
+    Key end = new Key();
+    end.row = s2bb(tableId + "<");
+    ScanOptions opt = new ScanOptions();
+    opt.range = new Range(start, true, end, true);
+    opt.columns = Collections.singletonList(new ScanColumn(s2bb("file")));
+    String scanner = client.createScanner(creds, table, opt);
+    int result = 0;
+    while (true) {
+      ScanResult more = client.scanner_next_k(scanner, 100);
+      result += more.getResults().size();
+      if (!more.more)
+        break;
+    }
+    return result;
+  }
+
   private Map<ByteBuffer,List<ColumnUpdate>> mutation(String row, String cf, String cq, String value) {
     ColumnUpdate upd = new ColumnUpdate(s2bb(cf), s2bb(cq));
     upd.setValue(value.getBytes());

Modified: accumulo/trunk/proxy/src/test/java/org/apache/accumulo/proxy/TestProxyReadWrite.java
URL: http://svn.apache.org/viewvc/accumulo/trunk/proxy/src/test/java/org/apache/accumulo/proxy/TestProxyReadWrite.java?rev=1437820&r1=1437819&r2=1437820&view=diff
==============================================================================
--- accumulo/trunk/proxy/src/test/java/org/apache/accumulo/proxy/TestProxyReadWrite.java (original)
+++ accumulo/trunk/proxy/src/test/java/org/apache/accumulo/proxy/TestProxyReadWrite.java Thu Jan 24 01:13:24 2013
@@ -19,7 +19,6 @@ package org.apache.accumulo.proxy;
 import static org.junit.Assert.assertEquals;
 
 import java.nio.ByteBuffer;
-import java.util.ArrayList;
 import java.util.Collections;
 import java.util.HashMap;
 import java.util.HashSet;
@@ -29,14 +28,13 @@ import java.util.Properties;
 import java.util.Set;
 
 import org.apache.accumulo.core.iterators.user.RegExFilter;
-import org.apache.accumulo.proxy.Proxy;
-import org.apache.accumulo.proxy.TestProxyClient;
-import org.apache.accumulo.proxy.Util;
+import org.apache.accumulo.proxy.thrift.BatchScanOptions;
 import org.apache.accumulo.proxy.thrift.ColumnUpdate;
 import org.apache.accumulo.proxy.thrift.IteratorSetting;
 import org.apache.accumulo.proxy.thrift.Key;
 import org.apache.accumulo.proxy.thrift.KeyValue;
 import org.apache.accumulo.proxy.thrift.Range;
+import org.apache.accumulo.proxy.thrift.ScanOptions;
 import org.apache.accumulo.proxy.thrift.ScanResult;
 import org.apache.accumulo.proxy.thrift.TimeType;
 import org.apache.accumulo.proxy.thrift.UserPass;
@@ -124,9 +122,9 @@ public class TestProxyReadWrite {
     
     Key stop = new Key();
     stop.setRow("5".getBytes());
-    List<Range> pranges = new ArrayList<Range>();
-    pranges.add(new Range(null, false, stop, false));
-    String cookie = tpc.proxy().createBatchScanner(userpass, testtable, null, null, pranges);
+    BatchScanOptions options = new BatchScanOptions();
+    options.ranges = Collections.singletonList(new Range(null, false, stop, false));
+    String cookie = tpc.proxy().createBatchScanner(userpass, testtable, options);
     
     int i = 0;
     boolean hasNext = true;
@@ -166,7 +164,9 @@ public class TestProxyReadWrite {
     RegExFilter.setRegexs(is, regex, null, null, null, false);
     
     IteratorSetting pis = Util.iteratorSetting2ProxyIteratorSetting(is);
-    String cookie = tpc.proxy().createBatchScanner(userpass, testtable, null, Collections.singletonList(pis), null);
+    BatchScanOptions opts = new BatchScanOptions();
+    opts.iterators = Collections.singletonList(pis);
+    String cookie = tpc.proxy().createBatchScanner(userpass, testtable, opts);
     
     int i = 0;
     boolean hasNext = true;
@@ -199,7 +199,9 @@ public class TestProxyReadWrite {
     
     Key stop = new Key();
     stop.setRow("5".getBytes());
-    String cookie = tpc.proxy().createScanner(userpass, testtable, null, null, new Range(null, false, stop, false));
+    ScanOptions opts = new ScanOptions();
+    opts.range = new Range(null, false, stop, false);
+    String cookie = tpc.proxy().createScanner(userpass, testtable, opts);
     
     int i = 0;
     boolean hasNext = true;
@@ -241,7 +243,9 @@ public class TestProxyReadWrite {
     RegExFilter.setRegexs(is, regex, null, null, null, false);
     
     IteratorSetting pis = Util.iteratorSetting2ProxyIteratorSetting(is);
-    String cookie = tpc.proxy().createScanner(userpass, testtable, null, Collections.singletonList(pis), null);
+    ScanOptions opts = new ScanOptions();
+    opts.iterators = Collections.singletonList(pis);
+    String cookie = tpc.proxy().createScanner(userpass, testtable, opts);
     
     int i = 0;
     boolean hasNext = true;
@@ -280,7 +284,7 @@ public class TestProxyReadWrite {
     tpc.proxy().writer_flush(writer);
     tpc.proxy().writer_close(writer);
     
-    String cookie = tpc.proxy().createBatchScanner(userpass, testtable, null, null, null);
+    String cookie = tpc.proxy().createBatchScanner(userpass, testtable, null);
     
     int i = 0;
     boolean hasNext = true;
@@ -323,7 +327,9 @@ public class TestProxyReadWrite {
     RegExFilter.setRegexs(is, regex, null, null, null, false);
     
     IteratorSetting pis = Util.iteratorSetting2ProxyIteratorSetting(is);
-    String cookie = tpc.proxy().createBatchScanner(userpass, testtable, null, Collections.singletonList(pis), null);
+    BatchScanOptions opts = new BatchScanOptions();
+    opts.iterators = Collections.singletonList(pis);
+    String cookie = tpc.proxy().createBatchScanner(userpass, testtable, opts);
     
     int i = 0;
     boolean hasNext = true;
@@ -367,7 +373,9 @@ public class TestProxyReadWrite {
     
     tpc.proxy().writer_flush(writer);
     tpc.proxy().writer_close(writer);
-    String cookie = tpc.proxy().createBatchScanner(userpass, testtable, auths, null, null);
+    BatchScanOptions opts = new BatchScanOptions();
+    opts.authorizations = auths;
+    String cookie = tpc.proxy().createBatchScanner(userpass, testtable, opts);
     
     int i = 0;
     boolean hasNext = true;



Mime
View raw message