More changes to pass the cluster to execute command against, and pack the tables names to invoke.
Project: http://git-wip-us.apache.org/repos/asf/incubator-blur/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-blur/commit/d96892e4 Tree: http://git-wip-us.apache.org/repos/asf/incubator-blur/tree/d96892e4 Diff: http://git-wip-us.apache.org/repos/asf/incubator-blur/diff/d96892e4 Branch: refs/heads/blur-platform Commit: d96892e4fc09775427fbc1a67e9b64a048260ea8 Parents: 753ab41 Author: Aaron McCurry <[email protected]> Authored: Fri Jul 25 09:21:56 2014 -0400 Committer: Aaron McCurry <[email protected]> Committed: Fri Jul 25 09:21:56 2014 -0400 ---------------------------------------------------------------------- .../apache/blur/server/FilteredBlurServer.java | 4 +- .../blur/server/platform/CommandClient.java | 25 +- .../platform/CommandControllerServer.java | 36 +- .../server/platform/CommandShardServer.java | 26 +- .../blur/thrift/BlurControllerServer.java | 6 +- .../org/apache/blur/thrift/BlurShardServer.java | 2 +- .../generated/AdhocByteCodeCommandRequest.java | 383 +++++++++++++------ .../generated/AdhocByteCodeCommandResponse.java | 58 +-- .../thrift/generated/BlurCommandRequest.java | 170 ++------ .../thrift/generated/BlurCommandResponse.java | 76 ++-- .../blur/thrift/generated/BlurPlatform.java | 136 ++++++- .../org/apache/blur/thrift/generated/Value.java | 3 + .../apache/blur/thrift/generated/ValueType.java | 3 + .../src/main/scripts/interface/Blur.thrift | 29 +- .../main/scripts/interface/gen-html/Blur.html | 30 +- .../main/scripts/interface/gen-html/index.html | 4 +- .../generated/AdhocByteCodeCommandRequest.java | 383 +++++++++++++------ .../generated/AdhocByteCodeCommandResponse.java | 58 +-- .../thrift/generated/BlurCommandRequest.java | 170 ++------ .../thrift/generated/BlurCommandResponse.java | 76 ++-- .../blur/thrift/generated/BlurPlatform.java | 136 ++++++- .../org/apache/blur/thrift/generated/Value.java | 3 + .../apache/blur/thrift/generated/ValueType.java | 3 + .../scripts/interface/gen-js/BlurPlatform.js | 28 +- .../main/scripts/interface/gen-js/Blur_types.js | 233 +++++------ .../interface/gen-perl/Blur/BlurPlatform.pm | 32 +- .../scripts/interface/gen-perl/Blur/Types.pm | 200 +++++----- .../scripts/interface/gen-rb/blur_platform.rb | 14 +- .../main/scripts/interface/gen-rb/blur_types.rb | 36 +- 29 files changed, 1376 insertions(+), 987 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/d96892e4/blur-core/src/main/java/org/apache/blur/server/FilteredBlurServer.java ---------------------------------------------------------------------- diff --git a/blur-core/src/main/java/org/apache/blur/server/FilteredBlurServer.java b/blur-core/src/main/java/org/apache/blur/server/FilteredBlurServer.java index 89552d0..804f8c7 100644 --- a/blur-core/src/main/java/org/apache/blur/server/FilteredBlurServer.java +++ b/blur-core/src/main/java/org/apache/blur/server/FilteredBlurServer.java @@ -247,8 +247,8 @@ public class FilteredBlurServer implements Iface { } @Override - public BlurCommandResponse execute(BlurCommandRequest request) throws BlurException, TException { - return _iface.execute(request); + public BlurCommandResponse execute(String cluster, BlurCommandRequest request) throws BlurException, TException { + return _iface.execute(cluster, request); } } http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/d96892e4/blur-core/src/main/java/org/apache/blur/server/platform/CommandClient.java ---------------------------------------------------------------------- diff --git a/blur-core/src/main/java/org/apache/blur/server/platform/CommandClient.java b/blur-core/src/main/java/org/apache/blur/server/platform/CommandClient.java index fd049ad..9eb2e76 100644 --- a/blur-core/src/main/java/org/apache/blur/server/platform/CommandClient.java +++ b/blur-core/src/main/java/org/apache/blur/server/platform/CommandClient.java @@ -33,8 +33,8 @@ import java.util.Set; import org.apache.blur.log.Log; import org.apache.blur.log.LogFactory; import org.apache.blur.thirdparty.thrift_0_9_0.TException; -import org.apache.blur.thrift.generated.AdhocByteCodeCommandRequest; -import org.apache.blur.thrift.generated.AdhocByteCodeCommandResponse; +import org.apache.blur.thrift.generated.AdHocByteCodeCommandRequest; +import org.apache.blur.thrift.generated.AdHocByteCodeCommandResponse; import org.apache.blur.thrift.generated.Blur.Iface; import org.apache.blur.thrift.generated.BlurCommandRequest; import org.apache.blur.thrift.generated.BlurCommandResponse; @@ -52,25 +52,26 @@ public class CommandClient { _client = client; } - public <T1, T2> T2 execute(String table, Command<T1, T2> command) throws BlurException, TException, IOException { + public <T1, T2> T2 execute(String cluster, String table, Command<T1, T2> command) throws BlurException, TException, + IOException { Set<String> tables = new HashSet<String>(); tables.add(table); - return execute(tables, new Object[] {}, command); + return execute(cluster, tables, new Object[] {}, command); } - public <T1, T2> T2 execute(Set<String> tables, Object[] args, Command<T1, T2> command) throws BlurException, - TException, IOException { + public <T1, T2> T2 execute(String cluster, Set<String> tables, Object[] args, Command<T1, T2> command) + throws BlurException, TException, IOException { BlurCommandRequest request = new BlurCommandRequest(); - AdhocByteCodeCommandRequest adhocByteCodeCommandRequest = new AdhocByteCodeCommandRequest(); - packCommandAndClasses(adhocByteCodeCommandRequest, args, command); - request.setAdhocByteCodeCommandRequest(adhocByteCodeCommandRequest); - BlurCommandResponse blurCommandResponse = _client.execute(request); - AdhocByteCodeCommandResponse response = blurCommandResponse.getAdhocByteCodeCommandResponse(); + AdHocByteCodeCommandRequest adHocByteCodeCommandRequest = new AdHocByteCodeCommandRequest(); + packCommandAndClasses(adHocByteCodeCommandRequest, args, command); + request.setAdHocByteCodeCommandRequest(adHocByteCodeCommandRequest); + BlurCommandResponse blurCommandResponse = _client.execute(cluster, request); + AdHocByteCodeCommandResponse response = blurCommandResponse.getAdHocByteCodeCommandResponse(); Value result = response.getResult(); return CommandUtils.toObject(getClass().getClassLoader(), result); } - private void packCommandAndClasses(AdhocByteCodeCommandRequest request, Object[] args, Object command) + private void packCommandAndClasses(AdHocByteCodeCommandRequest request, Object[] args, Object command) throws IOException { request.setClassData(getClassData(command.getClass())); request.setInstanceData(CommandUtils.toBytesViaSerialization(command)); http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/d96892e4/blur-core/src/main/java/org/apache/blur/server/platform/CommandControllerServer.java ---------------------------------------------------------------------- diff --git a/blur-core/src/main/java/org/apache/blur/server/platform/CommandControllerServer.java b/blur-core/src/main/java/org/apache/blur/server/platform/CommandControllerServer.java index 9e8d699..638f49d 100644 --- a/blur-core/src/main/java/org/apache/blur/server/platform/CommandControllerServer.java +++ b/blur-core/src/main/java/org/apache/blur/server/platform/CommandControllerServer.java @@ -24,8 +24,8 @@ import java.util.List; import java.util.Map; import org.apache.blur.thrift.BException; -import org.apache.blur.thrift.generated.AdhocByteCodeCommandRequest; -import org.apache.blur.thrift.generated.AdhocByteCodeCommandResponse; +import org.apache.blur.thrift.generated.AdHocByteCodeCommandRequest; +import org.apache.blur.thrift.generated.AdHocByteCodeCommandResponse; import org.apache.blur.thrift.generated.BlurCommandRequest; import org.apache.blur.thrift.generated.BlurCommandResponse; import org.apache.blur.thrift.generated.BlurException; @@ -35,17 +35,17 @@ public class CommandControllerServer implements Closeable { @Override public void close() throws IOException { - + } public BlurCommandResponse merge(BlurCommandRequest request, List<BlurCommandResponse> responses) throws BlurException, IOException { Object fieldValue = request.getFieldValue(); - if (fieldValue instanceof AdhocByteCodeCommandRequest) { - AdhocByteCodeCommandRequest commandRequest = request.getAdhocByteCodeCommandRequest(); - AdhocByteCodeCommandResponse commandResponse = merge(commandRequest, toAdhocByteCodeCommandResponses(responses)); + if (fieldValue instanceof AdHocByteCodeCommandRequest) { + AdHocByteCodeCommandRequest commandRequest = request.getAdHocByteCodeCommandRequest(); + AdHocByteCodeCommandResponse commandResponse = merge(commandRequest, toAdHocByteCodeCommandResponses(responses)); BlurCommandResponse response = new BlurCommandResponse(); - response.setAdhocByteCodeCommandResponse(commandResponse); + response.setAdHocByteCodeCommandResponse(commandResponse); return response; } else { throw new BException("Not implemented."); @@ -53,35 +53,35 @@ public class CommandControllerServer implements Closeable { } @SuppressWarnings({ "rawtypes", "unchecked" }) - private AdhocByteCodeCommandResponse merge(AdhocByteCodeCommandRequest commandRequest, - List<AdhocByteCodeCommandResponse> adhocByteCodeCommandResponses) throws BlurException, IOException { + private AdHocByteCodeCommandResponse merge(AdHocByteCodeCommandRequest commandRequest, + List<AdHocByteCodeCommandResponse> adHocByteCodeCommandResponses) throws BlurException, IOException { Map<String, ByteBuffer> classData = commandRequest.getClassData(); ClassLoader classLoader = CommandUtils.getClassLoader(classData); Object[] args = CommandUtils.getArgs(classLoader, commandRequest.getArguments()); Command<?, ?> command = CommandUtils.toObjectViaSerialization(classLoader, commandRequest.getInstanceData()); command.setArgs(args); - List<?> results = getResults(classLoader, adhocByteCodeCommandResponses); + List<?> results = getResults(classLoader, adHocByteCodeCommandResponses); Object r = command.mergeFinal((List) results); Value value = CommandUtils.toValue(r); - AdhocByteCodeCommandResponse adhocByteCodeCommandResponse = new AdhocByteCodeCommandResponse(); - adhocByteCodeCommandResponse.setResult(value); - return adhocByteCodeCommandResponse; + AdHocByteCodeCommandResponse adHocByteCodeCommandResponse = new AdHocByteCodeCommandResponse(); + adHocByteCodeCommandResponse.setResult(value); + return adHocByteCodeCommandResponse; } - private List<?> getResults(ClassLoader classLoader, List<AdhocByteCodeCommandResponse> adhocByteCodeCommandResponses) + private List<?> getResults(ClassLoader classLoader, List<AdHocByteCodeCommandResponse> adhocByteCodeCommandResponses) throws BlurException, IOException { List<Object> result = new ArrayList<Object>(); - for (AdhocByteCodeCommandResponse response : adhocByteCodeCommandResponses) { + for (AdHocByteCodeCommandResponse response : adhocByteCodeCommandResponses) { Object object = CommandUtils.toObject(classLoader, response.getResult()); result.add(object); } return result; } - private List<AdhocByteCodeCommandResponse> toAdhocByteCodeCommandResponses(List<BlurCommandResponse> responses) { - List<AdhocByteCodeCommandResponse> result = new ArrayList<AdhocByteCodeCommandResponse>(); + private List<AdHocByteCodeCommandResponse> toAdHocByteCodeCommandResponses(List<BlurCommandResponse> responses) { + List<AdHocByteCodeCommandResponse> result = new ArrayList<AdHocByteCodeCommandResponse>(); for (BlurCommandResponse r : responses) { - result.add(r.getAdhocByteCodeCommandResponse()); + result.add(r.getAdHocByteCodeCommandResponse()); } return result; } http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/d96892e4/blur-core/src/main/java/org/apache/blur/server/platform/CommandShardServer.java ---------------------------------------------------------------------- diff --git a/blur-core/src/main/java/org/apache/blur/server/platform/CommandShardServer.java b/blur-core/src/main/java/org/apache/blur/server/platform/CommandShardServer.java index 49b3427..24524f7 100644 --- a/blur-core/src/main/java/org/apache/blur/server/platform/CommandShardServer.java +++ b/blur-core/src/main/java/org/apache/blur/server/platform/CommandShardServer.java @@ -20,7 +20,6 @@ import java.io.Closeable; import java.io.IOException; import java.nio.ByteBuffer; import java.util.HashMap; -import java.util.HashSet; import java.util.Map; import java.util.Set; import java.util.concurrent.ExecutorService; @@ -29,8 +28,8 @@ import java.util.concurrent.Executors; import org.apache.blur.manager.IndexServer; import org.apache.blur.manager.writer.BlurIndex; import org.apache.blur.thrift.BException; -import org.apache.blur.thrift.generated.AdhocByteCodeCommandRequest; -import org.apache.blur.thrift.generated.AdhocByteCodeCommandResponse; +import org.apache.blur.thrift.generated.AdHocByteCodeCommandRequest; +import org.apache.blur.thrift.generated.AdHocByteCodeCommandResponse; import org.apache.blur.thrift.generated.BlurCommandRequest; import org.apache.blur.thrift.generated.BlurCommandResponse; import org.apache.blur.thrift.generated.BlurException; @@ -70,24 +69,21 @@ public class CommandShardServer implements Closeable { public BlurCommandResponse execute(Set<String> tables, BlurCommandRequest request) throws BlurException, IOException, CommandException { // @TODO deal with different command types. - Set<String> tablesToInvoke = new HashSet<String>(); - tablesToInvoke.add("test"); Object fieldValue = request.getFieldValue(); BlurCommandResponse blurCommandResponse = new BlurCommandResponse(); - if (fieldValue instanceof AdhocByteCodeCommandRequest) { - AdhocByteCodeCommandRequest commandRequest = request.getAdhocByteCodeCommandRequest(); - AdhocByteCodeCommandResponse response = execute(tables, commandRequest, tablesToInvoke); - blurCommandResponse.setAdhocByteCodeCommandResponse(response); + if (fieldValue instanceof AdHocByteCodeCommandRequest) { + AdHocByteCodeCommandRequest commandRequest = request.getAdHocByteCodeCommandRequest(); + AdHocByteCodeCommandResponse response = execute(tables, commandRequest); + blurCommandResponse.setAdHocByteCodeCommandResponse(response); } else { throw new BException("Not implemented."); } return blurCommandResponse; } - public AdhocByteCodeCommandResponse execute(Set<String> tables, AdhocByteCodeCommandRequest commandRequest, - Set<String> tablesToInvoke) throws BlurException, IOException, CommandException { + public AdHocByteCodeCommandResponse execute(Set<String> tables, AdHocByteCodeCommandRequest commandRequest) throws BlurException, IOException, CommandException { // @TODO handle libraries - + Set<String> tablesToInvoke = commandRequest.getTablesToInvoke(); Map<String, ByteBuffer> classData = commandRequest.getClassData(); ClassLoader classLoader = CommandUtils.getClassLoader(classData); Object[] args = CommandUtils.getArgs(classLoader, commandRequest.getArguments()); @@ -95,9 +91,9 @@ public class CommandShardServer implements Closeable { Object object = execute(tables, command, tablesToInvoke, args); Value value = CommandUtils.toValue(object); - AdhocByteCodeCommandResponse adhocByteCodeCommandResponse = new AdhocByteCodeCommandResponse(); - adhocByteCodeCommandResponse.setResult(value); - return adhocByteCodeCommandResponse; + AdHocByteCodeCommandResponse adHocByteCodeCommandResponse = new AdHocByteCodeCommandResponse(); + adHocByteCodeCommandResponse.setResult(value); + return adHocByteCodeCommandResponse; } @Override http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/d96892e4/blur-core/src/main/java/org/apache/blur/thrift/BlurControllerServer.java ---------------------------------------------------------------------- diff --git a/blur-core/src/main/java/org/apache/blur/thrift/BlurControllerServer.java b/blur-core/src/main/java/org/apache/blur/thrift/BlurControllerServer.java index 4438035..6f83377 100644 --- a/blur-core/src/main/java/org/apache/blur/thrift/BlurControllerServer.java +++ b/blur-core/src/main/java/org/apache/blur/thrift/BlurControllerServer.java @@ -1517,13 +1517,13 @@ public class BlurControllerServer extends TableAdmin implements Iface { } @Override - public BlurCommandResponse execute(final BlurCommandRequest request) throws BlurException, TException { + public BlurCommandResponse execute(final String cluster, final BlurCommandRequest request) throws BlurException, TException { try { // @TODO pass cluster - return scatterGather("default", new BlurCommand<BlurCommandResponse>() { + return scatterGather(cluster, new BlurCommand<BlurCommandResponse>() { @Override public BlurCommandResponse call(Client client) throws BlurException, TException { - return client.execute(request); + return client.execute(cluster, request); } }, new Merger<BlurCommandResponse>() { @Override http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/d96892e4/blur-core/src/main/java/org/apache/blur/thrift/BlurShardServer.java ---------------------------------------------------------------------- diff --git a/blur-core/src/main/java/org/apache/blur/thrift/BlurShardServer.java b/blur-core/src/main/java/org/apache/blur/thrift/BlurShardServer.java index 136d4a7..b22430a 100644 --- a/blur-core/src/main/java/org/apache/blur/thrift/BlurShardServer.java +++ b/blur-core/src/main/java/org/apache/blur/thrift/BlurShardServer.java @@ -595,7 +595,7 @@ public class BlurShardServer extends TableAdmin implements Iface { } @Override - public BlurCommandResponse execute(BlurCommandRequest request) throws BlurException, TException { + public BlurCommandResponse execute(String cluster, BlurCommandRequest request) throws BlurException, TException { try { List<String> tableList = tableList(); return _commandShardServer.execute(new HashSet<String>(tableList), request); http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/d96892e4/blur-thrift/src/main/java/org/apache/blur/thrift/generated/AdhocByteCodeCommandRequest.java ---------------------------------------------------------------------- diff --git a/blur-thrift/src/main/java/org/apache/blur/thrift/generated/AdhocByteCodeCommandRequest.java b/blur-thrift/src/main/java/org/apache/blur/thrift/generated/AdhocByteCodeCommandRequest.java index 7afcfe9..015ccf3 100644 --- a/blur-thrift/src/main/java/org/apache/blur/thrift/generated/AdhocByteCodeCommandRequest.java +++ b/blur-thrift/src/main/java/org/apache/blur/thrift/generated/AdhocByteCodeCommandRequest.java @@ -49,20 +49,25 @@ import java.util.Arrays; //import org.slf4j.Logger; //import org.slf4j.LoggerFactory; -public class AdhocByteCodeCommandRequest implements org.apache.blur.thirdparty.thrift_0_9_0.TBase<AdhocByteCodeCommandRequest, AdhocByteCodeCommandRequest._Fields>, java.io.Serializable, Cloneable { - private static final org.apache.blur.thirdparty.thrift_0_9_0.protocol.TStruct STRUCT_DESC = new org.apache.blur.thirdparty.thrift_0_9_0.protocol.TStruct("AdhocByteCodeCommandRequest"); +/** + * Carries ad hoc byte code based execution commands. + */ +public class AdHocByteCodeCommandRequest implements org.apache.blur.thirdparty.thrift_0_9_0.TBase<AdHocByteCodeCommandRequest, AdHocByteCodeCommandRequest._Fields>, java.io.Serializable, Cloneable { + private static final org.apache.blur.thirdparty.thrift_0_9_0.protocol.TStruct STRUCT_DESC = new org.apache.blur.thirdparty.thrift_0_9_0.protocol.TStruct("AdHocByteCodeCommandRequest"); - private static final org.apache.blur.thirdparty.thrift_0_9_0.protocol.TField ARGUMENTS_FIELD_DESC = new org.apache.blur.thirdparty.thrift_0_9_0.protocol.TField("arguments", org.apache.blur.thirdparty.thrift_0_9_0.protocol.TType.LIST, (short)1); - private static final org.apache.blur.thirdparty.thrift_0_9_0.protocol.TField INSTANCE_DATA_FIELD_DESC = new org.apache.blur.thirdparty.thrift_0_9_0.protocol.TField("instanceData", org.apache.blur.thirdparty.thrift_0_9_0.protocol.TType.STRING, (short)2); - private static final org.apache.blur.thirdparty.thrift_0_9_0.protocol.TField CLASS_DATA_FIELD_DESC = new org.apache.blur.thirdparty.thrift_0_9_0.protocol.TField("classData", org.apache.blur.thirdparty.thrift_0_9_0.protocol.TType.MAP, (short)3); - private static final org.apache.blur.thirdparty.thrift_0_9_0.protocol.TField LIBRARIES_FIELD_DESC = new org.apache.blur.thirdparty.thrift_0_9_0.protocol.TField("libraries", org.apache.blur.thirdparty.thrift_0_9_0.protocol.TType.LIST, (short)4); + private static final org.apache.blur.thirdparty.thrift_0_9_0.protocol.TField TABLES_TO_INVOKE_FIELD_DESC = new org.apache.blur.thirdparty.thrift_0_9_0.protocol.TField("tablesToInvoke", org.apache.blur.thirdparty.thrift_0_9_0.protocol.TType.SET, (short)1); + private static final org.apache.blur.thirdparty.thrift_0_9_0.protocol.TField ARGUMENTS_FIELD_DESC = new org.apache.blur.thirdparty.thrift_0_9_0.protocol.TField("arguments", org.apache.blur.thirdparty.thrift_0_9_0.protocol.TType.LIST, (short)2); + private static final org.apache.blur.thirdparty.thrift_0_9_0.protocol.TField INSTANCE_DATA_FIELD_DESC = new org.apache.blur.thirdparty.thrift_0_9_0.protocol.TField("instanceData", org.apache.blur.thirdparty.thrift_0_9_0.protocol.TType.STRING, (short)3); + private static final org.apache.blur.thirdparty.thrift_0_9_0.protocol.TField CLASS_DATA_FIELD_DESC = new org.apache.blur.thirdparty.thrift_0_9_0.protocol.TField("classData", org.apache.blur.thirdparty.thrift_0_9_0.protocol.TType.MAP, (short)4); + private static final org.apache.blur.thirdparty.thrift_0_9_0.protocol.TField LIBRARIES_FIELD_DESC = new org.apache.blur.thirdparty.thrift_0_9_0.protocol.TField("libraries", org.apache.blur.thirdparty.thrift_0_9_0.protocol.TType.LIST, (short)5); private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>(); static { - schemes.put(StandardScheme.class, new AdhocByteCodeCommandRequestStandardSchemeFactory()); - schemes.put(TupleScheme.class, new AdhocByteCodeCommandRequestTupleSchemeFactory()); + schemes.put(StandardScheme.class, new AdHocByteCodeCommandRequestStandardSchemeFactory()); + schemes.put(TupleScheme.class, new AdHocByteCodeCommandRequestTupleSchemeFactory()); } + public Set<String> tablesToInvoke; // required public List<Value> arguments; // required public ByteBuffer instanceData; // required public Map<String,ByteBuffer> classData; // required @@ -70,10 +75,11 @@ public class AdhocByteCodeCommandRequest implements org.apache.blur.thirdparty.t /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ public enum _Fields implements org.apache.blur.thirdparty.thrift_0_9_0.TFieldIdEnum { - ARGUMENTS((short)1, "arguments"), - INSTANCE_DATA((short)2, "instanceData"), - CLASS_DATA((short)3, "classData"), - LIBRARIES((short)4, "libraries"); + TABLES_TO_INVOKE((short)1, "tablesToInvoke"), + ARGUMENTS((short)2, "arguments"), + INSTANCE_DATA((short)3, "instanceData"), + CLASS_DATA((short)4, "classData"), + LIBRARIES((short)5, "libraries"); private static final Map<String, _Fields> byName = new HashMap<String, _Fields>(); @@ -88,13 +94,15 @@ public class AdhocByteCodeCommandRequest implements org.apache.blur.thirdparty.t */ public static _Fields findByThriftId(int fieldId) { switch(fieldId) { - case 1: // ARGUMENTS + case 1: // TABLES_TO_INVOKE + return TABLES_TO_INVOKE; + case 2: // ARGUMENTS return ARGUMENTS; - case 2: // INSTANCE_DATA + case 3: // INSTANCE_DATA return INSTANCE_DATA; - case 3: // CLASS_DATA + case 4: // CLASS_DATA return CLASS_DATA; - case 4: // LIBRARIES + case 5: // LIBRARIES return LIBRARIES; default: return null; @@ -139,6 +147,9 @@ public class AdhocByteCodeCommandRequest implements org.apache.blur.thirdparty.t public static final Map<_Fields, org.apache.blur.thirdparty.thrift_0_9_0.meta_data.FieldMetaData> metaDataMap; static { Map<_Fields, org.apache.blur.thirdparty.thrift_0_9_0.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.blur.thirdparty.thrift_0_9_0.meta_data.FieldMetaData>(_Fields.class); + tmpMap.put(_Fields.TABLES_TO_INVOKE, new org.apache.blur.thirdparty.thrift_0_9_0.meta_data.FieldMetaData("tablesToInvoke", org.apache.blur.thirdparty.thrift_0_9_0.TFieldRequirementType.DEFAULT, + new org.apache.blur.thirdparty.thrift_0_9_0.meta_data.SetMetaData(org.apache.blur.thirdparty.thrift_0_9_0.protocol.TType.SET, + new org.apache.blur.thirdparty.thrift_0_9_0.meta_data.FieldValueMetaData(org.apache.blur.thirdparty.thrift_0_9_0.protocol.TType.STRING)))); tmpMap.put(_Fields.ARGUMENTS, new org.apache.blur.thirdparty.thrift_0_9_0.meta_data.FieldMetaData("arguments", org.apache.blur.thirdparty.thrift_0_9_0.TFieldRequirementType.DEFAULT, new org.apache.blur.thirdparty.thrift_0_9_0.meta_data.ListMetaData(org.apache.blur.thirdparty.thrift_0_9_0.protocol.TType.LIST, new org.apache.blur.thirdparty.thrift_0_9_0.meta_data.StructMetaData(org.apache.blur.thirdparty.thrift_0_9_0.protocol.TType.STRUCT, Value.class)))); @@ -152,19 +163,21 @@ public class AdhocByteCodeCommandRequest implements org.apache.blur.thirdparty.t new org.apache.blur.thirdparty.thrift_0_9_0.meta_data.ListMetaData(org.apache.blur.thirdparty.thrift_0_9_0.protocol.TType.LIST, new org.apache.blur.thirdparty.thrift_0_9_0.meta_data.FieldValueMetaData(org.apache.blur.thirdparty.thrift_0_9_0.protocol.TType.STRING)))); metaDataMap = Collections.unmodifiableMap(tmpMap); - org.apache.blur.thirdparty.thrift_0_9_0.meta_data.FieldMetaData.addStructMetaDataMap(AdhocByteCodeCommandRequest.class, metaDataMap); + org.apache.blur.thirdparty.thrift_0_9_0.meta_data.FieldMetaData.addStructMetaDataMap(AdHocByteCodeCommandRequest.class, metaDataMap); } - public AdhocByteCodeCommandRequest() { + public AdHocByteCodeCommandRequest() { } - public AdhocByteCodeCommandRequest( + public AdHocByteCodeCommandRequest( + Set<String> tablesToInvoke, List<Value> arguments, ByteBuffer instanceData, Map<String,ByteBuffer> classData, List<String> libraries) { this(); + this.tablesToInvoke = tablesToInvoke; this.arguments = arguments; this.instanceData = instanceData; this.classData = classData; @@ -174,7 +187,14 @@ public class AdhocByteCodeCommandRequest implements org.apache.blur.thirdparty.t /** * Performs a deep copy on <i>other</i>. */ - public AdhocByteCodeCommandRequest(AdhocByteCodeCommandRequest other) { + public AdHocByteCodeCommandRequest(AdHocByteCodeCommandRequest other) { + if (other.isSetTablesToInvoke()) { + Set<String> __this__tablesToInvoke = new HashSet<String>(); + for (String other_element : other.tablesToInvoke) { + __this__tablesToInvoke.add(other_element); + } + this.tablesToInvoke = __this__tablesToInvoke; + } if (other.isSetArguments()) { List<Value> __this__arguments = new ArrayList<Value>(); for (Value other_element : other.arguments) { @@ -211,18 +231,58 @@ public class AdhocByteCodeCommandRequest implements org.apache.blur.thirdparty.t } } - public AdhocByteCodeCommandRequest deepCopy() { - return new AdhocByteCodeCommandRequest(this); + public AdHocByteCodeCommandRequest deepCopy() { + return new AdHocByteCodeCommandRequest(this); } @Override public void clear() { + this.tablesToInvoke = null; this.arguments = null; this.instanceData = null; this.classData = null; this.libraries = null; } + public int getTablesToInvokeSize() { + return (this.tablesToInvoke == null) ? 0 : this.tablesToInvoke.size(); + } + + public java.util.Iterator<String> getTablesToInvokeIterator() { + return (this.tablesToInvoke == null) ? null : this.tablesToInvoke.iterator(); + } + + public void addToTablesToInvoke(String elem) { + if (this.tablesToInvoke == null) { + this.tablesToInvoke = new HashSet<String>(); + } + this.tablesToInvoke.add(elem); + } + + public Set<String> getTablesToInvoke() { + return this.tablesToInvoke; + } + + public AdHocByteCodeCommandRequest setTablesToInvoke(Set<String> tablesToInvoke) { + this.tablesToInvoke = tablesToInvoke; + return this; + } + + public void unsetTablesToInvoke() { + this.tablesToInvoke = null; + } + + /** Returns true if field tablesToInvoke is set (has been assigned a value) and false otherwise */ + public boolean isSetTablesToInvoke() { + return this.tablesToInvoke != null; + } + + public void setTablesToInvokeIsSet(boolean value) { + if (!value) { + this.tablesToInvoke = null; + } + } + public int getArgumentsSize() { return (this.arguments == null) ? 0 : this.arguments.size(); } @@ -242,7 +302,7 @@ public class AdhocByteCodeCommandRequest implements org.apache.blur.thirdparty.t return this.arguments; } - public AdhocByteCodeCommandRequest setArguments(List<Value> arguments) { + public AdHocByteCodeCommandRequest setArguments(List<Value> arguments) { this.arguments = arguments; return this; } @@ -271,12 +331,12 @@ public class AdhocByteCodeCommandRequest implements org.apache.blur.thirdparty.t return instanceData; } - public AdhocByteCodeCommandRequest setInstanceData(byte[] instanceData) { + public AdHocByteCodeCommandRequest setInstanceData(byte[] instanceData) { setInstanceData(instanceData == null ? (ByteBuffer)null : ByteBuffer.wrap(instanceData)); return this; } - public AdhocByteCodeCommandRequest setInstanceData(ByteBuffer instanceData) { + public AdHocByteCodeCommandRequest setInstanceData(ByteBuffer instanceData) { this.instanceData = instanceData; return this; } @@ -311,7 +371,7 @@ public class AdhocByteCodeCommandRequest implements org.apache.blur.thirdparty.t return this.classData; } - public AdhocByteCodeCommandRequest setClassData(Map<String,ByteBuffer> classData) { + public AdHocByteCodeCommandRequest setClassData(Map<String,ByteBuffer> classData) { this.classData = classData; return this; } @@ -350,7 +410,7 @@ public class AdhocByteCodeCommandRequest implements org.apache.blur.thirdparty.t return this.libraries; } - public AdhocByteCodeCommandRequest setLibraries(List<String> libraries) { + public AdHocByteCodeCommandRequest setLibraries(List<String> libraries) { this.libraries = libraries; return this; } @@ -372,6 +432,14 @@ public class AdhocByteCodeCommandRequest implements org.apache.blur.thirdparty.t public void setFieldValue(_Fields field, Object value) { switch (field) { + case TABLES_TO_INVOKE: + if (value == null) { + unsetTablesToInvoke(); + } else { + setTablesToInvoke((Set<String>)value); + } + break; + case ARGUMENTS: if (value == null) { unsetArguments(); @@ -409,6 +477,9 @@ public class AdhocByteCodeCommandRequest implements org.apache.blur.thirdparty.t public Object getFieldValue(_Fields field) { switch (field) { + case TABLES_TO_INVOKE: + return getTablesToInvoke(); + case ARGUMENTS: return getArguments(); @@ -432,6 +503,8 @@ public class AdhocByteCodeCommandRequest implements org.apache.blur.thirdparty.t } switch (field) { + case TABLES_TO_INVOKE: + return isSetTablesToInvoke(); case ARGUMENTS: return isSetArguments(); case INSTANCE_DATA: @@ -448,15 +521,24 @@ public class AdhocByteCodeCommandRequest implements org.apache.blur.thirdparty.t public boolean equals(Object that) { if (that == null) return false; - if (that instanceof AdhocByteCodeCommandRequest) - return this.equals((AdhocByteCodeCommandRequest)that); + if (that instanceof AdHocByteCodeCommandRequest) + return this.equals((AdHocByteCodeCommandRequest)that); return false; } - public boolean equals(AdhocByteCodeCommandRequest that) { + public boolean equals(AdHocByteCodeCommandRequest that) { if (that == null) return false; + boolean this_present_tablesToInvoke = true && this.isSetTablesToInvoke(); + boolean that_present_tablesToInvoke = true && that.isSetTablesToInvoke(); + if (this_present_tablesToInvoke || that_present_tablesToInvoke) { + if (!(this_present_tablesToInvoke && that_present_tablesToInvoke)) + return false; + if (!this.tablesToInvoke.equals(that.tablesToInvoke)) + return false; + } + boolean this_present_arguments = true && this.isSetArguments(); boolean that_present_arguments = true && that.isSetArguments(); if (this_present_arguments || that_present_arguments) { @@ -501,14 +583,24 @@ public class AdhocByteCodeCommandRequest implements org.apache.blur.thirdparty.t return 0; } - public int compareTo(AdhocByteCodeCommandRequest other) { + public int compareTo(AdHocByteCodeCommandRequest other) { if (!getClass().equals(other.getClass())) { return getClass().getName().compareTo(other.getClass().getName()); } int lastComparison = 0; - AdhocByteCodeCommandRequest typedOther = (AdhocByteCodeCommandRequest)other; + AdHocByteCodeCommandRequest typedOther = (AdHocByteCodeCommandRequest)other; + lastComparison = Boolean.valueOf(isSetTablesToInvoke()).compareTo(typedOther.isSetTablesToInvoke()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetTablesToInvoke()) { + lastComparison = org.apache.blur.thirdparty.thrift_0_9_0.TBaseHelper.compareTo(this.tablesToInvoke, typedOther.tablesToInvoke); + if (lastComparison != 0) { + return lastComparison; + } + } lastComparison = Boolean.valueOf(isSetArguments()).compareTo(typedOther.isSetArguments()); if (lastComparison != 0) { return lastComparison; @@ -566,9 +658,17 @@ public class AdhocByteCodeCommandRequest implements org.apache.blur.thirdparty.t @Override public String toString() { - StringBuilder sb = new StringBuilder("AdhocByteCodeCommandRequest("); + StringBuilder sb = new StringBuilder("AdHocByteCodeCommandRequest("); boolean first = true; + sb.append("tablesToInvoke:"); + if (this.tablesToInvoke == null) { + sb.append("null"); + } else { + sb.append(this.tablesToInvoke); + } + first = false; + if (!first) sb.append(", "); sb.append("arguments:"); if (this.arguments == null) { sb.append("null"); @@ -625,15 +725,15 @@ public class AdhocByteCodeCommandRequest implements org.apache.blur.thirdparty.t } } - private static class AdhocByteCodeCommandRequestStandardSchemeFactory implements SchemeFactory { - public AdhocByteCodeCommandRequestStandardScheme getScheme() { - return new AdhocByteCodeCommandRequestStandardScheme(); + private static class AdHocByteCodeCommandRequestStandardSchemeFactory implements SchemeFactory { + public AdHocByteCodeCommandRequestStandardScheme getScheme() { + return new AdHocByteCodeCommandRequestStandardScheme(); } } - private static class AdhocByteCodeCommandRequestStandardScheme extends StandardScheme<AdhocByteCodeCommandRequest> { + private static class AdHocByteCodeCommandRequestStandardScheme extends StandardScheme<AdHocByteCodeCommandRequest> { - public void read(org.apache.blur.thirdparty.thrift_0_9_0.protocol.TProtocol iprot, AdhocByteCodeCommandRequest struct) throws org.apache.blur.thirdparty.thrift_0_9_0.TException { + public void read(org.apache.blur.thirdparty.thrift_0_9_0.protocol.TProtocol iprot, AdHocByteCodeCommandRequest struct) throws org.apache.blur.thirdparty.thrift_0_9_0.TException { org.apache.blur.thirdparty.thrift_0_9_0.protocol.TField schemeField; iprot.readStructBegin(); while (true) @@ -643,17 +743,35 @@ public class AdhocByteCodeCommandRequest implements org.apache.blur.thirdparty.t break; } switch (schemeField.id) { - case 1: // ARGUMENTS + case 1: // TABLES_TO_INVOKE + if (schemeField.type == org.apache.blur.thirdparty.thrift_0_9_0.protocol.TType.SET) { + { + org.apache.blur.thirdparty.thrift_0_9_0.protocol.TSet _set232 = iprot.readSetBegin(); + struct.tablesToInvoke = new HashSet<String>(2*_set232.size); + for (int _i233 = 0; _i233 < _set232.size; ++_i233) + { + String _elem234; // required + _elem234 = iprot.readString(); + struct.tablesToInvoke.add(_elem234); + } + iprot.readSetEnd(); + } + struct.setTablesToInvokeIsSet(true); + } else { + org.apache.blur.thirdparty.thrift_0_9_0.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 2: // ARGUMENTS if (schemeField.type == org.apache.blur.thirdparty.thrift_0_9_0.protocol.TType.LIST) { { - org.apache.blur.thirdparty.thrift_0_9_0.protocol.TList _list232 = iprot.readListBegin(); - struct.arguments = new ArrayList<Value>(_list232.size); - for (int _i233 = 0; _i233 < _list232.size; ++_i233) + org.apache.blur.thirdparty.thrift_0_9_0.protocol.TList _list235 = iprot.readListBegin(); + struct.arguments = new ArrayList<Value>(_list235.size); + for (int _i236 = 0; _i236 < _list235.size; ++_i236) { - Value _elem234; // required - _elem234 = new Value(); - _elem234.read(iprot); - struct.arguments.add(_elem234); + Value _elem237; // required + _elem237 = new Value(); + _elem237.read(iprot); + struct.arguments.add(_elem237); } iprot.readListEnd(); } @@ -662,7 +780,7 @@ public class AdhocByteCodeCommandRequest implements org.apache.blur.thirdparty.t org.apache.blur.thirdparty.thrift_0_9_0.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; - case 2: // INSTANCE_DATA + case 3: // INSTANCE_DATA if (schemeField.type == org.apache.blur.thirdparty.thrift_0_9_0.protocol.TType.STRING) { struct.instanceData = iprot.readBinary(); struct.setInstanceDataIsSet(true); @@ -670,18 +788,18 @@ public class AdhocByteCodeCommandRequest implements org.apache.blur.thirdparty.t org.apache.blur.thirdparty.thrift_0_9_0.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; - case 3: // CLASS_DATA + case 4: // CLASS_DATA if (schemeField.type == org.apache.blur.thirdparty.thrift_0_9_0.protocol.TType.MAP) { { - org.apache.blur.thirdparty.thrift_0_9_0.protocol.TMap _map235 = iprot.readMapBegin(); - struct.classData = new HashMap<String,ByteBuffer>(2*_map235.size); - for (int _i236 = 0; _i236 < _map235.size; ++_i236) + org.apache.blur.thirdparty.thrift_0_9_0.protocol.TMap _map238 = iprot.readMapBegin(); + struct.classData = new HashMap<String,ByteBuffer>(2*_map238.size); + for (int _i239 = 0; _i239 < _map238.size; ++_i239) { - String _key237; // optional - ByteBuffer _val238; // required - _key237 = iprot.readString(); - _val238 = iprot.readBinary(); - struct.classData.put(_key237, _val238); + String _key240; // optional + ByteBuffer _val241; // required + _key240 = iprot.readString(); + _val241 = iprot.readBinary(); + struct.classData.put(_key240, _val241); } iprot.readMapEnd(); } @@ -690,16 +808,16 @@ public class AdhocByteCodeCommandRequest implements org.apache.blur.thirdparty.t org.apache.blur.thirdparty.thrift_0_9_0.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; - case 4: // LIBRARIES + case 5: // LIBRARIES if (schemeField.type == org.apache.blur.thirdparty.thrift_0_9_0.protocol.TType.LIST) { { - org.apache.blur.thirdparty.thrift_0_9_0.protocol.TList _list239 = iprot.readListBegin(); - struct.libraries = new ArrayList<String>(_list239.size); - for (int _i240 = 0; _i240 < _list239.size; ++_i240) + org.apache.blur.thirdparty.thrift_0_9_0.protocol.TList _list242 = iprot.readListBegin(); + struct.libraries = new ArrayList<String>(_list242.size); + for (int _i243 = 0; _i243 < _list242.size; ++_i243) { - String _elem241; // required - _elem241 = iprot.readString(); - struct.libraries.add(_elem241); + String _elem244; // required + _elem244 = iprot.readString(); + struct.libraries.add(_elem244); } iprot.readListEnd(); } @@ -719,17 +837,29 @@ public class AdhocByteCodeCommandRequest implements org.apache.blur.thirdparty.t struct.validate(); } - public void write(org.apache.blur.thirdparty.thrift_0_9_0.protocol.TProtocol oprot, AdhocByteCodeCommandRequest struct) throws org.apache.blur.thirdparty.thrift_0_9_0.TException { + public void write(org.apache.blur.thirdparty.thrift_0_9_0.protocol.TProtocol oprot, AdHocByteCodeCommandRequest struct) throws org.apache.blur.thirdparty.thrift_0_9_0.TException { struct.validate(); oprot.writeStructBegin(STRUCT_DESC); + if (struct.tablesToInvoke != null) { + oprot.writeFieldBegin(TABLES_TO_INVOKE_FIELD_DESC); + { + oprot.writeSetBegin(new org.apache.blur.thirdparty.thrift_0_9_0.protocol.TSet(org.apache.blur.thirdparty.thrift_0_9_0.protocol.TType.STRING, struct.tablesToInvoke.size())); + for (String _iter245 : struct.tablesToInvoke) + { + oprot.writeString(_iter245); + } + oprot.writeSetEnd(); + } + oprot.writeFieldEnd(); + } if (struct.arguments != null) { oprot.writeFieldBegin(ARGUMENTS_FIELD_DESC); { oprot.writeListBegin(new org.apache.blur.thirdparty.thrift_0_9_0.protocol.TList(org.apache.blur.thirdparty.thrift_0_9_0.protocol.TType.STRUCT, struct.arguments.size())); - for (Value _iter242 : struct.arguments) + for (Value _iter246 : struct.arguments) { - _iter242.write(oprot); + _iter246.write(oprot); } oprot.writeListEnd(); } @@ -744,10 +874,10 @@ public class AdhocByteCodeCommandRequest implements org.apache.blur.thirdparty.t oprot.writeFieldBegin(CLASS_DATA_FIELD_DESC); { oprot.writeMapBegin(new org.apache.blur.thirdparty.thrift_0_9_0.protocol.TMap(org.apache.blur.thirdparty.thrift_0_9_0.protocol.TType.STRING, org.apache.blur.thirdparty.thrift_0_9_0.protocol.TType.STRING, struct.classData.size())); - for (Map.Entry<String, ByteBuffer> _iter243 : struct.classData.entrySet()) + for (Map.Entry<String, ByteBuffer> _iter247 : struct.classData.entrySet()) { - oprot.writeString(_iter243.getKey()); - oprot.writeBinary(_iter243.getValue()); + oprot.writeString(_iter247.getKey()); + oprot.writeBinary(_iter247.getValue()); } oprot.writeMapEnd(); } @@ -757,9 +887,9 @@ public class AdhocByteCodeCommandRequest implements org.apache.blur.thirdparty.t oprot.writeFieldBegin(LIBRARIES_FIELD_DESC); { oprot.writeListBegin(new org.apache.blur.thirdparty.thrift_0_9_0.protocol.TList(org.apache.blur.thirdparty.thrift_0_9_0.protocol.TType.STRING, struct.libraries.size())); - for (String _iter244 : struct.libraries) + for (String _iter248 : struct.libraries) { - oprot.writeString(_iter244); + oprot.writeString(_iter248); } oprot.writeListEnd(); } @@ -771,37 +901,49 @@ public class AdhocByteCodeCommandRequest implements org.apache.blur.thirdparty.t } - private static class AdhocByteCodeCommandRequestTupleSchemeFactory implements SchemeFactory { - public AdhocByteCodeCommandRequestTupleScheme getScheme() { - return new AdhocByteCodeCommandRequestTupleScheme(); + private static class AdHocByteCodeCommandRequestTupleSchemeFactory implements SchemeFactory { + public AdHocByteCodeCommandRequestTupleScheme getScheme() { + return new AdHocByteCodeCommandRequestTupleScheme(); } } - private static class AdhocByteCodeCommandRequestTupleScheme extends TupleScheme<AdhocByteCodeCommandRequest> { + private static class AdHocByteCodeCommandRequestTupleScheme extends TupleScheme<AdHocByteCodeCommandRequest> { @Override - public void write(org.apache.blur.thirdparty.thrift_0_9_0.protocol.TProtocol prot, AdhocByteCodeCommandRequest struct) throws org.apache.blur.thirdparty.thrift_0_9_0.TException { + public void write(org.apache.blur.thirdparty.thrift_0_9_0.protocol.TProtocol prot, AdHocByteCodeCommandRequest struct) throws org.apache.blur.thirdparty.thrift_0_9_0.TException { TTupleProtocol oprot = (TTupleProtocol) prot; BitSet optionals = new BitSet(); - if (struct.isSetArguments()) { + if (struct.isSetTablesToInvoke()) { optionals.set(0); } - if (struct.isSetInstanceData()) { + if (struct.isSetArguments()) { optionals.set(1); } - if (struct.isSetClassData()) { + if (struct.isSetInstanceData()) { optionals.set(2); } - if (struct.isSetLibraries()) { + if (struct.isSetClassData()) { optionals.set(3); } - oprot.writeBitSet(optionals, 4); + if (struct.isSetLibraries()) { + optionals.set(4); + } + oprot.writeBitSet(optionals, 5); + if (struct.isSetTablesToInvoke()) { + { + oprot.writeI32(struct.tablesToInvoke.size()); + for (String _iter249 : struct.tablesToInvoke) + { + oprot.writeString(_iter249); + } + } + } if (struct.isSetArguments()) { { oprot.writeI32(struct.arguments.size()); - for (Value _iter245 : struct.arguments) + for (Value _iter250 : struct.arguments) { - _iter245.write(oprot); + _iter250.write(oprot); } } } @@ -811,70 +953,83 @@ public class AdhocByteCodeCommandRequest implements org.apache.blur.thirdparty.t if (struct.isSetClassData()) { { oprot.writeI32(struct.classData.size()); - for (Map.Entry<String, ByteBuffer> _iter246 : struct.classData.entrySet()) + for (Map.Entry<String, ByteBuffer> _iter251 : struct.classData.entrySet()) { - oprot.writeString(_iter246.getKey()); - oprot.writeBinary(_iter246.getValue()); + oprot.writeString(_iter251.getKey()); + oprot.writeBinary(_iter251.getValue()); } } } if (struct.isSetLibraries()) { { oprot.writeI32(struct.libraries.size()); - for (String _iter247 : struct.libraries) + for (String _iter252 : struct.libraries) { - oprot.writeString(_iter247); + oprot.writeString(_iter252); } } } } @Override - public void read(org.apache.blur.thirdparty.thrift_0_9_0.protocol.TProtocol prot, AdhocByteCodeCommandRequest struct) throws org.apache.blur.thirdparty.thrift_0_9_0.TException { + public void read(org.apache.blur.thirdparty.thrift_0_9_0.protocol.TProtocol prot, AdHocByteCodeCommandRequest struct) throws org.apache.blur.thirdparty.thrift_0_9_0.TException { TTupleProtocol iprot = (TTupleProtocol) prot; - BitSet incoming = iprot.readBitSet(4); + BitSet incoming = iprot.readBitSet(5); if (incoming.get(0)) { { - org.apache.blur.thirdparty.thrift_0_9_0.protocol.TList _list248 = new org.apache.blur.thirdparty.thrift_0_9_0.protocol.TList(org.apache.blur.thirdparty.thrift_0_9_0.protocol.TType.STRUCT, iprot.readI32()); - struct.arguments = new ArrayList<Value>(_list248.size); - for (int _i249 = 0; _i249 < _list248.size; ++_i249) + org.apache.blur.thirdparty.thrift_0_9_0.protocol.TSet _set253 = new org.apache.blur.thirdparty.thrift_0_9_0.protocol.TSet(org.apache.blur.thirdparty.thrift_0_9_0.protocol.TType.STRING, iprot.readI32()); + struct.tablesToInvoke = new HashSet<String>(2*_set253.size); + for (int _i254 = 0; _i254 < _set253.size; ++_i254) { - Value _elem250; // required - _elem250 = new Value(); - _elem250.read(iprot); - struct.arguments.add(_elem250); + String _elem255; // required + _elem255 = iprot.readString(); + struct.tablesToInvoke.add(_elem255); } } - struct.setArgumentsIsSet(true); + struct.setTablesToInvokeIsSet(true); } if (incoming.get(1)) { + { + org.apache.blur.thirdparty.thrift_0_9_0.protocol.TList _list256 = new org.apache.blur.thirdparty.thrift_0_9_0.protocol.TList(org.apache.blur.thirdparty.thrift_0_9_0.protocol.TType.STRUCT, iprot.readI32()); + struct.arguments = new ArrayList<Value>(_list256.size); + for (int _i257 = 0; _i257 < _list256.size; ++_i257) + { + Value _elem258; // required + _elem258 = new Value(); + _elem258.read(iprot); + struct.arguments.add(_elem258); + } + } + struct.setArgumentsIsSet(true); + } + if (incoming.get(2)) { struct.instanceData = iprot.readBinary(); struct.setInstanceDataIsSet(true); } - if (incoming.get(2)) { + if (incoming.get(3)) { { - org.apache.blur.thirdparty.thrift_0_9_0.protocol.TMap _map251 = new org.apache.blur.thirdparty.thrift_0_9_0.protocol.TMap(org.apache.blur.thirdparty.thrift_0_9_0.protocol.TType.STRING, org.apache.blur.thirdparty.thrift_0_9_0.protocol.TType.STRING, iprot.readI32()); - struct.classData = new HashMap<String,ByteBuffer>(2*_map251.size); - for (int _i252 = 0; _i252 < _map251.size; ++_i252) + org.apache.blur.thirdparty.thrift_0_9_0.protocol.TMap _map259 = new org.apache.blur.thirdparty.thrift_0_9_0.protocol.TMap(org.apache.blur.thirdparty.thrift_0_9_0.protocol.TType.STRING, org.apache.blur.thirdparty.thrift_0_9_0.protocol.TType.STRING, iprot.readI32()); + struct.classData = new HashMap<String,ByteBuffer>(2*_map259.size); + for (int _i260 = 0; _i260 < _map259.size; ++_i260) { - String _key253; // optional - ByteBuffer _val254; // required - _key253 = iprot.readString(); - _val254 = iprot.readBinary(); - struct.classData.put(_key253, _val254); + String _key261; // optional + ByteBuffer _val262; // required + _key261 = iprot.readString(); + _val262 = iprot.readBinary(); + struct.classData.put(_key261, _val262); } } struct.setClassDataIsSet(true); } - if (incoming.get(3)) { + if (incoming.get(4)) { { - org.apache.blur.thirdparty.thrift_0_9_0.protocol.TList _list255 = new org.apache.blur.thirdparty.thrift_0_9_0.protocol.TList(org.apache.blur.thirdparty.thrift_0_9_0.protocol.TType.STRING, iprot.readI32()); - struct.libraries = new ArrayList<String>(_list255.size); - for (int _i256 = 0; _i256 < _list255.size; ++_i256) + org.apache.blur.thirdparty.thrift_0_9_0.protocol.TList _list263 = new org.apache.blur.thirdparty.thrift_0_9_0.protocol.TList(org.apache.blur.thirdparty.thrift_0_9_0.protocol.TType.STRING, iprot.readI32()); + struct.libraries = new ArrayList<String>(_list263.size); + for (int _i264 = 0; _i264 < _list263.size; ++_i264) { - String _elem257; // required - _elem257 = iprot.readString(); - struct.libraries.add(_elem257); + String _elem265; // required + _elem265 = iprot.readString(); + struct.libraries.add(_elem265); } } struct.setLibrariesIsSet(true); http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/d96892e4/blur-thrift/src/main/java/org/apache/blur/thrift/generated/AdhocByteCodeCommandResponse.java ---------------------------------------------------------------------- diff --git a/blur-thrift/src/main/java/org/apache/blur/thrift/generated/AdhocByteCodeCommandResponse.java b/blur-thrift/src/main/java/org/apache/blur/thrift/generated/AdhocByteCodeCommandResponse.java index 9f38edd..f9dcb2f 100644 --- a/blur-thrift/src/main/java/org/apache/blur/thrift/generated/AdhocByteCodeCommandResponse.java +++ b/blur-thrift/src/main/java/org/apache/blur/thrift/generated/AdhocByteCodeCommandResponse.java @@ -49,15 +49,15 @@ import java.util.Arrays; //import org.slf4j.Logger; //import org.slf4j.LoggerFactory; -public class AdhocByteCodeCommandResponse implements org.apache.blur.thirdparty.thrift_0_9_0.TBase<AdhocByteCodeCommandResponse, AdhocByteCodeCommandResponse._Fields>, java.io.Serializable, Cloneable { - private static final org.apache.blur.thirdparty.thrift_0_9_0.protocol.TStruct STRUCT_DESC = new org.apache.blur.thirdparty.thrift_0_9_0.protocol.TStruct("AdhocByteCodeCommandResponse"); +public class AdHocByteCodeCommandResponse implements org.apache.blur.thirdparty.thrift_0_9_0.TBase<AdHocByteCodeCommandResponse, AdHocByteCodeCommandResponse._Fields>, java.io.Serializable, Cloneable { + private static final org.apache.blur.thirdparty.thrift_0_9_0.protocol.TStruct STRUCT_DESC = new org.apache.blur.thirdparty.thrift_0_9_0.protocol.TStruct("AdHocByteCodeCommandResponse"); private static final org.apache.blur.thirdparty.thrift_0_9_0.protocol.TField RESULT_FIELD_DESC = new org.apache.blur.thirdparty.thrift_0_9_0.protocol.TField("result", org.apache.blur.thirdparty.thrift_0_9_0.protocol.TType.STRUCT, (short)1); private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>(); static { - schemes.put(StandardScheme.class, new AdhocByteCodeCommandResponseStandardSchemeFactory()); - schemes.put(TupleScheme.class, new AdhocByteCodeCommandResponseTupleSchemeFactory()); + schemes.put(StandardScheme.class, new AdHocByteCodeCommandResponseStandardSchemeFactory()); + schemes.put(TupleScheme.class, new AdHocByteCodeCommandResponseTupleSchemeFactory()); } public Value result; // required @@ -127,13 +127,13 @@ public class AdhocByteCodeCommandResponse implements org.apache.blur.thirdparty. tmpMap.put(_Fields.RESULT, new org.apache.blur.thirdparty.thrift_0_9_0.meta_data.FieldMetaData("result", org.apache.blur.thirdparty.thrift_0_9_0.TFieldRequirementType.DEFAULT, new org.apache.blur.thirdparty.thrift_0_9_0.meta_data.StructMetaData(org.apache.blur.thirdparty.thrift_0_9_0.protocol.TType.STRUCT, Value.class))); metaDataMap = Collections.unmodifiableMap(tmpMap); - org.apache.blur.thirdparty.thrift_0_9_0.meta_data.FieldMetaData.addStructMetaDataMap(AdhocByteCodeCommandResponse.class, metaDataMap); + org.apache.blur.thirdparty.thrift_0_9_0.meta_data.FieldMetaData.addStructMetaDataMap(AdHocByteCodeCommandResponse.class, metaDataMap); } - public AdhocByteCodeCommandResponse() { + public AdHocByteCodeCommandResponse() { } - public AdhocByteCodeCommandResponse( + public AdHocByteCodeCommandResponse( Value result) { this(); @@ -143,14 +143,14 @@ public class AdhocByteCodeCommandResponse implements org.apache.blur.thirdparty. /** * Performs a deep copy on <i>other</i>. */ - public AdhocByteCodeCommandResponse(AdhocByteCodeCommandResponse other) { + public AdHocByteCodeCommandResponse(AdHocByteCodeCommandResponse other) { if (other.isSetResult()) { this.result = new Value(other.result); } } - public AdhocByteCodeCommandResponse deepCopy() { - return new AdhocByteCodeCommandResponse(this); + public AdHocByteCodeCommandResponse deepCopy() { + return new AdHocByteCodeCommandResponse(this); } @Override @@ -162,7 +162,7 @@ public class AdhocByteCodeCommandResponse implements org.apache.blur.thirdparty. return this.result; } - public AdhocByteCodeCommandResponse setResult(Value result) { + public AdHocByteCodeCommandResponse setResult(Value result) { this.result = result; return this; } @@ -221,12 +221,12 @@ public class AdhocByteCodeCommandResponse implements org.apache.blur.thirdparty. public boolean equals(Object that) { if (that == null) return false; - if (that instanceof AdhocByteCodeCommandResponse) - return this.equals((AdhocByteCodeCommandResponse)that); + if (that instanceof AdHocByteCodeCommandResponse) + return this.equals((AdHocByteCodeCommandResponse)that); return false; } - public boolean equals(AdhocByteCodeCommandResponse that) { + public boolean equals(AdHocByteCodeCommandResponse that) { if (that == null) return false; @@ -247,13 +247,13 @@ public class AdhocByteCodeCommandResponse implements org.apache.blur.thirdparty. return 0; } - public int compareTo(AdhocByteCodeCommandResponse other) { + public int compareTo(AdHocByteCodeCommandResponse other) { if (!getClass().equals(other.getClass())) { return getClass().getName().compareTo(other.getClass().getName()); } int lastComparison = 0; - AdhocByteCodeCommandResponse typedOther = (AdhocByteCodeCommandResponse)other; + AdHocByteCodeCommandResponse typedOther = (AdHocByteCodeCommandResponse)other; lastComparison = Boolean.valueOf(isSetResult()).compareTo(typedOther.isSetResult()); if (lastComparison != 0) { @@ -282,7 +282,7 @@ public class AdhocByteCodeCommandResponse implements org.apache.blur.thirdparty. @Override public String toString() { - StringBuilder sb = new StringBuilder("AdhocByteCodeCommandResponse("); + StringBuilder sb = new StringBuilder("AdHocByteCodeCommandResponse("); boolean first = true; sb.append("result:"); @@ -320,15 +320,15 @@ public class AdhocByteCodeCommandResponse implements org.apache.blur.thirdparty. } } - private static class AdhocByteCodeCommandResponseStandardSchemeFactory implements SchemeFactory { - public AdhocByteCodeCommandResponseStandardScheme getScheme() { - return new AdhocByteCodeCommandResponseStandardScheme(); + private static class AdHocByteCodeCommandResponseStandardSchemeFactory implements SchemeFactory { + public AdHocByteCodeCommandResponseStandardScheme getScheme() { + return new AdHocByteCodeCommandResponseStandardScheme(); } } - private static class AdhocByteCodeCommandResponseStandardScheme extends StandardScheme<AdhocByteCodeCommandResponse> { + private static class AdHocByteCodeCommandResponseStandardScheme extends StandardScheme<AdHocByteCodeCommandResponse> { - public void read(org.apache.blur.thirdparty.thrift_0_9_0.protocol.TProtocol iprot, AdhocByteCodeCommandResponse struct) throws org.apache.blur.thirdparty.thrift_0_9_0.TException { + public void read(org.apache.blur.thirdparty.thrift_0_9_0.protocol.TProtocol iprot, AdHocByteCodeCommandResponse struct) throws org.apache.blur.thirdparty.thrift_0_9_0.TException { org.apache.blur.thirdparty.thrift_0_9_0.protocol.TField schemeField; iprot.readStructBegin(); while (true) @@ -358,7 +358,7 @@ public class AdhocByteCodeCommandResponse implements org.apache.blur.thirdparty. struct.validate(); } - public void write(org.apache.blur.thirdparty.thrift_0_9_0.protocol.TProtocol oprot, AdhocByteCodeCommandResponse struct) throws org.apache.blur.thirdparty.thrift_0_9_0.TException { + public void write(org.apache.blur.thirdparty.thrift_0_9_0.protocol.TProtocol oprot, AdHocByteCodeCommandResponse struct) throws org.apache.blur.thirdparty.thrift_0_9_0.TException { struct.validate(); oprot.writeStructBegin(STRUCT_DESC); @@ -373,16 +373,16 @@ public class AdhocByteCodeCommandResponse implements org.apache.blur.thirdparty. } - private static class AdhocByteCodeCommandResponseTupleSchemeFactory implements SchemeFactory { - public AdhocByteCodeCommandResponseTupleScheme getScheme() { - return new AdhocByteCodeCommandResponseTupleScheme(); + private static class AdHocByteCodeCommandResponseTupleSchemeFactory implements SchemeFactory { + public AdHocByteCodeCommandResponseTupleScheme getScheme() { + return new AdHocByteCodeCommandResponseTupleScheme(); } } - private static class AdhocByteCodeCommandResponseTupleScheme extends TupleScheme<AdhocByteCodeCommandResponse> { + private static class AdHocByteCodeCommandResponseTupleScheme extends TupleScheme<AdHocByteCodeCommandResponse> { @Override - public void write(org.apache.blur.thirdparty.thrift_0_9_0.protocol.TProtocol prot, AdhocByteCodeCommandResponse struct) throws org.apache.blur.thirdparty.thrift_0_9_0.TException { + public void write(org.apache.blur.thirdparty.thrift_0_9_0.protocol.TProtocol prot, AdHocByteCodeCommandResponse struct) throws org.apache.blur.thirdparty.thrift_0_9_0.TException { TTupleProtocol oprot = (TTupleProtocol) prot; BitSet optionals = new BitSet(); if (struct.isSetResult()) { @@ -395,7 +395,7 @@ public class AdhocByteCodeCommandResponse implements org.apache.blur.thirdparty. } @Override - public void read(org.apache.blur.thirdparty.thrift_0_9_0.protocol.TProtocol prot, AdhocByteCodeCommandResponse struct) throws org.apache.blur.thirdparty.thrift_0_9_0.TException { + public void read(org.apache.blur.thirdparty.thrift_0_9_0.protocol.TProtocol prot, AdHocByteCodeCommandResponse struct) throws org.apache.blur.thirdparty.thrift_0_9_0.TException { TTupleProtocol iprot = (TTupleProtocol) prot; BitSet incoming = iprot.readBitSet(1); if (incoming.get(0)) { http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/d96892e4/blur-thrift/src/main/java/org/apache/blur/thrift/generated/BlurCommandRequest.java ---------------------------------------------------------------------- diff --git a/blur-thrift/src/main/java/org/apache/blur/thrift/generated/BlurCommandRequest.java b/blur-thrift/src/main/java/org/apache/blur/thrift/generated/BlurCommandRequest.java index 87265a0..0847786 100644 --- a/blur-thrift/src/main/java/org/apache/blur/thrift/generated/BlurCommandRequest.java +++ b/blur-thrift/src/main/java/org/apache/blur/thrift/generated/BlurCommandRequest.java @@ -51,13 +51,11 @@ import java.util.Arrays; public class BlurCommandRequest extends org.apache.blur.thirdparty.thrift_0_9_0.TUnion<BlurCommandRequest, BlurCommandRequest._Fields> { private static final org.apache.blur.thirdparty.thrift_0_9_0.protocol.TStruct STRUCT_DESC = new org.apache.blur.thirdparty.thrift_0_9_0.protocol.TStruct("BlurCommandRequest"); - private static final org.apache.blur.thirdparty.thrift_0_9_0.protocol.TField TABLES_TO_INVOKE_FIELD_DESC = new org.apache.blur.thirdparty.thrift_0_9_0.protocol.TField("tablesToInvoke", org.apache.blur.thirdparty.thrift_0_9_0.protocol.TType.SET, (short)1); - private static final org.apache.blur.thirdparty.thrift_0_9_0.protocol.TField ADHOC_BYTE_CODE_COMMAND_REQUEST_FIELD_DESC = new org.apache.blur.thirdparty.thrift_0_9_0.protocol.TField("adhocByteCodeCommandRequest", org.apache.blur.thirdparty.thrift_0_9_0.protocol.TType.STRUCT, (short)2); + private static final org.apache.blur.thirdparty.thrift_0_9_0.protocol.TField AD_HOC_BYTE_CODE_COMMAND_REQUEST_FIELD_DESC = new org.apache.blur.thirdparty.thrift_0_9_0.protocol.TField("adHocByteCodeCommandRequest", org.apache.blur.thirdparty.thrift_0_9_0.protocol.TType.STRUCT, (short)1); /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ public enum _Fields implements org.apache.blur.thirdparty.thrift_0_9_0.TFieldIdEnum { - TABLES_TO_INVOKE((short)1, "tablesToInvoke"), - ADHOC_BYTE_CODE_COMMAND_REQUEST((short)2, "adhocByteCodeCommandRequest"); + AD_HOC_BYTE_CODE_COMMAND_REQUEST((short)1, "adHocByteCodeCommandRequest"); private static final Map<String, _Fields> byName = new HashMap<String, _Fields>(); @@ -72,10 +70,8 @@ public class BlurCommandRequest extends org.apache.blur.thirdparty.thrift_0_9_0. */ public static _Fields findByThriftId(int fieldId) { switch(fieldId) { - case 1: // TABLES_TO_INVOKE - return TABLES_TO_INVOKE; - case 2: // ADHOC_BYTE_CODE_COMMAND_REQUEST - return ADHOC_BYTE_CODE_COMMAND_REQUEST; + case 1: // AD_HOC_BYTE_CODE_COMMAND_REQUEST + return AD_HOC_BYTE_CODE_COMMAND_REQUEST; default: return null; } @@ -118,11 +114,8 @@ public class BlurCommandRequest extends org.apache.blur.thirdparty.thrift_0_9_0. public static final Map<_Fields, org.apache.blur.thirdparty.thrift_0_9_0.meta_data.FieldMetaData> metaDataMap; static { Map<_Fields, org.apache.blur.thirdparty.thrift_0_9_0.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.blur.thirdparty.thrift_0_9_0.meta_data.FieldMetaData>(_Fields.class); - tmpMap.put(_Fields.TABLES_TO_INVOKE, new org.apache.blur.thirdparty.thrift_0_9_0.meta_data.FieldMetaData("tablesToInvoke", org.apache.blur.thirdparty.thrift_0_9_0.TFieldRequirementType.DEFAULT, - new org.apache.blur.thirdparty.thrift_0_9_0.meta_data.SetMetaData(org.apache.blur.thirdparty.thrift_0_9_0.protocol.TType.SET, - new org.apache.blur.thirdparty.thrift_0_9_0.meta_data.FieldValueMetaData(org.apache.blur.thirdparty.thrift_0_9_0.protocol.TType.STRING)))); - tmpMap.put(_Fields.ADHOC_BYTE_CODE_COMMAND_REQUEST, new org.apache.blur.thirdparty.thrift_0_9_0.meta_data.FieldMetaData("adhocByteCodeCommandRequest", org.apache.blur.thirdparty.thrift_0_9_0.TFieldRequirementType.DEFAULT, - new org.apache.blur.thirdparty.thrift_0_9_0.meta_data.StructMetaData(org.apache.blur.thirdparty.thrift_0_9_0.protocol.TType.STRUCT, AdhocByteCodeCommandRequest.class))); + tmpMap.put(_Fields.AD_HOC_BYTE_CODE_COMMAND_REQUEST, new org.apache.blur.thirdparty.thrift_0_9_0.meta_data.FieldMetaData("adHocByteCodeCommandRequest", org.apache.blur.thirdparty.thrift_0_9_0.TFieldRequirementType.DEFAULT, + new org.apache.blur.thirdparty.thrift_0_9_0.meta_data.StructMetaData(org.apache.blur.thirdparty.thrift_0_9_0.protocol.TType.STRUCT, AdHocByteCodeCommandRequest.class))); metaDataMap = Collections.unmodifiableMap(tmpMap); org.apache.blur.thirdparty.thrift_0_9_0.meta_data.FieldMetaData.addStructMetaDataMap(BlurCommandRequest.class, metaDataMap); } @@ -142,15 +135,9 @@ public class BlurCommandRequest extends org.apache.blur.thirdparty.thrift_0_9_0. return new BlurCommandRequest(this); } - public static BlurCommandRequest tablesToInvoke(Set<String> value) { + public static BlurCommandRequest adHocByteCodeCommandRequest(AdHocByteCodeCommandRequest value) { BlurCommandRequest x = new BlurCommandRequest(); - x.setTablesToInvoke(value); - return x; - } - - public static BlurCommandRequest adhocByteCodeCommandRequest(AdhocByteCodeCommandRequest value) { - BlurCommandRequest x = new BlurCommandRequest(); - x.setAdhocByteCodeCommandRequest(value); + x.setAdHocByteCodeCommandRequest(value); return x; } @@ -158,16 +145,11 @@ public class BlurCommandRequest extends org.apache.blur.thirdparty.thrift_0_9_0. @Override protected void checkType(_Fields setField, Object value) throws ClassCastException { switch (setField) { - case TABLES_TO_INVOKE: - if (value instanceof Set) { + case AD_HOC_BYTE_CODE_COMMAND_REQUEST: + if (value instanceof AdHocByteCodeCommandRequest) { break; } - throw new ClassCastException("Was expecting value of type Set<String> for field 'tablesToInvoke', but got " + value.getClass().getSimpleName()); - case ADHOC_BYTE_CODE_COMMAND_REQUEST: - if (value instanceof AdhocByteCodeCommandRequest) { - break; - } - throw new ClassCastException("Was expecting value of type AdhocByteCodeCommandRequest for field 'adhocByteCodeCommandRequest', but got " + value.getClass().getSimpleName()); + throw new ClassCastException("Was expecting value of type AdHocByteCodeCommandRequest for field 'adHocByteCodeCommandRequest', but got " + value.getClass().getSimpleName()); default: throw new IllegalArgumentException("Unknown field id " + setField); } @@ -178,31 +160,12 @@ public class BlurCommandRequest extends org.apache.blur.thirdparty.thrift_0_9_0. _Fields setField = _Fields.findByThriftId(field.id); if (setField != null) { switch (setField) { - case TABLES_TO_INVOKE: - if (field.type == TABLES_TO_INVOKE_FIELD_DESC.type) { - Set<String> tablesToInvoke; - { - org.apache.blur.thirdparty.thrift_0_9_0.protocol.TSet _set258 = iprot.readSetBegin(); - tablesToInvoke = new HashSet<String>(2*_set258.size); - for (int _i259 = 0; _i259 < _set258.size; ++_i259) - { - String _elem260; // required - _elem260 = iprot.readString(); - tablesToInvoke.add(_elem260); - } - iprot.readSetEnd(); - } - return tablesToInvoke; - } else { - org.apache.blur.thirdparty.thrift_0_9_0.protocol.TProtocolUtil.skip(iprot, field.type); - return null; - } - case ADHOC_BYTE_CODE_COMMAND_REQUEST: - if (field.type == ADHOC_BYTE_CODE_COMMAND_REQUEST_FIELD_DESC.type) { - AdhocByteCodeCommandRequest adhocByteCodeCommandRequest; - adhocByteCodeCommandRequest = new AdhocByteCodeCommandRequest(); - adhocByteCodeCommandRequest.read(iprot); - return adhocByteCodeCommandRequest; + case AD_HOC_BYTE_CODE_COMMAND_REQUEST: + if (field.type == AD_HOC_BYTE_CODE_COMMAND_REQUEST_FIELD_DESC.type) { + AdHocByteCodeCommandRequest adHocByteCodeCommandRequest; + adHocByteCodeCommandRequest = new AdHocByteCodeCommandRequest(); + adHocByteCodeCommandRequest.read(iprot); + return adHocByteCodeCommandRequest; } else { org.apache.blur.thirdparty.thrift_0_9_0.protocol.TProtocolUtil.skip(iprot, field.type); return null; @@ -218,20 +181,9 @@ public class BlurCommandRequest extends org.apache.blur.thirdparty.thrift_0_9_0. @Override protected void standardSchemeWriteValue(org.apache.blur.thirdparty.thrift_0_9_0.protocol.TProtocol oprot) throws org.apache.blur.thirdparty.thrift_0_9_0.TException { switch (setField_) { - case TABLES_TO_INVOKE: - Set<String> tablesToInvoke = (Set<String>)value_; - { - oprot.writeSetBegin(new org.apache.blur.thirdparty.thrift_0_9_0.protocol.TSet(org.apache.blur.thirdparty.thrift_0_9_0.protocol.TType.STRING, tablesToInvoke.size())); - for (String _iter261 : tablesToInvoke) - { - oprot.writeString(_iter261); - } - oprot.writeSetEnd(); - } - return; - case ADHOC_BYTE_CODE_COMMAND_REQUEST: - AdhocByteCodeCommandRequest adhocByteCodeCommandRequest = (AdhocByteCodeCommandRequest)value_; - adhocByteCodeCommandRequest.write(oprot); + case AD_HOC_BYTE_CODE_COMMAND_REQUEST: + AdHocByteCodeCommandRequest adHocByteCodeCommandRequest = (AdHocByteCodeCommandRequest)value_; + adHocByteCodeCommandRequest.write(oprot); return; default: throw new IllegalStateException("Cannot write union with unknown field " + setField_); @@ -243,25 +195,11 @@ public class BlurCommandRequest extends org.apache.blur.thirdparty.thrift_0_9_0. _Fields setField = _Fields.findByThriftId(fieldID); if (setField != null) { switch (setField) { - case TABLES_TO_INVOKE: - Set<String> tablesToInvoke; - { - org.apache.blur.thirdparty.thrift_0_9_0.protocol.TSet _set262 = iprot.readSetBegin(); - tablesToInvoke = new HashSet<String>(2*_set262.size); - for (int _i263 = 0; _i263 < _set262.size; ++_i263) - { - String _elem264; // required - _elem264 = iprot.readString(); - tablesToInvoke.add(_elem264); - } - iprot.readSetEnd(); - } - return tablesToInvoke; - case ADHOC_BYTE_CODE_COMMAND_REQUEST: - AdhocByteCodeCommandRequest adhocByteCodeCommandRequest; - adhocByteCodeCommandRequest = new AdhocByteCodeCommandRequest(); - adhocByteCodeCommandRequest.read(iprot); - return adhocByteCodeCommandRequest; + case AD_HOC_BYTE_CODE_COMMAND_REQUEST: + AdHocByteCodeCommandRequest adHocByteCodeCommandRequest; + adHocByteCodeCommandRequest = new AdHocByteCodeCommandRequest(); + adHocByteCodeCommandRequest.read(iprot); + return adHocByteCodeCommandRequest; default: throw new IllegalStateException("setField wasn't null, but didn't match any of the case statements!"); } @@ -273,20 +211,9 @@ public class BlurCommandRequest extends org.apache.blur.thirdparty.thrift_0_9_0. @Override protected void tupleSchemeWriteValue(org.apache.blur.thirdparty.thrift_0_9_0.protocol.TProtocol oprot) throws org.apache.blur.thirdparty.thrift_0_9_0.TException { switch (setField_) { - case TABLES_TO_INVOKE: - Set<String> tablesToInvoke = (Set<String>)value_; - { - oprot.writeSetBegin(new org.apache.blur.thirdparty.thrift_0_9_0.protocol.TSet(org.apache.blur.thirdparty.thrift_0_9_0.protocol.TType.STRING, tablesToInvoke.size())); - for (String _iter265 : tablesToInvoke) - { - oprot.writeString(_iter265); - } - oprot.writeSetEnd(); - } - return; - case ADHOC_BYTE_CODE_COMMAND_REQUEST: - AdhocByteCodeCommandRequest adhocByteCodeCommandRequest = (AdhocByteCodeCommandRequest)value_; - adhocByteCodeCommandRequest.write(oprot); + case AD_HOC_BYTE_CODE_COMMAND_REQUEST: + AdHocByteCodeCommandRequest adHocByteCodeCommandRequest = (AdHocByteCodeCommandRequest)value_; + adHocByteCodeCommandRequest.write(oprot); return; default: throw new IllegalStateException("Cannot write union with unknown field " + setField_); @@ -296,10 +223,8 @@ public class BlurCommandRequest extends org.apache.blur.thirdparty.thrift_0_9_0. @Override protected org.apache.blur.thirdparty.thrift_0_9_0.protocol.TField getFieldDesc(_Fields setField) { switch (setField) { - case TABLES_TO_INVOKE: - return TABLES_TO_INVOKE_FIELD_DESC; - case ADHOC_BYTE_CODE_COMMAND_REQUEST: - return ADHOC_BYTE_CODE_COMMAND_REQUEST_FIELD_DESC; + case AD_HOC_BYTE_CODE_COMMAND_REQUEST: + return AD_HOC_BYTE_CODE_COMMAND_REQUEST_FIELD_DESC; default: throw new IllegalArgumentException("Unknown field id " + setField); } @@ -320,41 +245,22 @@ public class BlurCommandRequest extends org.apache.blur.thirdparty.thrift_0_9_0. } - public Set<String> getTablesToInvoke() { - if (getSetField() == _Fields.TABLES_TO_INVOKE) { - return (Set<String>)getFieldValue(); - } else { - throw new RuntimeException("Cannot get field 'tablesToInvoke' because union is currently set to " + getFieldDesc(getSetField()).name); - } - } - - public void setTablesToInvoke(Set<String> value) { - if (value == null) throw new NullPointerException(); - setField_ = _Fields.TABLES_TO_INVOKE; - value_ = value; - } - - public AdhocByteCodeCommandRequest getAdhocByteCodeCommandRequest() { - if (getSetField() == _Fields.ADHOC_BYTE_CODE_COMMAND_REQUEST) { - return (AdhocByteCodeCommandRequest)getFieldValue(); + public AdHocByteCodeCommandRequest getAdHocByteCodeCommandRequest() { + if (getSetField() == _Fields.AD_HOC_BYTE_CODE_COMMAND_REQUEST) { + return (AdHocByteCodeCommandRequest)getFieldValue(); } else { - throw new RuntimeException("Cannot get field 'adhocByteCodeCommandRequest' because union is currently set to " + getFieldDesc(getSetField()).name); + throw new RuntimeException("Cannot get field 'adHocByteCodeCommandRequest' because union is currently set to " + getFieldDesc(getSetField()).name); } } - public void setAdhocByteCodeCommandRequest(AdhocByteCodeCommandRequest value) { + public void setAdHocByteCodeCommandRequest(AdHocByteCodeCommandRequest value) { if (value == null) throw new NullPointerException(); - setField_ = _Fields.ADHOC_BYTE_CODE_COMMAND_REQUEST; + setField_ = _Fields.AD_HOC_BYTE_CODE_COMMAND_REQUEST; value_ = value; } - public boolean isSetTablesToInvoke() { - return setField_ == _Fields.TABLES_TO_INVOKE; - } - - - public boolean isSetAdhocByteCodeCommandRequest() { - return setField_ == _Fields.ADHOC_BYTE_CODE_COMMAND_REQUEST; + public boolean isSetAdHocByteCodeCommandRequest() { + return setField_ == _Fields.AD_HOC_BYTE_CODE_COMMAND_REQUEST; }
