You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@accumulo.apache.org by ec...@apache.org on 2013/01/23 19:00:00 UTC
svn commit: r1437603 [8/8] - in /accumulo/trunk/proxy/src:
main/java/org/apache/accumulo/proxy/
main/java/org/apache/accumulo/proxy/thrift/ main/thrift/
test/java/org/apache/accumulo/proxy/
Added: accumulo/trunk/proxy/src/main/java/org/apache/accumulo/proxy/thrift/UnknownWriter.java
URL: http://svn.apache.org/viewvc/accumulo/trunk/proxy/src/main/java/org/apache/accumulo/proxy/thrift/UnknownWriter.java?rev=1437603&view=auto
==============================================================================
--- accumulo/trunk/proxy/src/main/java/org/apache/accumulo/proxy/thrift/UnknownWriter.java (added)
+++ accumulo/trunk/proxy/src/main/java/org/apache/accumulo/proxy/thrift/UnknownWriter.java Wed Jan 23 17:59:58 2013
@@ -0,0 +1,386 @@
+/**
+ * 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;
+
+public class UnknownWriter extends TException implements org.apache.thrift.TBase<UnknownWriter, UnknownWriter._Fields>, java.io.Serializable, Cloneable {
+ private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("UnknownWriter");
+
+ private static final org.apache.thrift.protocol.TField MSG_FIELD_DESC = new org.apache.thrift.protocol.TField("msg", org.apache.thrift.protocol.TType.STRING, (short)1);
+
+ private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
+ static {
+ schemes.put(StandardScheme.class, new UnknownWriterStandardSchemeFactory());
+ schemes.put(TupleScheme.class, new UnknownWriterTupleSchemeFactory());
+ }
+
+ public String msg; // required
+
+ /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
+ public enum _Fields implements org.apache.thrift.TFieldIdEnum {
+ MSG((short)1, "msg");
+
+ 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: // MSG
+ return MSG;
+ 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
+ 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.MSG, new org.apache.thrift.meta_data.FieldMetaData("msg", org.apache.thrift.TFieldRequirementType.DEFAULT,
+ new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
+ metaDataMap = Collections.unmodifiableMap(tmpMap);
+ org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(UnknownWriter.class, metaDataMap);
+ }
+
+ public UnknownWriter() {
+ }
+
+ public UnknownWriter(
+ String msg)
+ {
+ this();
+ this.msg = msg;
+ }
+
+ /**
+ * Performs a deep copy on <i>other</i>.
+ */
+ public UnknownWriter(UnknownWriter other) {
+ if (other.isSetMsg()) {
+ this.msg = other.msg;
+ }
+ }
+
+ public UnknownWriter deepCopy() {
+ return new UnknownWriter(this);
+ }
+
+ @Override
+ public void clear() {
+ this.msg = null;
+ }
+
+ public String getMsg() {
+ return this.msg;
+ }
+
+ public UnknownWriter setMsg(String msg) {
+ this.msg = msg;
+ return this;
+ }
+
+ public void unsetMsg() {
+ this.msg = null;
+ }
+
+ /** Returns true if field msg is set (has been assigned a value) and false otherwise */
+ public boolean isSetMsg() {
+ return this.msg != null;
+ }
+
+ public void setMsgIsSet(boolean value) {
+ if (!value) {
+ this.msg = null;
+ }
+ }
+
+ public void setFieldValue(_Fields field, Object value) {
+ switch (field) {
+ case MSG:
+ if (value == null) {
+ unsetMsg();
+ } else {
+ setMsg((String)value);
+ }
+ break;
+
+ }
+ }
+
+ public Object getFieldValue(_Fields field) {
+ switch (field) {
+ case MSG:
+ return getMsg();
+
+ }
+ 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 MSG:
+ return isSetMsg();
+ }
+ throw new IllegalStateException();
+ }
+
+ @Override
+ public boolean equals(Object that) {
+ if (that == null)
+ return false;
+ if (that instanceof UnknownWriter)
+ return this.equals((UnknownWriter)that);
+ return false;
+ }
+
+ public boolean equals(UnknownWriter that) {
+ if (that == null)
+ return false;
+
+ boolean this_present_msg = true && this.isSetMsg();
+ boolean that_present_msg = true && that.isSetMsg();
+ if (this_present_msg || that_present_msg) {
+ if (!(this_present_msg && that_present_msg))
+ return false;
+ if (!this.msg.equals(that.msg))
+ return false;
+ }
+
+ return true;
+ }
+
+ @Override
+ public int hashCode() {
+ return 0;
+ }
+
+ public int compareTo(UnknownWriter other) {
+ if (!getClass().equals(other.getClass())) {
+ return getClass().getName().compareTo(other.getClass().getName());
+ }
+
+ int lastComparison = 0;
+ UnknownWriter typedOther = (UnknownWriter)other;
+
+ lastComparison = Boolean.valueOf(isSetMsg()).compareTo(typedOther.isSetMsg());
+ if (lastComparison != 0) {
+ return lastComparison;
+ }
+ if (isSetMsg()) {
+ lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.msg, typedOther.msg);
+ 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("UnknownWriter(");
+ boolean first = true;
+
+ sb.append("msg:");
+ if (this.msg == null) {
+ sb.append("null");
+ } else {
+ sb.append(this.msg);
+ }
+ first = false;
+ sb.append(")");
+ return sb.toString();
+ }
+
+ public void validate() throws org.apache.thrift.TException {
+ // check for required fields
+ // check for sub-struct validity
+ }
+
+ 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 {
+ 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 UnknownWriterStandardSchemeFactory implements SchemeFactory {
+ public UnknownWriterStandardScheme getScheme() {
+ return new UnknownWriterStandardScheme();
+ }
+ }
+
+ private static class UnknownWriterStandardScheme extends StandardScheme<UnknownWriter> {
+
+ public void read(org.apache.thrift.protocol.TProtocol iprot, UnknownWriter 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: // MSG
+ if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
+ struct.msg = iprot.readString();
+ struct.setMsgIsSet(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, UnknownWriter struct) throws org.apache.thrift.TException {
+ struct.validate();
+
+ oprot.writeStructBegin(STRUCT_DESC);
+ if (struct.msg != null) {
+ oprot.writeFieldBegin(MSG_FIELD_DESC);
+ oprot.writeString(struct.msg);
+ oprot.writeFieldEnd();
+ }
+ oprot.writeFieldStop();
+ oprot.writeStructEnd();
+ }
+
+ }
+
+ private static class UnknownWriterTupleSchemeFactory implements SchemeFactory {
+ public UnknownWriterTupleScheme getScheme() {
+ return new UnknownWriterTupleScheme();
+ }
+ }
+
+ private static class UnknownWriterTupleScheme extends TupleScheme<UnknownWriter> {
+
+ @Override
+ public void write(org.apache.thrift.protocol.TProtocol prot, UnknownWriter struct) throws org.apache.thrift.TException {
+ TTupleProtocol oprot = (TTupleProtocol) prot;
+ BitSet optionals = new BitSet();
+ if (struct.isSetMsg()) {
+ optionals.set(0);
+ }
+ oprot.writeBitSet(optionals, 1);
+ if (struct.isSetMsg()) {
+ oprot.writeString(struct.msg);
+ }
+ }
+
+ @Override
+ public void read(org.apache.thrift.protocol.TProtocol prot, UnknownWriter struct) throws org.apache.thrift.TException {
+ TTupleProtocol iprot = (TTupleProtocol) prot;
+ BitSet incoming = iprot.readBitSet(1);
+ if (incoming.get(0)) {
+ struct.msg = iprot.readString();
+ struct.setMsgIsSet(true);
+ }
+ }
+ }
+
+}
+
Propchange: accumulo/trunk/proxy/src/main/java/org/apache/accumulo/proxy/thrift/UnknownWriter.java
------------------------------------------------------------------------------
svn:eol-style = native
Modified: accumulo/trunk/proxy/src/main/java/org/apache/accumulo/proxy/thrift/UserPass.java
URL: http://svn.apache.org/viewvc/accumulo/trunk/proxy/src/main/java/org/apache/accumulo/proxy/thrift/UserPass.java?rev=1437603&r1=1437602&r2=1437603&view=diff
==============================================================================
--- accumulo/trunk/proxy/src/main/java/org/apache/accumulo/proxy/thrift/UserPass.java (original)
+++ accumulo/trunk/proxy/src/main/java/org/apache/accumulo/proxy/thrift/UserPass.java Wed Jan 23 17:59:58 2013
@@ -1,19 +1,3 @@
-/*
- * 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)
*
@@ -46,7 +30,7 @@ import java.util.Arrays;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
-@SuppressWarnings("all") public class UserPass implements org.apache.thrift.TBase<UserPass, UserPass._Fields>, java.io.Serializable, Cloneable {
+public class UserPass implements org.apache.thrift.TBase<UserPass, UserPass._Fields>, java.io.Serializable, Cloneable {
private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("UserPass");
private static final org.apache.thrift.protocol.TField USERNAME_FIELD_DESC = new org.apache.thrift.protocol.TField("username", org.apache.thrift.protocol.TType.STRING, (short)1);
@@ -62,7 +46,7 @@ import org.slf4j.LoggerFactory;
public ByteBuffer password; // required
/** 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 {
+ public enum _Fields implements org.apache.thrift.TFieldIdEnum {
USERNAME((short)1, "username"),
PASSWORD((short)2, "password");
Modified: accumulo/trunk/proxy/src/main/thrift/proxy.thrift
URL: http://svn.apache.org/viewvc/accumulo/trunk/proxy/src/main/thrift/proxy.thrift?rev=1437603&r1=1437602&r2=1437603&view=diff
==============================================================================
--- accumulo/trunk/proxy/src/main/thrift/proxy.thrift (original)
+++ accumulo/trunk/proxy/src/main/thrift/proxy.thrift Wed Jan 23 17:59:58 2013
@@ -16,7 +16,7 @@
*/
namespace java org.apache.accumulo.proxy.thrift
-struct PKey {
+struct Key {
1:binary row;
2:binary colFamily;
3:binary colQualifier;
@@ -24,7 +24,7 @@ struct PKey {
5:optional i64 timestamp
}
-enum PPartialKey {
+enum PartialKey {
ROW,
ROW_COLFAM,
ROW_COLFAM_COLQUAL,
@@ -33,7 +33,7 @@ enum PPartialKey {
ROW_COLFAM_COLQUAL_COLVIS_TIME_DEL
}
-struct PColumnUpdate {
+struct ColumnUpdate {
1:binary colFamily;
2:binary colQualifier;
3:optional binary colVisibility;
@@ -42,20 +42,20 @@ struct PColumnUpdate {
6:optional bool deleteCell;
}
-struct PKeyValue {
- 1:PKey key,
+struct KeyValue {
+ 1:Key key,
2:binary value
}
-struct PScanResult {
- 1:list<PKeyValue> results,
+struct ScanResult {
+ 1:list<KeyValue> results,
2:bool more
}
-struct PRange {
- 1:PKey start,
+struct Range {
+ 1:Key start,
2:bool startInclusive
- 3:PKey stop,
+ 3:Key stop,
4:bool stopInclusive
}
@@ -65,7 +65,7 @@ struct UserPass
2:binary password;
}
-struct PIteratorSetting {
+struct IteratorSetting {
1: i32 priority;
2: string name;
3: string iteratorClass;
@@ -73,11 +73,11 @@ struct PIteratorSetting {
}
struct KeyValueAndPeek{
- 1:PKeyValue keyValue;
+ 1:KeyValue keyValue;
2:bool hasNext;
}
-enum PTablePermission {
+enum TablePermission {
READ = 2,
WRITE = 3,
BULK_IMPORT = 4,
@@ -86,7 +86,7 @@ enum PTablePermission {
DROP_TABLE = 7,
}
-enum PSystemPermission {
+enum SystemPermission {
GRANT = 0,
CREATE_TABLE = 1,
DROP_TABLE = 2,
@@ -97,51 +97,51 @@ enum PSystemPermission {
SYSTEM = 7,
}
-enum PScanType {
+enum ScanType {
SINGLE,
BATCH
}
-enum PScanState {
+enum ScanState {
IDLE,
RUNNING,
QUEUED
}
-struct PKeyExtent {
+struct KeyExtent {
1:string tableId,
2:binary endRow,
3:binary prevEndRow
}
-struct PColumn {
+struct Column {
1:binary colFamily;
2:binary colQualifier;
3:binary colVisibility;
}
-struct PActiveScan {
+struct ActiveScan {
1:string client
2:string user
3:string table
4:i64 age
5:i64 idleTime
- 6:PScanType type
- 7:PScanState state
- 8:PKeyExtent extent
- 9:list<PColumn> columns
- 10:list<PIteratorSetting> iterators
+ 6:ScanType type
+ 7:ScanState state
+ 8:KeyExtent extent
+ 9:list<Column> columns
+ 10:list<IteratorSetting> iterators
11:list<binary> authorizations
}
-enum PCompactionType {
+enum CompactionType {
MINOR,
MERGE,
MAJOR,
FULL
}
-enum PCompactionReason {
+enum CompactionReason {
USER,
SYSTEM,
CHOP,
@@ -149,59 +149,59 @@ enum PCompactionReason {
CLOSE
}
-struct PActiveCompaction {
- 1:PKeyExtent extent
+struct ActiveCompaction {
+ 1:KeyExtent extent
2:i64 age
3:list<string> inputFiles
4:string outputFile
- 5:PCompactionType type
- 6:PCompactionReason reason
+ 5:CompactionType type
+ 6:CompactionReason reason
7:string localityGroup
8:i64 entriesRead
9:i64 entriesWritten
- 10:list<PIteratorSetting> iterators;
+ 10:list<IteratorSetting> iterators;
}
-enum PIteratorScope {
+enum IteratorScope {
MINC,
MAJC,
SCAN
}
-enum PTimeType {
+enum TimeType {
LOGICAL,
MILLIS
}
-exception PUnknownScanner
+exception UnknownScanner
{
1:string msg;
}
-exception PUnknownWriter
+exception UnknownWriter
{
1:string msg;
}
-exception PNoMoreEntriesException
+exception NoMoreEntriesException
{
1:string msg;
}
-exception PAccumuloException
+exception AccumuloException
{
1:string msg;
}
-exception PAccumuloSecurityException
+exception AccumuloSecurityException
{
1:string msg;
}
-exception PTableNotFoundException
+exception TableNotFoundException
{
1:string msg;
}
-exception PTableExistsException
+exception TableExistsException
{
1:string msg;
}
@@ -211,90 +211,88 @@ service AccumuloProxy
bool ping (1:UserPass userpass);
// table operations
- i32 tableOperations_addConstraint (1:UserPass userpass, 2:string tableName, 3:string constraintClassName) throws (1:PAccumuloException ouch1, 2:PAccumuloSecurityException ouch2, 3:PTableNotFoundException ouch3);
- void tableOperations_addSplits (1:UserPass userpass, 2:string tableName, 3:set<binary> splits) throws (1:PTableNotFoundException ouch1, 2:PAccumuloException ouch2, 3:PAccumuloSecurityException ouch3);
- void tableOperations_attachIterator (1:UserPass userpass, 2:string tableName, 3:PIteratorSetting setting, 4:set<PIteratorScope> scopes) throws (1:PAccumuloSecurityException ouch1, 2:PAccumuloException ouch2, 3:PTableNotFoundException ouch3);
- void tableOperations_checkIteratorConflicts (1:UserPass userpass, 2:string tableName, 3:PIteratorSetting setting, 4:set<PIteratorScope> scopes) throws (1:PAccumuloException ouch1, 2:PTableNotFoundException ouch2);
- void tableOperations_clearLocatorCache (1:UserPass userpass, 2:string tableName) throws (1:PTableNotFoundException ouch1);
- void tableOperations_clone (1:UserPass userpass, 2:string tableName, 3:string newTableName, 4:bool flush, 5:map<string,string> propertiesToSet, 6:set<string> propertiesToExclude) throws (1:PAccumuloException ouch1, 2:PAccumuloSecurityException ouch2, 3:PTableNotFoundException ouch3, 4:PTableExistsException ouch4);
- void tableOperations_compact (1:UserPass userpass, 2:string tableName, 3:binary startRow, 4:binary endRow, 5:list<PIteratorSetting> iterators, 6:bool flush, 7:bool wait) throws (1:PAccumuloSecurityException ouch1, 2:PTableNotFoundException ouch2, 3:PAccumuloException ouch3);
- void tableOperations_create (1:UserPass userpass, 2:string tableName, 3:bool versioningIter, 4:PTimeType type) throws (1:PAccumuloException ouch1, 2:PAccumuloSecurityException ouch2, 3:PTableExistsException ouch3);
- void tableOperations_delete (1:UserPass userpass, 2:string tableName) throws (1:PAccumuloException ouch1, 2:PAccumuloSecurityException ouch2, 3:PTableNotFoundException ouch3);
- void tableOperations_deleteRows (1:UserPass userpass, 2:string tableName, 3:binary startRow, 4:binary endRow) throws (1:PAccumuloException ouch1, 2:PAccumuloSecurityException ouch2, 3:PTableNotFoundException ouch3);
- bool tableOperations_exists (1:UserPass userpass, 2:string tableName);
- void tableOperations_exportTable (1:UserPass userpass, 2:string tableName, 3:string exportDir) throws (1:PTableNotFoundException ouch1, 2:PAccumuloException ouch2, 3:PAccumuloSecurityException ouch3);
- void tableOperations_flush (1:UserPass userpass, 2:string tableName, 3:binary startRow, 4:binary endRow, 5:bool wait) throws (1:PAccumuloException ouch1, 2:PAccumuloSecurityException ouch2);
- map<string,set<string>> tableOperations_getLocalityGroups (1:UserPass userpass, 2:string tableName) throws (1:PAccumuloException ouch1, 2:PTableNotFoundException ouch2);
- PIteratorSetting tableOperations_getIteratorSetting (1:UserPass userpass, 2:string tableName, 3:string iteratorName, 4:PIteratorScope scope) throws (1:PAccumuloSecurityException ouch1, 2:PAccumuloException ouch2, 3:PTableNotFoundException ouch3);
- binary tableOperations_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:PTableNotFoundException ouch1, 2:PAccumuloException ouch2, 3:PAccumuloSecurityException ouch3);
- map<string,string> tableOperations_getProperties (1:UserPass userpass, 2:string tableName) throws (1:PAccumuloException ouch1, 2:PTableNotFoundException ouch2);
- list<binary> tableOperations_getSplits (1:UserPass userpass, 2:string tableName, 3:i32 maxSplits) throws (1:PTableNotFoundException ouch1);
- void tableOperations_importDirectory (1:UserPass userpass, 2:string tableName, 3:string importDir, 4:string failureDir, 5:bool setTime) throws (1:PTableNotFoundException ouch1, 2:PAccumuloException ouch3, 3:PAccumuloSecurityException ouch4);
- void tableOperations_importTable (1:UserPass userpass, 2:string tableName, 3:string importDir) throws (1:PTableExistsException ouch1, 2:PAccumuloException ouch2, 3:PAccumuloSecurityException ouch3);
- set<string> tableOperations_list (1:UserPass userpass);
- map<string,set<PIteratorScope>> tableOperations_listIterators (1:UserPass userpass, 2:string tableName) throws (1:PAccumuloSecurityException ouch1, 2:PAccumuloException ouch2, 3:PTableNotFoundException ouch3);
- map<string,i32> tableOperations_listConstraints (1:UserPass userpass, 2:string tableName) throws (1:PAccumuloException ouch1, 2:PTableNotFoundException ouch2);
- void tableOperations_merge (1:UserPass userpass, 2:string tableName, 3:binary startRow, 4:binary endRow) throws (1:PAccumuloException ouch1, 2:PAccumuloSecurityException ouch2, 3:PTableNotFoundException ouch3);
- void tableOperations_offline (1:UserPass userpass, 2:string tableName) throws (1:PAccumuloSecurityException ouch1, 2:PAccumuloException ouch2, 3:PTableNotFoundException ouch3);
- void tableOperations_online (1:UserPass userpass, 2:string tableName) throws (1:PAccumuloSecurityException ouch1, 2:PAccumuloException ouch2, 3:PTableNotFoundException ouch3);
- void tableOperations_removeConstraint (1:UserPass userpass, 2:string tableName, 3:i32 constraint) throws (1:PAccumuloException ouch1, 2:PAccumuloSecurityException ouch2);
- void tableOperations_removeIterator (1:UserPass userpass, 2:string tableName, 3:string iterName, 4:set<PIteratorScope> scopes) throws (1:PAccumuloSecurityException ouch1, 2:PAccumuloException ouch2, 3:PTableNotFoundException ouch3);
- void tableOperations_removeProperty (1:UserPass userpass, 2:string tableName, 3:string property) throws (1:PAccumuloException ouch1, 2:PAccumuloSecurityException ouch2);
- void tableOperations_rename (1:UserPass userpass, 2:string oldTableName, 3:string newTableName) throws (1:PAccumuloSecurityException ouch1, 2:PTableNotFoundException ouch2, 3:PAccumuloException ouch3, 4:PTableExistsException ouch4);
- void tableOperations_setLocalityGroups (1:UserPass userpass, 2:string tableName, 3:map<string,set<string>> groups) throws (1:PAccumuloException ouch1, 2:PAccumuloSecurityException ouch2, 3:PTableNotFoundException ouch3);
- void tableOperations_setProperty (1:UserPass userpass, 2:string tableName, 3:string property, 4:string value) throws (1:PAccumuloException ouch1, 2:PAccumuloSecurityException ouch2);
- set<PRange> tableOperations_splitRangeByTablets (1:UserPass userpass, 2:string tableName, 3:PRange range, 4:i32 maxSplits) throws (1:PAccumuloException ouch1, 2:PAccumuloSecurityException ouch2, 3:PTableNotFoundException ouch3);
- map<string,string> tableOperations_tableIdMap (1:UserPass userpass);
-
+ 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);
+ bool tableExists (1:UserPass userpass, 2:string tableName);
+ map<string,string> tableIdMap (1:UserPass userpass);
// instance operations
- void instanceOperations_pingTabletServer(1:UserPass userpass, 2:string tserver) throws (1:PAccumuloException ouch1, 2:PAccumuloSecurityException ouch2);
- list<PActiveScan> instanceOperations_getActiveScans (1:UserPass userpass, 2:string tserver) throws (1:PAccumuloException ouch1, 2:PAccumuloSecurityException ouch2);
- list<PActiveCompaction> instanceOperations_getActiveCompactions(1:UserPass userpass, 2:string tserver) throws (1:PAccumuloException ouch1, 2:PAccumuloSecurityException ouch2);
- map<string,string> instanceOperations_getSiteConfiguration (1:UserPass userpass) throws (1:PAccumuloException ouch1, 2:PAccumuloSecurityException ouch2);
- map<string,string> instanceOperations_getSystemConfiguration (1:UserPass userpass) throws (1:PAccumuloException ouch1, 2:PAccumuloSecurityException ouch2);
- list<string> instanceOperations_getTabletServers (1:UserPass userpass);
- void instanceOperations_removeProperty (1:UserPass userpass, 2:string property) throws (1:PAccumuloException ouch1, 2:PAccumuloSecurityException ouch2);
- void instanceOperations_setProperty (1:UserPass userpass, 2:string property, 3:string value) throws (1:PAccumuloException ouch1, 2:PAccumuloSecurityException ouch2);
- bool instanceOperations_testClassLoad (1:UserPass userpass, 2:string className, 3:string asTypeName) throws (1:PAccumuloException ouch1, 2:PAccumuloSecurityException 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);
// security operations
- bool securityOperations_authenticateUser (1:UserPass userpass, 2:string user, 3:binary password) throws (1:PAccumuloException ouch1, 2:PAccumuloSecurityException ouch2);
- void securityOperations_changeUserAuthorizations (1:UserPass userpass, 2:string user, 3:set<binary> authorizations) throws (1:PAccumuloException ouch1, 2:PAccumuloSecurityException ouch2);
- void securityOperations_changeUserPassword (1:UserPass userpass, 2:string user, 3:binary password) throws (1:PAccumuloException ouch1, 2:PAccumuloSecurityException ouch2);
- void securityOperations_createUser (1:UserPass userpass, 2:string user, 3:binary password) throws (1:PAccumuloException ouch1, 2:PAccumuloSecurityException ouch2);
- void securityOperations_dropUser (1:UserPass userpass, 2:string user) throws (1:PAccumuloException ouch1, 2:PAccumuloSecurityException ouch2);
- list<binary> securityOperations_getUserAuthorizations (1:UserPass userpass, 2:string user) throws (1:PAccumuloException ouch1, 2:PAccumuloSecurityException ouch2);
- void securityOperations_grantSystemPermission (1:UserPass userpass, 2:string user, 3:PSystemPermission perm) throws (1:PAccumuloException ouch1, 2:PAccumuloSecurityException ouch2);
- void securityOperations_grantTablePermission (1:UserPass userpass, 2:string user, 3:string table, 4:PTablePermission perm) throws (1:PAccumuloException ouch1, 2:PAccumuloSecurityException ouch2);
- bool securityOperations_hasSystemPermission (1:UserPass userpass, 2:string user, 3:PSystemPermission perm) throws (1:PAccumuloException ouch1, 2:PAccumuloSecurityException ouch2);
- bool securityOperations_hasTablePermission (1:UserPass userpass, 2:string user, 3:string table, 4:PTablePermission perm) throws (1:PAccumuloException ouch1, 2:PAccumuloSecurityException ouch2);
- set<string> securityOperations_listUsers (1:UserPass userpass) throws (1:PAccumuloException ouch1, 2:PAccumuloSecurityException ouch2);
- void securityOperations_revokeSystemPermission (1:UserPass userpass, 2:string user, 3:PSystemPermission perm) throws (1:PAccumuloException ouch1, 2:PAccumuloSecurityException ouch2);
- void securityOperations_revokeTablePermission (1:UserPass userpass, 2:string user, 3:string table, 4:PTablePermission perm) throws (1:PAccumuloException ouch1, 2:PAccumuloSecurityException 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:set<binary> authorizations, 4:list<PIteratorSetting> iteratorSetting, 5:list<PRange> range);
- string createScanner(1:UserPass userpass, 2:string tableName, 3:set<binary> authorizations, 4:list<PIteratorSetting> iteratorSetting, 5:PRange range);
-
- bool scanner_hasnext(1:string scanner) throws (1:PUnknownScanner ouch1);
- KeyValueAndPeek scanner_next(1:string scanner) throws(1:PNoMoreEntriesException ouch1, 2:PUnknownScanner ouch2, 3:PAccumuloSecurityException ouch3);
- PScanResult scanner_next_k(1:string scanner, 2:i32 k) throws(1:PNoMoreEntriesException ouch1, 2:PUnknownScanner ouch2, 3:PAccumuloSecurityException ouch3);
- void close_scanner(1:string scanner) throws (1:PUnknownScanner ouch1);
+ // 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);
// writing
-
- void updateAndFlush(1:UserPass userpass, 2:string tableName, 3:map<binary, list<PColumnUpdate>> cells);
-
+ void updateAndFlush(1:UserPass userpass, 2:string tableName, 3:map<binary, list<ColumnUpdate>> cells);
string createWriter(1:UserPass userpass, 2:string tableName);
- oneway void writer_update(1:string writer, 2:map<binary, list<PColumnUpdate>> cells);
- void writer_flush(1:string writer) throws (1:PUnknownWriter ouch1, 2:PAccumuloSecurityException ouch2);
- void writer_close(1:string writer) throws (1:PUnknownWriter ouch1, 2:PAccumuloSecurityException ouch2);
+
+ // use the writer
+ oneway void writer_update(1:string writer, 2:map<binary, list<ColumnUpdate>> cells);
+ void writer_flush(1:string writer) throws (1:UnknownWriter ouch1, 2:AccumuloSecurityException ouch2);
+ void writer_close(1:string writer) throws (1:UnknownWriter ouch1, 2:AccumuloSecurityException ouch2);
// utilities
- PRange getRowRange(1:binary row);
- PKey getFollowing(1:PKey key, 2:PPartialKey part);
+ Range getRowRange(1:binary row);
+ Key getFollowing(1:Key key, 2:PartialKey part);
}
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=1437603&r1=1437602&r2=1437603&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 Wed Jan 23 17:59:58 2013
@@ -21,18 +21,18 @@ import org.apache.accumulo.core.iterator
import org.apache.accumulo.core.iterators.SortedKeyValueIterator;
import org.apache.accumulo.core.util.UtilWaitThread;
import org.apache.accumulo.proxy.thrift.AccumuloProxy.Client;
-import org.apache.accumulo.proxy.thrift.PActiveCompaction;
-import org.apache.accumulo.proxy.thrift.PActiveScan;
-import org.apache.accumulo.proxy.thrift.PColumnUpdate;
-import org.apache.accumulo.proxy.thrift.PCompactionReason;
-import org.apache.accumulo.proxy.thrift.PCompactionType;
-import org.apache.accumulo.proxy.thrift.PIteratorScope;
-import org.apache.accumulo.proxy.thrift.PIteratorSetting;
-import org.apache.accumulo.proxy.thrift.PScanState;
-import org.apache.accumulo.proxy.thrift.PScanType;
-import org.apache.accumulo.proxy.thrift.PSystemPermission;
-import org.apache.accumulo.proxy.thrift.PTablePermission;
-import org.apache.accumulo.proxy.thrift.PTimeType;
+import org.apache.accumulo.proxy.thrift.ActiveCompaction;
+import org.apache.accumulo.proxy.thrift.ActiveScan;
+import org.apache.accumulo.proxy.thrift.ColumnUpdate;
+import org.apache.accumulo.proxy.thrift.CompactionReason;
+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.ScanState;
+import org.apache.accumulo.proxy.thrift.ScanType;
+import org.apache.accumulo.proxy.thrift.SystemPermission;
+import org.apache.accumulo.proxy.thrift.TablePermission;
+import org.apache.accumulo.proxy.thrift.TimeType;
import org.apache.accumulo.proxy.thrift.UserPass;
import org.apache.accumulo.server.test.functional.SlowIterator;
import org.apache.accumulo.test.MiniAccumuloCluster;
@@ -96,36 +96,36 @@ public class SimpleTest {
//@Test(timeout = 10000)
public void testInstanceOperations() throws Exception {
int tservers = 0;
- for (String tserver : client.instanceOperations_getTabletServers(creds)) {
- client.instanceOperations_pingTabletServer(creds, tserver);
+ for (String tserver : client.getTabletServers(creds)) {
+ client.pingTabletServer(creds, tserver);
tservers++;
}
assertTrue(tservers > 0);
// get something we know is in the site config
- Map<String,String> cfg = client.instanceOperations_getSiteConfiguration(creds);
+ Map<String,String> cfg = client.getSiteConfiguration(creds);
assertTrue(cfg.get("instance.dfs.dir").startsWith("/tmp/junit"));
// set a property in zookeeper
- client.instanceOperations_setProperty(creds, "table.split.threshold", "500M");
+ client.setProperty(creds, "table.split.threshold", "500M");
// check that we can read it
- cfg = client.instanceOperations_getSystemConfiguration(creds);
+ cfg = client.getSystemConfiguration(creds);
assertEquals("500M", cfg.get("table.split.threshold"));
// unset the setting, check that it's not what it was
- client.instanceOperations_removeProperty(creds, "table.split.threshold");
- cfg = client.instanceOperations_getSystemConfiguration(creds);
+ client.removeProperty(creds, "table.split.threshold");
+ cfg = client.getSystemConfiguration(creds);
assertNotEquals("500M", cfg.get("table.split.threshold"));
// try to load some classes via the proxy
- assertTrue(client.instanceOperations_testClassLoad(creds, DevNull.class.getName(), SortedKeyValueIterator.class.getName()));
- assertFalse(client.instanceOperations_testClassLoad(creds, "foo.bar", SortedKeyValueIterator.class.getName()));
+ assertTrue(client.testClassLoad(creds, DevNull.class.getName(), SortedKeyValueIterator.class.getName()));
+ assertFalse(client.testClassLoad(creds, "foo.bar", SortedKeyValueIterator.class.getName()));
// create a table that's very slow, so we can look for scans/compactions
- client.tableOperations_create(creds, "slow", true, PTimeType.MILLIS);
- PIteratorSetting setting = new PIteratorSetting(100, "slow", SlowIterator.class.getName(), Collections.singletonMap("sleepTime", "100"));
- client.tableOperations_attachIterator(creds, "slow", setting, EnumSet.allOf(PIteratorScope.class));
+ client.createTable(creds, "slow", true, TimeType.MILLIS);
+ IteratorSetting setting = new IteratorSetting(100, "slow", SlowIterator.class.getName(), Collections.singletonMap("sleepTime", "100"));
+ client.attachIterator(creds, "slow", setting, EnumSet.allOf(IteratorScope.class));
client.updateAndFlush(creds, "slow", mutation("row", "cf", "cq", "value"));
client.updateAndFlush(creds, "slow", mutation("row2", "cf", "cq", "value"));
client.updateAndFlush(creds, "slow", mutation("row3", "cf", "cq", "value"));
@@ -148,11 +148,11 @@ public class SimpleTest {
};
t.start();
// look for the scan
- List<PActiveScan> scans = Collections.emptyList();
+ List<ActiveScan> scans = Collections.emptyList();
loop:
for (int i = 0; i < 100; i++) {
- for (String tserver: client.instanceOperations_getTabletServers(creds)) {
- scans = client.instanceOperations_getActiveScans(creds, tserver);
+ for (String tserver: client.getTabletServers(creds)) {
+ scans = client.getActiveScans(creds, tserver);
if (!scans.isEmpty())
break loop;
UtilWaitThread.sleep(10);
@@ -160,12 +160,12 @@ public class SimpleTest {
}
t.join();
assertFalse(scans.isEmpty());
- PActiveScan scan = scans.get(0);
+ ActiveScan scan = scans.get(0);
assertEquals("root", scan.getUser());
- assertEquals(PScanState.RUNNING, scan.getState());
- assertEquals(PScanType.SINGLE, scan.getType());
+ assertEquals(ScanState.RUNNING, scan.getState());
+ assertEquals(ScanType.SINGLE, scan.getType());
assertEquals("slow", scan.getTable());
- Map<String,String> map = client.tableOperations_tableIdMap(creds);
+ Map<String,String> map = client.tableIdMap(creds);
assertEquals(map.get("slow"), scan.getExtent().tableId);
assertTrue(scan.getExtent().endRow == null);
assertTrue(scan.getExtent().prevEndRow == null);
@@ -176,7 +176,7 @@ public class SimpleTest {
public void run() {
try {
Client client2 = new TestProxyClient("localhost", proxyPort).proxy();
- client2.tableOperations_compact(creds, "slow", null, null, null, true, true);
+ client2.compactTable(creds, "slow", null, null, null, true, true);
} catch (TException e) {
throw new RuntimeException(e);
}
@@ -185,11 +185,11 @@ public class SimpleTest {
t.start();
// try to catch it in the act
- List<PActiveCompaction> compactions = Collections.emptyList();
+ List<ActiveCompaction> compactions = Collections.emptyList();
loop2:
for (int i = 0; i < 100; i++) {
- for (String tserver: client.instanceOperations_getTabletServers(creds)) {
- compactions = client.instanceOperations_getActiveCompactions(creds, tserver);
+ for (String tserver: client.getTabletServers(creds)) {
+ compactions = client.getActiveCompactions(creds, tserver);
if (!compactions.isEmpty())
break loop2;
}
@@ -198,11 +198,11 @@ public class SimpleTest {
t.join();
// verify the compaction information
assertFalse(compactions.isEmpty());
- PActiveCompaction c = compactions.get(0);
+ ActiveCompaction c = compactions.get(0);
assertEquals(map.get("slow"), c.getExtent().tableId);
assertTrue(c.inputFiles.isEmpty());
- assertEquals(PCompactionType.MINOR, c.getType());
- assertEquals(PCompactionReason.USER, c.getReason());
+ assertEquals(CompactionType.MINOR, c.getType());
+ assertEquals(CompactionReason.USER, c.getReason());
assertEquals("", c.localityGroup);
assertTrue(c.outputFile.contains("default_tablet"));
}
@@ -210,49 +210,49 @@ public class SimpleTest {
@Test
public void testSecurityOperations() throws Exception {
// check password
- assertTrue(client.securityOperations_authenticateUser(creds, "root", s2bb(secret)));
- assertFalse(client.securityOperations_authenticateUser(creds, "root", s2bb("")));
+ assertTrue(client.authenticateUser(creds, "root", s2bb(secret)));
+ assertFalse(client.authenticateUser(creds, "root", s2bb("")));
// create a user
- client.securityOperations_createUser(creds, "stooge", s2bb("password"));
+ client.createUser(creds, "stooge", s2bb("password"));
// change auths
- Set<String> users = client.securityOperations_listUsers(creds);
+ Set<String> users = client.listUsers(creds);
assertEquals(new HashSet<String>(Arrays.asList("root", "stooge")), users);
HashSet<ByteBuffer> auths = new HashSet<ByteBuffer>(Arrays.asList(s2bb("A"),s2bb("B")));
- client.securityOperations_changeUserAuthorizations(creds, "stooge", auths);
- List<ByteBuffer> update = client.securityOperations_getUserAuthorizations(creds, "stooge");
+ client.changeUserAuthorizations(creds, "stooge", auths);
+ List<ByteBuffer> update = client.getUserAuthorizations(creds, "stooge");
assertEquals(auths, new HashSet<ByteBuffer>(update));
// change password
- client.securityOperations_changeUserPassword(creds, "stooge", s2bb(""));
- assertTrue(client.securityOperations_authenticateUser(creds, "stooge", s2bb("")));
+ client.changeUserPassword(creds, "stooge", s2bb(""));
+ assertTrue(client.authenticateUser(creds, "stooge", s2bb("")));
// check permission failure
UserPass stooge = new UserPass("stooge", s2bb(""));
try {
- client.tableOperations_create(stooge, "fail", true, PTimeType.MILLIS);
+ client.createTable(stooge, "fail", true, TimeType.MILLIS);
fail("should not create the table");
} catch (TException ex) {
- assertFalse(client.tableOperations_list(creds).contains("fail"));
+ assertFalse(client.listTables(creds).contains("fail"));
}
// grant permissions and test
- assertFalse(client.securityOperations_hasSystemPermission(creds, "stooge", PSystemPermission.CREATE_TABLE));
- client.securityOperations_grantSystemPermission(creds, "stooge", PSystemPermission.CREATE_TABLE);
- assertTrue(client.securityOperations_hasSystemPermission(creds, "stooge", PSystemPermission.CREATE_TABLE));
- client.tableOperations_create(stooge, "success", true, PTimeType.MILLIS);
- client.tableOperations_list(creds).contains("succcess");
+ assertFalse(client.hasSystemPermission(creds, "stooge", SystemPermission.CREATE_TABLE));
+ client.grantSystemPermission(creds, "stooge", SystemPermission.CREATE_TABLE);
+ assertTrue(client.hasSystemPermission(creds, "stooge", SystemPermission.CREATE_TABLE));
+ client.createTable(stooge, "success", true, TimeType.MILLIS);
+ client.listTables(creds).contains("succcess");
// revoke permissions
- client.securityOperations_revokeSystemPermission(creds, "stooge", PSystemPermission.CREATE_TABLE);
- assertFalse(client.securityOperations_hasSystemPermission(creds, "stooge", PSystemPermission.CREATE_TABLE));
+ client.revokeSystemPermission(creds, "stooge", SystemPermission.CREATE_TABLE);
+ assertFalse(client.hasSystemPermission(creds, "stooge", SystemPermission.CREATE_TABLE));
try {
- client.tableOperations_create(stooge, "fail", true, PTimeType.MILLIS);
+ client.createTable(stooge, "fail", true, TimeType.MILLIS);
fail("should not create the table");
} catch (TException ex) {
- assertFalse(client.tableOperations_list(creds).contains("fail"));
+ assertFalse(client.listTables(creds).contains("fail"));
}
// create a table to test table permissions
- client.tableOperations_create(creds, "test", true, PTimeType.MILLIS);
+ client.createTable(creds, "test", true, TimeType.MILLIS);
// denied!
try {
String scanner = client.createScanner(stooge, "test", null, null, null);
@@ -261,15 +261,15 @@ public class SimpleTest {
} catch (TException ex) {
}
// grant
- assertFalse(client.securityOperations_hasTablePermission(creds, "stooge", "test", PTablePermission.READ));
- client.securityOperations_grantTablePermission(creds, "stooge", "test", PTablePermission.READ);
- assertTrue(client.securityOperations_hasTablePermission(creds, "stooge", "test", PTablePermission.READ));
+ 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);
client.scanner_next_k(scanner, 10);
client.close_scanner(scanner);
// revoke
- client.securityOperations_revokeTablePermission(creds, "stooge", "test", PTablePermission.READ);
- assertFalse(client.securityOperations_hasTablePermission(creds, "stooge", "test", PTablePermission.READ));
+ client.revokeTablePermission(creds, "stooge", "test", TablePermission.READ);
+ assertFalse(client.hasTablePermission(creds, "stooge", "test", TablePermission.READ));
try {
scanner = client.createScanner(stooge, "test", null, null, null);
client.scanner_next_k(scanner, 100);
@@ -278,14 +278,14 @@ public class SimpleTest {
}
// delete user
- client.securityOperations_dropUser(creds, "stooge");
- users = client.securityOperations_listUsers(creds);
+ client.dropUser(creds, "stooge");
+ users = client.listUsers(creds);
assertEquals(1, users.size());
}
- private Map<ByteBuffer,List<PColumnUpdate>> mutation(String row, String cf, String cq, String value) {
- PColumnUpdate upd = new PColumnUpdate(s2bb(cf), s2bb(cq));
+ 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());
return Collections.singletonMap(s2bb(row), Collections.singletonList(upd));
}
Modified: accumulo/trunk/proxy/src/test/java/org/apache/accumulo/proxy/TestProxyInstanceOperations.java
URL: http://svn.apache.org/viewvc/accumulo/trunk/proxy/src/test/java/org/apache/accumulo/proxy/TestProxyInstanceOperations.java?rev=1437603&r1=1437602&r2=1437603&view=diff
==============================================================================
--- accumulo/trunk/proxy/src/test/java/org/apache/accumulo/proxy/TestProxyInstanceOperations.java (original)
+++ accumulo/trunk/proxy/src/test/java/org/apache/accumulo/proxy/TestProxyInstanceOperations.java Wed Jan 23 17:59:58 2013
@@ -65,17 +65,17 @@ public class TestProxyInstanceOperations
@Test
public void properties() throws TException {
- tpc.proxy().instanceOperations_setProperty(userpass, "test.systemprop", "whistletips");
+ tpc.proxy().setProperty(userpass, "test.systemprop", "whistletips");
- assertEquals(tpc.proxy().instanceOperations_getSystemConfiguration(userpass).get("test.systemprop"), "whistletips");
- tpc.proxy().instanceOperations_removeProperty(userpass, "test.systemprop");
- assertNull(tpc.proxy().instanceOperations_getSystemConfiguration(userpass).get("test.systemprop"));
+ assertEquals(tpc.proxy().getSystemConfiguration(userpass).get("test.systemprop"), "whistletips");
+ tpc.proxy().removeProperty(userpass, "test.systemprop");
+ assertNull(tpc.proxy().getSystemConfiguration(userpass).get("test.systemprop"));
}
@Test
public void testClassLoad() throws TException {
- assertTrue(tpc.proxy().instanceOperations_testClassLoad(userpass, "org.apache.accumulo.core.iterators.user.RegExFilter",
+ assertTrue(tpc.proxy().testClassLoad(userpass, "org.apache.accumulo.core.iterators.user.RegExFilter",
"org.apache.accumulo.core.iterators.Filter"));
}
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=1437603&r1=1437602&r2=1437603&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 Wed Jan 23 17:59:58 2013
@@ -28,18 +28,17 @@ import java.util.Map;
import java.util.Properties;
import java.util.Set;
-import org.apache.accumulo.core.client.IteratorSetting;
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.PColumnUpdate;
-import org.apache.accumulo.proxy.thrift.PIteratorSetting;
-import org.apache.accumulo.proxy.thrift.PKey;
-import org.apache.accumulo.proxy.thrift.PKeyValue;
-import org.apache.accumulo.proxy.thrift.PRange;
-import org.apache.accumulo.proxy.thrift.PScanResult;
-import org.apache.accumulo.proxy.thrift.PTimeType;
+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.ScanResult;
+import org.apache.accumulo.proxy.thrift.TimeType;
import org.apache.accumulo.proxy.thrift.UserPass;
import org.apache.thrift.server.TServer;
import org.junit.After;
@@ -82,22 +81,22 @@ public class TestProxyReadWrite {
@Before
public void makeTestTable() throws Exception {
- tpc.proxy().tableOperations_create(userpass, testtable, true, PTimeType.MILLIS);
+ tpc.proxy().createTable(userpass, testtable, true, TimeType.MILLIS);
}
@After
public void deleteTestTable() throws Exception {
- tpc.proxy().tableOperations_delete(userpass, testtable);
+ tpc.proxy().deleteTable(userpass, testtable);
}
- private static void addMutation(Map<ByteBuffer,List<PColumnUpdate>> mutations, String row, String cf, String cq, String value) {
- PColumnUpdate update = new PColumnUpdate(ByteBuffer.wrap(cf.getBytes()), ByteBuffer.wrap(cq.getBytes()));
+ private static void addMutation(Map<ByteBuffer,List<ColumnUpdate>> mutations, String row, String cf, String cq, String value) {
+ ColumnUpdate update = new ColumnUpdate(ByteBuffer.wrap(cf.getBytes()), ByteBuffer.wrap(cq.getBytes()));
update.setValue(value.getBytes());
mutations.put(ByteBuffer.wrap(row.getBytes()), Collections.singletonList(update));
}
- private static void addMutation(Map<ByteBuffer,List<PColumnUpdate>> mutations, String row, String cf, String cq, String vis, String value) {
- PColumnUpdate update = new PColumnUpdate(ByteBuffer.wrap(cf.getBytes()), ByteBuffer.wrap(cq.getBytes()));
+ private static void addMutation(Map<ByteBuffer,List<ColumnUpdate>> mutations, String row, String cf, String cq, String vis, String value) {
+ ColumnUpdate update = new ColumnUpdate(ByteBuffer.wrap(cf.getBytes()), ByteBuffer.wrap(cq.getBytes()));
update.setValue(value.getBytes());
update.setColVisibility(vis.getBytes());
mutations.put(ByteBuffer.wrap(row.getBytes()), Collections.singletonList(update));
@@ -112,7 +111,7 @@ public class TestProxyReadWrite {
@Test
public void readWriteBatchOneShotWithRange() throws Exception {
int maxInserts = 100000;
- Map<ByteBuffer,List<PColumnUpdate>> mutations = new HashMap<ByteBuffer,List<PColumnUpdate>>();
+ Map<ByteBuffer,List<ColumnUpdate>> mutations = new HashMap<ByteBuffer,List<ColumnUpdate>>();
String format = "%1$05d";
for (int i = 0; i < maxInserts; i++) {
addMutation(mutations, String.format(format, i), "cf" + i, "cq" + i, Util.randString(10));
@@ -123,10 +122,10 @@ public class TestProxyReadWrite {
}
}
- PKey stop = new PKey();
+ Key stop = new Key();
stop.setRow("5".getBytes());
- List<PRange> pranges = new ArrayList<PRange>();
- pranges.add(new PRange(null, false, stop, false));
+ List<Range> pranges = new ArrayList<Range>();
+ pranges.add(new Range(null, false, stop, false));
String cookie = tpc.proxy().createBatchScanner(userpass, testtable, null, null, pranges);
int i = 0;
@@ -134,7 +133,7 @@ public class TestProxyReadWrite {
int k = 1000;
while (hasNext) {
- PScanResult kvList = tpc.proxy().scanner_next_k(cookie, k);
+ ScanResult kvList = tpc.proxy().scanner_next_k(cookie, k);
i += kvList.getResultsSize();
hasNext = kvList.isMore();
}
@@ -149,7 +148,7 @@ public class TestProxyReadWrite {
@Test
public void readWriteBatchOneShotWithFilterIterator() throws Exception {
int maxInserts = 10000;
- Map<ByteBuffer,List<PColumnUpdate>> mutations = new HashMap<ByteBuffer,List<PColumnUpdate>>();
+ Map<ByteBuffer,List<ColumnUpdate>> mutations = new HashMap<ByteBuffer,List<ColumnUpdate>>();
String format = "%1$05d";
for (int i = 0; i < maxInserts; i++) {
addMutation(mutations, String.format(format, i), "cf" + i, "cq" + i, Util.randString(10));
@@ -163,10 +162,10 @@ public class TestProxyReadWrite {
String regex = ".*[02468]";
- IteratorSetting is = new IteratorSetting(50, regex, RegExFilter.class);
+ org.apache.accumulo.core.client.IteratorSetting is = new org.apache.accumulo.core.client.IteratorSetting(50, regex, RegExFilter.class);
RegExFilter.setRegexs(is, regex, null, null, null, false);
- PIteratorSetting pis = Util.iteratorSetting2ProxyIteratorSetting(is);
+ IteratorSetting pis = Util.iteratorSetting2ProxyIteratorSetting(is);
String cookie = tpc.proxy().createBatchScanner(userpass, testtable, null, Collections.singletonList(pis), null);
int i = 0;
@@ -174,8 +173,8 @@ public class TestProxyReadWrite {
int k = 1000;
while (hasNext) {
- PScanResult kvList = tpc.proxy().scanner_next_k(cookie, k);
- for (PKeyValue kv : kvList.getResults()) {
+ ScanResult kvList = tpc.proxy().scanner_next_k(cookie, k);
+ for (KeyValue kv : kvList.getResults()) {
assertEquals(Integer.parseInt(new String(kv.getKey().getRow())), i);
i += 2;
@@ -187,7 +186,7 @@ public class TestProxyReadWrite {
@Test
public void readWriteOneShotWithRange() throws Exception {
int maxInserts = 100000;
- Map<ByteBuffer,List<PColumnUpdate>> mutations = new HashMap<ByteBuffer,List<PColumnUpdate>>();
+ Map<ByteBuffer,List<ColumnUpdate>> mutations = new HashMap<ByteBuffer,List<ColumnUpdate>>();
String format = "%1$05d";
for (int i = 0; i < maxInserts; i++) {
addMutation(mutations, String.format(format, i), "cf" + i, "cq" + i, Util.randString(10));
@@ -198,16 +197,16 @@ public class TestProxyReadWrite {
}
}
- PKey stop = new PKey();
+ Key stop = new Key();
stop.setRow("5".getBytes());
- String cookie = tpc.proxy().createScanner(userpass, testtable, null, null, new PRange(null, false, stop, false));
+ String cookie = tpc.proxy().createScanner(userpass, testtable, null, null, new Range(null, false, stop, false));
int i = 0;
boolean hasNext = true;
int k = 1000;
while (hasNext) {
- PScanResult kvList = tpc.proxy().scanner_next_k(cookie, k);
+ ScanResult kvList = tpc.proxy().scanner_next_k(cookie, k);
i += kvList.getResultsSize();
hasNext = kvList.isMore();
}
@@ -222,7 +221,7 @@ public class TestProxyReadWrite {
@Test
public void readWriteOneShotWithFilterIterator() throws Exception {
int maxInserts = 10000;
- Map<ByteBuffer,List<PColumnUpdate>> mutations = new HashMap<ByteBuffer,List<PColumnUpdate>>();
+ Map<ByteBuffer,List<ColumnUpdate>> mutations = new HashMap<ByteBuffer,List<ColumnUpdate>>();
String format = "%1$05d";
for (int i = 0; i < maxInserts; i++) {
addMutation(mutations, String.format(format, i), "cf" + i, "cq" + i, Util.randString(10));
@@ -238,10 +237,10 @@ public class TestProxyReadWrite {
String regex = ".*[02468]";
- IteratorSetting is = new IteratorSetting(50, regex, RegExFilter.class);
+ org.apache.accumulo.core.client.IteratorSetting is = new org.apache.accumulo.core.client.IteratorSetting(50, regex, RegExFilter.class);
RegExFilter.setRegexs(is, regex, null, null, null, false);
- PIteratorSetting pis = Util.iteratorSetting2ProxyIteratorSetting(is);
+ IteratorSetting pis = Util.iteratorSetting2ProxyIteratorSetting(is);
String cookie = tpc.proxy().createScanner(userpass, testtable, null, Collections.singletonList(pis), null);
int i = 0;
@@ -249,8 +248,8 @@ public class TestProxyReadWrite {
int k = 1000;
while (hasNext) {
- PScanResult kvList = tpc.proxy().scanner_next_k(cookie, k);
- for (PKeyValue kv : kvList.getResults()) {
+ ScanResult kvList = tpc.proxy().scanner_next_k(cookie, k);
+ for (KeyValue kv : kvList.getResults()) {
assertEquals(Integer.parseInt(new String(kv.getKey().getRow())), i);
i += 2;
@@ -263,7 +262,7 @@ public class TestProxyReadWrite {
// This test takes kind of a long time. Enable it if you think you may have memory issues.
public void manyWritesAndReads() throws Exception {
int maxInserts = 1000000;
- Map<ByteBuffer,List<PColumnUpdate>> mutations = new HashMap<ByteBuffer,List<PColumnUpdate>>();
+ Map<ByteBuffer,List<ColumnUpdate>> mutations = new HashMap<ByteBuffer,List<ColumnUpdate>>();
String format = "%1$06d";
String writer = tpc.proxy().createWriter(userpass, testtable);
for (int i = 0; i < maxInserts; i++) {
@@ -288,8 +287,8 @@ public class TestProxyReadWrite {
int k = 1000;
while (hasNext) {
- PScanResult kvList = tpc.proxy().scanner_next_k(cookie, k);
- for (PKeyValue kv : kvList.getResults()) {
+ ScanResult kvList = tpc.proxy().scanner_next_k(cookie, k);
+ for (KeyValue kv : kvList.getResults()) {
assertEquals(Integer.parseInt(new String(kv.getKey().getRow())), i);
i++;
}
@@ -303,7 +302,7 @@ public class TestProxyReadWrite {
@Test
public void asynchReadWrite() throws Exception {
int maxInserts = 10000;
- Map<ByteBuffer,List<PColumnUpdate>> mutations = new HashMap<ByteBuffer,List<PColumnUpdate>>();
+ Map<ByteBuffer,List<ColumnUpdate>> mutations = new HashMap<ByteBuffer,List<ColumnUpdate>>();
String format = "%1$05d";
String writer = tpc.proxy().createWriter(userpass, testtable);
for (int i = 0; i < maxInserts; i++) {
@@ -320,10 +319,10 @@ public class TestProxyReadWrite {
String regex = ".*[02468]";
- IteratorSetting is = new IteratorSetting(50, regex, RegExFilter.class);
+ org.apache.accumulo.core.client.IteratorSetting is = new org.apache.accumulo.core.client.IteratorSetting(50, regex, RegExFilter.class);
RegExFilter.setRegexs(is, regex, null, null, null, false);
- PIteratorSetting pis = Util.iteratorSetting2ProxyIteratorSetting(is);
+ IteratorSetting pis = Util.iteratorSetting2ProxyIteratorSetting(is);
String cookie = tpc.proxy().createBatchScanner(userpass, testtable, null, Collections.singletonList(pis), null);
int i = 0;
@@ -332,8 +331,8 @@ public class TestProxyReadWrite {
int k = 1000;
int numRead = 0;
while (hasNext) {
- PScanResult kvList = tpc.proxy().scanner_next_k(cookie, k);
- for (PKeyValue kv : kvList.getResults()) {
+ ScanResult kvList = tpc.proxy().scanner_next_k(cookie, k);
+ for (KeyValue kv : kvList.getResults()) {
assertEquals(i, Integer.parseInt(new String(kv.getKey().getRow())));
numRead++;
i += 2;
@@ -348,10 +347,10 @@ public class TestProxyReadWrite {
Set<ByteBuffer> auths = new HashSet<ByteBuffer>();
auths.add(ByteBuffer.wrap("even".getBytes()));
- tpc.proxy().securityOperations_changeUserAuthorizations(userpass, "root", auths);
+ tpc.proxy().changeUserAuthorizations(userpass, "root", auths);
int maxInserts = 10000;
- Map<ByteBuffer,List<PColumnUpdate>> mutations = new HashMap<ByteBuffer,List<PColumnUpdate>>();
+ Map<ByteBuffer,List<ColumnUpdate>> mutations = new HashMap<ByteBuffer,List<ColumnUpdate>>();
String format = "%1$05d";
String writer = tpc.proxy().createWriter(userpass, testtable);
for (int i = 0; i < maxInserts; i++) {
@@ -376,8 +375,8 @@ public class TestProxyReadWrite {
int k = 1000;
int numRead = 0;
while (hasNext) {
- PScanResult kvList = tpc.proxy().scanner_next_k(cookie, k);
- for (PKeyValue kv : kvList.getResults()) {
+ ScanResult kvList = tpc.proxy().scanner_next_k(cookie, k);
+ for (KeyValue kv : kvList.getResults()) {
assertEquals(Integer.parseInt(new String(kv.getKey().getRow())), i);
i += 2;
numRead++;
Modified: accumulo/trunk/proxy/src/test/java/org/apache/accumulo/proxy/TestProxySecurityOperations.java
URL: http://svn.apache.org/viewvc/accumulo/trunk/proxy/src/test/java/org/apache/accumulo/proxy/TestProxySecurityOperations.java?rev=1437603&r1=1437602&r2=1437603&view=diff
==============================================================================
--- accumulo/trunk/proxy/src/test/java/org/apache/accumulo/proxy/TestProxySecurityOperations.java (original)
+++ accumulo/trunk/proxy/src/test/java/org/apache/accumulo/proxy/TestProxySecurityOperations.java Wed Jan 23 17:59:58 2013
@@ -27,9 +27,9 @@ import java.util.Properties;
import org.apache.accumulo.proxy.Proxy;
import org.apache.accumulo.proxy.TestProxyClient;
-import org.apache.accumulo.proxy.thrift.PSystemPermission;
-import org.apache.accumulo.proxy.thrift.PTablePermission;
-import org.apache.accumulo.proxy.thrift.PTimeType;
+import org.apache.accumulo.proxy.thrift.SystemPermission;
+import org.apache.accumulo.proxy.thrift.TablePermission;
+import org.apache.accumulo.proxy.thrift.TimeType;
import org.apache.accumulo.proxy.thrift.UserPass;
import org.apache.thrift.TException;
import org.apache.thrift.server.TServer;
@@ -76,52 +76,52 @@ public class TestProxySecurityOperations
@Before
public void makeTestTableAndUser() throws Exception {
- tpc.proxy().tableOperations_create(userpass, testtable, true, PTimeType.MILLIS);
- tpc.proxy().securityOperations_createUser(userpass, testuser, testpw);
+ tpc.proxy().createTable(userpass, testtable, true, TimeType.MILLIS);
+ tpc.proxy().createUser(userpass, testuser, testpw);
}
@After
public void deleteTestTable() throws Exception {
- tpc.proxy().tableOperations_delete(userpass, testtable);
- tpc.proxy().securityOperations_dropUser(userpass, testuser);
+ tpc.proxy().deleteTable(userpass, testtable);
+ tpc.proxy().dropUser(userpass, testuser);
}
@Test
public void create() throws TException {
- tpc.proxy().securityOperations_createUser(userpass, testuser + "2", testpw);
- assertTrue(tpc.proxy().securityOperations_listUsers(userpass).contains(testuser + "2"));
- tpc.proxy().securityOperations_dropUser(userpass, testuser + "2");
- assertTrue(!tpc.proxy().securityOperations_listUsers(userpass).contains(testuser + "2"));
+ tpc.proxy().createUser(userpass, testuser + "2", testpw);
+ assertTrue(tpc.proxy().listUsers(userpass).contains(testuser + "2"));
+ tpc.proxy().dropUser(userpass, testuser + "2");
+ assertTrue(!tpc.proxy().listUsers(userpass).contains(testuser + "2"));
}
@Test
public void authenticate() throws TException {
- assertTrue(tpc.proxy().securityOperations_authenticateUser(userpass, testuser, testpw));
- assertFalse(tpc.proxy().securityOperations_authenticateUser(userpass, "EvilUser", testpw));
+ assertTrue(tpc.proxy().authenticateUser(userpass, testuser, testpw));
+ assertFalse(tpc.proxy().authenticateUser(userpass, "EvilUser", testpw));
- tpc.proxy().securityOperations_changeUserPassword(userpass, testuser, ByteBuffer.wrap("newpass".getBytes()));
- assertFalse(tpc.proxy().securityOperations_authenticateUser(userpass, testuser, testpw));
- assertTrue(tpc.proxy().securityOperations_authenticateUser(userpass, testuser, ByteBuffer.wrap("newpass".getBytes())));
+ tpc.proxy().changeUserPassword(userpass, testuser, ByteBuffer.wrap("newpass".getBytes()));
+ assertFalse(tpc.proxy().authenticateUser(userpass, testuser, testpw));
+ assertTrue(tpc.proxy().authenticateUser(userpass, testuser, ByteBuffer.wrap("newpass".getBytes())));
}
@Test
public void tablePermissions() throws TException {
- tpc.proxy().securityOperations_grantTablePermission(userpass, testuser, testtable, PTablePermission.ALTER_TABLE);
- assertTrue(tpc.proxy().securityOperations_hasTablePermission(userpass, testuser, testtable, PTablePermission.ALTER_TABLE));
+ tpc.proxy().grantTablePermission(userpass, testuser, testtable, TablePermission.ALTER_TABLE);
+ assertTrue(tpc.proxy().hasTablePermission(userpass, testuser, testtable, TablePermission.ALTER_TABLE));
- tpc.proxy().securityOperations_revokeTablePermission(userpass, testuser, testtable, PTablePermission.ALTER_TABLE);
- assertFalse(tpc.proxy().securityOperations_hasTablePermission(userpass, testuser, testtable, PTablePermission.ALTER_TABLE));
+ tpc.proxy().revokeTablePermission(userpass, testuser, testtable, TablePermission.ALTER_TABLE);
+ assertFalse(tpc.proxy().hasTablePermission(userpass, testuser, testtable, TablePermission.ALTER_TABLE));
}
@Test
public void systemPermissions() throws TException {
- tpc.proxy().securityOperations_grantSystemPermission(userpass, testuser, PSystemPermission.ALTER_USER);
- assertTrue(tpc.proxy().securityOperations_hasSystemPermission(userpass, testuser, PSystemPermission.ALTER_USER));
+ tpc.proxy().grantSystemPermission(userpass, testuser, SystemPermission.ALTER_USER);
+ assertTrue(tpc.proxy().hasSystemPermission(userpass, testuser, SystemPermission.ALTER_USER));
- tpc.proxy().securityOperations_revokeSystemPermission(userpass, testuser, PSystemPermission.ALTER_USER);
- assertFalse(tpc.proxy().securityOperations_hasSystemPermission(userpass, testuser, PSystemPermission.ALTER_USER));
+ tpc.proxy().revokeSystemPermission(userpass, testuser, SystemPermission.ALTER_USER);
+ assertFalse(tpc.proxy().hasSystemPermission(userpass, testuser, SystemPermission.ALTER_USER));
}
@@ -130,8 +130,8 @@ public class TestProxySecurityOperations
HashSet<ByteBuffer> newauths = new HashSet<ByteBuffer>();
newauths.add(ByteBuffer.wrap("BBR".getBytes()));
newauths.add(ByteBuffer.wrap("Barney".getBytes()));
- tpc.proxy().securityOperations_changeUserAuthorizations(userpass, testuser, newauths);
- List<ByteBuffer> actualauths = tpc.proxy().securityOperations_getUserAuthorizations(userpass, testuser);
+ tpc.proxy().changeUserAuthorizations(userpass, testuser, newauths);
+ List<ByteBuffer> actualauths = tpc.proxy().getUserAuthorizations(userpass, testuser);
assertEquals(actualauths.size(), newauths.size());
for (ByteBuffer auth : actualauths) {
Modified: accumulo/trunk/proxy/src/test/java/org/apache/accumulo/proxy/TestProxyTableOperations.java
URL: http://svn.apache.org/viewvc/accumulo/trunk/proxy/src/test/java/org/apache/accumulo/proxy/TestProxyTableOperations.java?rev=1437603&r1=1437602&r2=1437603&view=diff
==============================================================================
--- accumulo/trunk/proxy/src/test/java/org/apache/accumulo/proxy/TestProxyTableOperations.java (original)
+++ accumulo/trunk/proxy/src/test/java/org/apache/accumulo/proxy/TestProxyTableOperations.java Wed Jan 23 17:59:58 2013
@@ -32,8 +32,8 @@ import java.util.Set;
import org.apache.accumulo.proxy.Proxy;
import org.apache.accumulo.proxy.TestProxyClient;
-import org.apache.accumulo.proxy.thrift.PColumnUpdate;
-import org.apache.accumulo.proxy.thrift.PTimeType;
+import org.apache.accumulo.proxy.thrift.ColumnUpdate;
+import org.apache.accumulo.proxy.thrift.TimeType;
import org.apache.accumulo.proxy.thrift.UserPass;
import org.apache.thrift.TException;
import org.apache.thrift.server.TServer;
@@ -78,12 +78,12 @@ public class TestProxyTableOperations {
@Before
public void makeTestTable() throws Exception {
- tpc.proxy().tableOperations_create(userpass, testtable, true, PTimeType.MILLIS);
+ tpc.proxy().createTable(userpass, testtable, true, TimeType.MILLIS);
}
@After
public void deleteTestTable() throws Exception {
- tpc.proxy().tableOperations_delete(userpass, testtable);
+ tpc.proxy().deleteTable(userpass, testtable);
}
@Test
@@ -93,20 +93,20 @@ public class TestProxyTableOperations {
@Test
public void createExistsDelete() throws TException {
- assertFalse(tpc.proxy().tableOperations_exists(userpass, "testtable2"));
- tpc.proxy().tableOperations_create(userpass, "testtable2", true, PTimeType.MILLIS);
- assertTrue(tpc.proxy().tableOperations_exists(userpass, "testtable2"));
- tpc.proxy().tableOperations_delete(userpass, "testtable2");
- assertFalse(tpc.proxy().tableOperations_exists(userpass, "testtable2"));
+ assertFalse(tpc.proxy().tableExists(userpass, "testtable2"));
+ tpc.proxy().createTable(userpass, "testtable2", true, TimeType.MILLIS);
+ assertTrue(tpc.proxy().tableExists(userpass, "testtable2"));
+ tpc.proxy().deleteTable(userpass, "testtable2");
+ assertFalse(tpc.proxy().tableExists(userpass, "testtable2"));
}
@Test
public void listRename() throws TException {
- assertFalse(tpc.proxy().tableOperations_exists(userpass, "testtable2"));
- tpc.proxy().tableOperations_rename(userpass, testtable, "testtable2");
- assertTrue(tpc.proxy().tableOperations_exists(userpass, "testtable2"));
- tpc.proxy().tableOperations_rename(userpass, "testtable2", testtable);
- assertTrue(tpc.proxy().tableOperations_list(userpass).contains("testtable"));
+ assertFalse(tpc.proxy().tableExists(userpass, "testtable2"));
+ tpc.proxy().renameTable(userpass, testtable, "testtable2");
+ assertTrue(tpc.proxy().tableExists(userpass, "testtable2"));
+ tpc.proxy().renameTable(userpass, "testtable2", testtable);
+ assertTrue(tpc.proxy().listTables(userpass).contains("testtable"));
}
@@ -118,13 +118,13 @@ public class TestProxyTableOperations {
splits.add(ByteBuffer.wrap("a".getBytes()));
splits.add(ByteBuffer.wrap("c".getBytes()));
splits.add(ByteBuffer.wrap("z".getBytes()));
- tpc.proxy().tableOperations_addSplits(userpass, testtable, splits);
+ tpc.proxy().addSplits(userpass, testtable, splits);
- tpc.proxy().tableOperations_merge(userpass, testtable, ByteBuffer.wrap("b".getBytes()), ByteBuffer.wrap("d".getBytes()));
+ tpc.proxy().mergeTablets(userpass, testtable, ByteBuffer.wrap("b".getBytes()), ByteBuffer.wrap("d".getBytes()));
splits.remove("c");
- List<ByteBuffer> tableSplits = tpc.proxy().tableOperations_getSplits(userpass, testtable, 10);
+ List<ByteBuffer> tableSplits = tpc.proxy().getSplits(userpass, testtable, 10);
for (ByteBuffer split : tableSplits)
assertTrue(splits.contains(split));
@@ -138,9 +138,9 @@ public class TestProxyTableOperations {
splits.add(ByteBuffer.wrap("a".getBytes()));
splits.add(ByteBuffer.wrap("b".getBytes()));
splits.add(ByteBuffer.wrap("z".getBytes()));
- tpc.proxy().tableOperations_addSplits(userpass, testtable, splits);
+ tpc.proxy().addSplits(userpass, testtable, splits);
- List<ByteBuffer> tableSplits = tpc.proxy().tableOperations_getSplits(userpass, testtable, 10);
+ List<ByteBuffer> tableSplits = tpc.proxy().getSplits(userpass, testtable, 10);
for (ByteBuffer split : tableSplits)
assertTrue(splits.contains(split));
@@ -149,11 +149,11 @@ public class TestProxyTableOperations {
@Test
public void constraints() throws TException {
- int cid = tpc.proxy().tableOperations_addConstraint(userpass, testtable, "org.apache.accumulo.TestConstraint");
- Map<String,Integer> constraints = tpc.proxy().tableOperations_listConstraints(userpass, testtable);
+ int cid = tpc.proxy().addConstraint(userpass, testtable, "org.apache.accumulo.TestConstraint");
+ Map<String,Integer> constraints = tpc.proxy().listConstraints(userpass, testtable);
assertEquals((int) constraints.get("org.apache.accumulo.TestConstraint"), cid);
- tpc.proxy().tableOperations_removeConstraint(userpass, testtable, cid);
- constraints = tpc.proxy().tableOperations_listConstraints(userpass, testtable);
+ tpc.proxy().removeConstraint(userpass, testtable, cid);
+ constraints = tpc.proxy().listConstraints(userpass, testtable);
assertNull(constraints.get("org.apache.accumulo.TestConstraint"));
}
@@ -169,9 +169,9 @@ public class TestProxyTableOperations {
group2.add("cf2");
group2.add("cf3");
groups.put("group2", group2);
- tpc.proxy().tableOperations_setLocalityGroups(userpass, testtable, groups);
+ tpc.proxy().setLocalityGroups(userpass, testtable, groups);
- Map<String,Set<String>> actualGroups = tpc.proxy().tableOperations_getLocalityGroups(userpass, testtable);
+ Map<String,Set<String>> actualGroups = tpc.proxy().getLocalityGroups(userpass, testtable);
assertEquals(groups.size(), actualGroups.size());
for (String groupName : groups.keySet()) {
@@ -185,32 +185,32 @@ public class TestProxyTableOperations {
@Test
public void tableProperties() throws TException {
- tpc.proxy().tableOperations_setProperty(userpass, testtable, "test.property1", "wharrrgarbl");
- assertEquals(tpc.proxy().tableOperations_getProperties(userpass, testtable).get("test.property1"), "wharrrgarbl");
- tpc.proxy().tableOperations_removeProperty(userpass, testtable, "test.property1");
- assertNull(tpc.proxy().tableOperations_getProperties(userpass, testtable).get("test.property1"));
+ tpc.proxy().setTableProperty(userpass, testtable, "test.property1", "wharrrgarbl");
+ assertEquals(tpc.proxy().getTableProperties(userpass, testtable).get("test.property1"), "wharrrgarbl");
+ tpc.proxy().removeTableProperty(userpass, testtable, "test.property1");
+ assertNull(tpc.proxy().getTableProperties(userpass, testtable).get("test.property1"));
}
- private static void addMutation(Map<ByteBuffer,List<PColumnUpdate>> mutations, String row, String cf, String cq, String value) {
- PColumnUpdate update = new PColumnUpdate(ByteBuffer.wrap(cf.getBytes()), ByteBuffer.wrap(cq.getBytes()));
+ private static void addMutation(Map<ByteBuffer,List<ColumnUpdate>> mutations, String row, String cf, String cq, String value) {
+ ColumnUpdate update = new ColumnUpdate(ByteBuffer.wrap(cf.getBytes()), ByteBuffer.wrap(cq.getBytes()));
update.setValue(value.getBytes());
mutations.put(ByteBuffer.wrap(row.getBytes()), Collections.singletonList(update));
}
@Test
public void tableOperationsRowMethods() throws TException {
- List<ByteBuffer> auths = tpc.proxy().securityOperations_getUserAuthorizations(userpass, "root");
+ List<ByteBuffer> auths = tpc.proxy().getUserAuthorizations(userpass, "root");
// System.out.println(auths);
- Map<ByteBuffer,List<PColumnUpdate>> mutations = new HashMap<ByteBuffer,List<PColumnUpdate>>();
+ Map<ByteBuffer,List<ColumnUpdate>> mutations = new HashMap<ByteBuffer,List<ColumnUpdate>>();
for (int i = 0; i < 10; i++) {
addMutation(mutations, "" + i, "cf", "cq", "");
}
tpc.proxy().updateAndFlush(userpass, testtable, mutations);
- assertEquals(tpc.proxy().tableOperations_getMaxRow(userpass, testtable, auths, null, true, null, true), ByteBuffer.wrap("9".getBytes()));
+ assertEquals(tpc.proxy().getMaxRow(userpass, testtable, auths, null, true, null, true), ByteBuffer.wrap("9".getBytes()));
- tpc.proxy().tableOperations_deleteRows(userpass,testtable,ByteBuffer.wrap("51".getBytes()), ByteBuffer.wrap("99".getBytes()));
- assertEquals(tpc.proxy().tableOperations_getMaxRow(userpass, testtable, auths, null, true, null, true), ByteBuffer.wrap("5".getBytes()));
+ tpc.proxy().deleteRows(userpass,testtable,ByteBuffer.wrap("51".getBytes()), ByteBuffer.wrap("99".getBytes()));
+ assertEquals(tpc.proxy().getMaxRow(userpass, testtable, auths, null, true, null, true), ByteBuffer.wrap("5".getBytes()));
}
}