diff --git a/zeppelin-interpreter/src/main/java/org/apache/zeppelin/interpreter/remote/InvokeResourceMethodEventMessage.java b/zeppelin-interpreter/src/main/java/org/apache/zeppelin/interpreter/remote/InvokeResourceMethodEventMessage.java new file mode 100644 index 00000000000..a2b06903460 --- /dev/null +++ b/zeppelin-interpreter/src/main/java/org/apache/zeppelin/interpreter/remote/InvokeResourceMethodEventMessage.java @@ -0,0 +1,94 @@ +/* + * 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. + */ +package org.apache.zeppelin.interpreter.remote; + +import org.apache.zeppelin.resource.ResourceId; + +/** + * message payload to invoke method of resource in the resourcepool + */ +public class InvokeResourceMethodEventMessage { + public final ResourceId resourceId; + public final String methodName; + public final String[] paramClassnames; + public final Object[] params; + public final String returnResourceName; + + public InvokeResourceMethodEventMessage( + ResourceId resourceId, + String methodName, + Class[] paramtypes, + Object[] params, + String returnResourceName + ) { + this.resourceId = resourceId; + this.methodName = methodName; + if (paramtypes != null) { + paramClassnames = new String[paramtypes.length]; + for (int i = 0; i < paramClassnames.length; i++) { + paramClassnames[i] = paramtypes[i].getName(); + } + } else { + paramClassnames = null; + } + + this.params = params; + this.returnResourceName = returnResourceName; + } + + public Class [] getParamTypes() throws ClassNotFoundException { + if (paramClassnames == null) { + return null; + } + + Class [] types = new Class[paramClassnames.length]; + for (int i = 0; i < paramClassnames.length; i++) { + types[i] = this.getClass().getClassLoader().loadClass(paramClassnames[i]); + } + + return types; + } + + public boolean shouldPutResultIntoResourcePool() { + return (returnResourceName != null); + } + + @Override + public int hashCode() { + String hash = resourceId.hashCode() + methodName; + if (paramClassnames != null) { + for (String name : paramClassnames) { + hash += name; + } + } + if (returnResourceName != null) { + hash += returnResourceName; + } + + return hash.hashCode(); + } + + @Override + public boolean equals(Object o) { + if (o instanceof InvokeResourceMethodEventMessage) { + InvokeResourceMethodEventMessage r = (InvokeResourceMethodEventMessage) o; + return r.hashCode() == hashCode(); + } else { + return false; + } + } +} diff --git a/zeppelin-interpreter/src/main/java/org/apache/zeppelin/interpreter/remote/RemoteInterpreterEventClient.java b/zeppelin-interpreter/src/main/java/org/apache/zeppelin/interpreter/remote/RemoteInterpreterEventClient.java index 900d1ace3b6..606d35f60ee 100644 --- a/zeppelin-interpreter/src/main/java/org/apache/zeppelin/interpreter/remote/RemoteInterpreterEventClient.java +++ b/zeppelin-interpreter/src/main/java/org/apache/zeppelin/interpreter/remote/RemoteInterpreterEventClient.java @@ -50,6 +50,7 @@ public class RemoteInterpreterEventClient implements ResourcePoolConnector { private final List eventQueue = new LinkedList<>(); private final List getAllResourceResponse = new LinkedList<>(); private final Map getResourceResponse = new HashMap<>(); + private final Map getInvokeResponse = new HashMap<>(); private final Gson gson = new Gson(); /** @@ -164,6 +165,112 @@ public Object readResource(ResourceId resourceId) { } } + /** + * Invoke method and save result in resourcePool as another resource + * @param resourceId + * @param methodName + * @param paramTypes + * @param params + * @return + */ + @Override + public Object invokeMethod( + ResourceId resourceId, + String methodName, + Class[] paramTypes, + Object[] params) { + logger.debug("Request Invoke method {} of Resource {}", methodName, resourceId.getName()); + + InvokeResourceMethodEventMessage invokeMethod = new InvokeResourceMethodEventMessage( + resourceId, + methodName, + paramTypes, + params, + null); + + synchronized (getInvokeResponse) { + // wait for previous response consumed + while (getInvokeResponse.containsKey(invokeMethod)) { + try { + getInvokeResponse.wait(); + } catch (InterruptedException e) { + logger.warn(e.getMessage(), e); + } + } + // send request + Gson gson = new Gson(); + + sendEvent(new RemoteInterpreterEvent( + RemoteInterpreterEventType.RESOURCE_INVOKE_METHOD, + gson.toJson(invokeMethod))); + // wait for response + while (!getInvokeResponse.containsKey(invokeMethod)) { + try { + getInvokeResponse.wait(); + } catch (InterruptedException e) { + logger.warn(e.getMessage(), e); + } + } + Object o = getInvokeResponse.remove(invokeMethod); + getInvokeResponse.notifyAll(); + return o; + } + } + + /** + * Invoke method and save result in resourcePool as another resource + * @param resourceId + * @param methodName + * @param paramTypes + * @param params + * @param returnResourceName + * @return + */ + @Override + public Resource invokeMethod( + ResourceId resourceId, + String methodName, + Class[] paramTypes, + Object[] params, + String returnResourceName) { + logger.debug("Request Invoke method {} of Resource {}", methodName, resourceId.getName()); + + InvokeResourceMethodEventMessage invokeMethod = new InvokeResourceMethodEventMessage( + resourceId, + methodName, + paramTypes, + params, + returnResourceName); + + synchronized (getInvokeResponse) { + // wait for previous response consumed + while (getInvokeResponse.containsKey(invokeMethod)) { + try { + getInvokeResponse.wait(); + } catch (InterruptedException e) { + logger.warn(e.getMessage(), e); + } + } + // send request + Gson gson = new Gson(); + + sendEvent(new RemoteInterpreterEvent( + RemoteInterpreterEventType.RESOURCE_INVOKE_METHOD, + gson.toJson(invokeMethod))); + // wait for response + while (!getInvokeResponse.containsKey(invokeMethod)) { + try { + getInvokeResponse.wait(); + } catch (InterruptedException e) { + logger.warn(e.getMessage(), e); + } + } + Resource o = (Resource) getInvokeResponse.remove(invokeMethod); + getInvokeResponse.notifyAll(); + return o; + } + } + /** * Supposed to call from RemoteInterpreterEventPoller */ @@ -209,6 +316,42 @@ public void putResponseGetResource(String resourceId, ByteBuffer object) { } + /** + * Supposed to call from RemoteInterpreterEventPoller + * @param invokeMessage json serialized InvokeMessage + * @param object java serialized of the object + */ + public void putResponseInvokeMethod( + InvokeResourceMethodEventMessage invokeMessage, ByteBuffer object) { + Object o = null; + try { + o = Resource.deserializeObject(object); + } catch (IOException e) { + logger.error(e.getMessage(), e); + } catch (ClassNotFoundException e) { + logger.error(e.getMessage(), e); + } + + synchronized (getInvokeResponse) { + getInvokeResponse.put(invokeMessage, o); + getInvokeResponse.notifyAll(); + } + } + + /** + * Supposed to call from RemoteInterpreterEventPoller + * @param invokeMessage invoke message + * @param resource remote resource + */ + public void putResponseInvokeMethod( + InvokeResourceMethodEventMessage invokeMessage, Resource resource) { + synchronized (getInvokeResponse) { + getInvokeResponse.put(invokeMessage, resource); + getInvokeResponse.notifyAll(); + } + } + + /** * Supposed to call from RemoteInterpreterEventPoller * @return next available event diff --git a/zeppelin-interpreter/src/main/java/org/apache/zeppelin/interpreter/remote/RemoteInterpreterEventPoller.java b/zeppelin-interpreter/src/main/java/org/apache/zeppelin/interpreter/remote/RemoteInterpreterEventPoller.java index e2a8adddfd2..e794140e8bd 100644 --- a/zeppelin-interpreter/src/main/java/org/apache/zeppelin/interpreter/remote/RemoteInterpreterEventPoller.java +++ b/zeppelin-interpreter/src/main/java/org/apache/zeppelin/interpreter/remote/RemoteInterpreterEventPoller.java @@ -38,6 +38,8 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.lang.reflect.InvocationTargetException; +import java.lang.reflect.Method; import java.nio.ByteBuffer; import java.util.LinkedList; import java.util.List; @@ -62,6 +64,8 @@ public class RemoteInterpreterEventPoller extends Thread { private RemoteInterpreterProcess interpreterProcess; private InterpreterGroup interpreterGroup; + Gson gson = new Gson(); + public RemoteInterpreterEventPoller( RemoteInterpreterProcessListener listener, ApplicationEventListener appListener) { @@ -117,8 +121,6 @@ public void run() { interpreterProcess.releaseClient(client, broken); } - Gson gson = new Gson(); - AngularObjectRegistry angularObjectRegistry = interpreterGroup.getAngularObjectRegistry(); try { @@ -160,6 +162,12 @@ public void run() { logger.debug("RESOURCE_GET {} {}", resourceId.getResourcePoolId(), resourceId.getName()); Object o = getResource(resourceId); sendResourceResponseGet(resourceId, o); + } else if (event.getType() == RemoteInterpreterEventType.RESOURCE_INVOKE_METHOD) { + String message = event.getData(); + InvokeResourceMethodEventMessage invokeMethodMessage = + gson.fromJson(message, InvokeResourceMethodEventMessage.class); + Object ret = invokeResourceMethod(invokeMethodMessage); + sendInvokeMethodResult(invokeMethodMessage, ret); } else if (event.getType() == RemoteInterpreterEventType.OUTPUT_APPEND) { // on output append Map outputAppend = gson.fromJson( @@ -383,8 +391,6 @@ private ResourceSet getAllResourcePoolExcept() { return resourceSet; } - - private void sendResourceResponseGet(ResourceId resourceId, Object o) { Client client = null; boolean broken = false; @@ -444,6 +450,87 @@ private Object getResource(ResourceId resourceId) { return null; } + public void sendInvokeMethodResult(InvokeResourceMethodEventMessage message, Object o) { + Client client = null; + boolean broken = false; + try { + client = interpreterProcess.getClient(); + Gson gson = new Gson(); + String invokeMessage = gson.toJson(message); + ByteBuffer obj; + if (o == null) { + obj = ByteBuffer.allocate(0); + } else { + obj = Resource.serializeObject(o); + } + client.resourceResponseInvokeMethod(invokeMessage, obj); + } catch (Exception e) { + logger.error(e.getMessage(), e); + broken = true; + } finally { + if (client != null) { + interpreterProcess.releaseClient(client, broken); + } + } + } + + private Object invokeResourceMethod(InvokeResourceMethodEventMessage message) { + ResourceId resourceId = message.resourceId; + InterpreterGroup intpGroup = InterpreterGroup.getByInterpreterGroupId( + resourceId.getResourcePoolId()); + if (intpGroup == null) { + return null; + } + + RemoteInterpreterProcess remoteInterpreterProcess = intpGroup.getRemoteInterpreterProcess(); + if (remoteInterpreterProcess == null) { + ResourcePool localPool = intpGroup.getResourcePool(); + if (localPool != null) { + Resource res = localPool.get(resourceId.getName()); + if (res != null) { + try { + return res.invokeMethod( + message.methodName, + message.getParamTypes(), + message.params, + message.returnResourceName); + } catch (Exception e) { + logger.error(e.getMessage(), e); + return null; + } + } else { + // object is null. can't invoke any method + logger.error("Can't invoke method {} on null object", message.methodName); + return null; + } + } else { + logger.error("no resource pool"); + return null; + } + } else if (interpreterProcess.isRunning()) { + Client client = null; + boolean broken = false; + try { + client = remoteInterpreterProcess.getClient(); + ByteBuffer res = client.resourceInvokeMethod( + resourceId.getNoteId(), + resourceId.getParagraphId(), + resourceId.getName(), + gson.toJson(message)); + Object o = Resource.deserializeObject(res); + return o; + } catch (Exception e) { + logger.error(e.getMessage(), e); + broken = true; + } finally { + if (client != null) { + intpGroup.getRemoteInterpreterProcess().releaseClient(client, broken); + } + } + } + return null; + } + private void waitQuietly() { try { synchronized (this) { diff --git a/zeppelin-interpreter/src/main/java/org/apache/zeppelin/interpreter/remote/RemoteInterpreterServer.java b/zeppelin-interpreter/src/main/java/org/apache/zeppelin/interpreter/remote/RemoteInterpreterServer.java index 879b4f51e78..8624b57e744 100644 --- a/zeppelin-interpreter/src/main/java/org/apache/zeppelin/interpreter/remote/RemoteInterpreterServer.java +++ b/zeppelin-interpreter/src/main/java/org/apache/zeppelin/interpreter/remote/RemoteInterpreterServer.java @@ -20,6 +20,7 @@ import java.io.IOException; import java.lang.reflect.Constructor; import java.lang.reflect.InvocationTargetException; +import java.lang.reflect.Method; import java.net.URL; import java.nio.ByteBuffer; import java.util.*; @@ -955,6 +956,73 @@ public ByteBuffer resourceGet(String noteId, String paragraphId, String resource } } + @Override + public ByteBuffer resourceInvokeMethod( + String noteId, String paragraphId, String resourceName, String invokeMessage) { + InvokeResourceMethodEventMessage message = + gson.fromJson(invokeMessage, InvokeResourceMethodEventMessage.class); + + Resource resource = resourcePool.get(noteId, paragraphId, resourceName, false); + if (resource == null || resource.get() == null) { + return ByteBuffer.allocate(0); + } else { + try { + Object o = resource.get(); + Method method = o.getClass().getMethod( + message.methodName, + message.getParamTypes()); + Object ret = method.invoke(o, message.params); + if (message.shouldPutResultIntoResourcePool()) { + // if return resource name is specified, + // then put result into resource pool + // and return empty byte buffer + resourcePool.put( + noteId, + paragraphId, + message.returnResourceName, + ret); + return ByteBuffer.allocate(0); + } else { + // if return resource name is not specified, + // then return serialized result + ByteBuffer serialized = Resource.serializeObject(ret); + if (serialized == null) { + return ByteBuffer.allocate(0); + } else { + return serialized; + } + } + } catch (Exception e) { + logger.error(e.getMessage(), e); + return ByteBuffer.allocate(0); + } + } + } + + /** + * Get payload of resource from remote + * @param invokeResourceMethodEventMessage json serialized InvokeResourcemethodEventMessage + * @param object java serialized of the object + * @throws TException + */ + @Override + public void resourceResponseInvokeMethod( + String invokeResourceMethodEventMessage, ByteBuffer object) throws TException { + InvokeResourceMethodEventMessage message = + gson.fromJson(invokeResourceMethodEventMessage, InvokeResourceMethodEventMessage.class); + + if (message.shouldPutResultIntoResourcePool()) { + Resource resource = resourcePool.get( + message.resourceId.getNoteId(), + message.resourceId.getParagraphId(), + message.returnResourceName, + true); + eventClient.putResponseInvokeMethod(message, resource); + } else { + eventClient.putResponseInvokeMethod(message, object); + } + } + @Override public void angularRegistryPush(String registryAsString) throws TException { try { diff --git a/zeppelin-interpreter/src/main/java/org/apache/zeppelin/interpreter/thrift/InterpreterCompletion.java b/zeppelin-interpreter/src/main/java/org/apache/zeppelin/interpreter/thrift/InterpreterCompletion.java index 2d1c165d0ca..8a1bc7d56da 100644 --- a/zeppelin-interpreter/src/main/java/org/apache/zeppelin/interpreter/thrift/InterpreterCompletion.java +++ b/zeppelin-interpreter/src/main/java/org/apache/zeppelin/interpreter/thrift/InterpreterCompletion.java @@ -51,7 +51,7 @@ import org.slf4j.LoggerFactory; @SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"}) -@Generated(value = "Autogenerated by Thrift Compiler (0.9.2)", date = "2016-11-29") +@Generated(value = "Autogenerated by Thrift Compiler (0.9.2)", date = "2017-1-25") public class InterpreterCompletion implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("InterpreterCompletion"); diff --git a/zeppelin-interpreter/src/main/java/org/apache/zeppelin/interpreter/thrift/RemoteApplicationResult.java b/zeppelin-interpreter/src/main/java/org/apache/zeppelin/interpreter/thrift/RemoteApplicationResult.java index 5c730491e5e..ebb85790a4e 100644 --- a/zeppelin-interpreter/src/main/java/org/apache/zeppelin/interpreter/thrift/RemoteApplicationResult.java +++ b/zeppelin-interpreter/src/main/java/org/apache/zeppelin/interpreter/thrift/RemoteApplicationResult.java @@ -51,7 +51,7 @@ import org.slf4j.LoggerFactory; @SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"}) -@Generated(value = "Autogenerated by Thrift Compiler (0.9.2)", date = "2016-11-29") +@Generated(value = "Autogenerated by Thrift Compiler (0.9.2)", date = "2017-1-25") public class RemoteApplicationResult implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("RemoteApplicationResult"); diff --git a/zeppelin-interpreter/src/main/java/org/apache/zeppelin/interpreter/thrift/RemoteInterpreterContext.java b/zeppelin-interpreter/src/main/java/org/apache/zeppelin/interpreter/thrift/RemoteInterpreterContext.java index e721cb32978..6a24e5663f1 100644 --- a/zeppelin-interpreter/src/main/java/org/apache/zeppelin/interpreter/thrift/RemoteInterpreterContext.java +++ b/zeppelin-interpreter/src/main/java/org/apache/zeppelin/interpreter/thrift/RemoteInterpreterContext.java @@ -51,7 +51,7 @@ import org.slf4j.LoggerFactory; @SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"}) -@Generated(value = "Autogenerated by Thrift Compiler (0.9.2)", date = "2016-11-29") +@Generated(value = "Autogenerated by Thrift Compiler (0.9.2)", date = "2017-1-25") public class RemoteInterpreterContext implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("RemoteInterpreterContext"); diff --git a/zeppelin-interpreter/src/main/java/org/apache/zeppelin/interpreter/thrift/RemoteInterpreterEvent.java b/zeppelin-interpreter/src/main/java/org/apache/zeppelin/interpreter/thrift/RemoteInterpreterEvent.java index 5f4201a3f12..39c4f812a5d 100644 --- a/zeppelin-interpreter/src/main/java/org/apache/zeppelin/interpreter/thrift/RemoteInterpreterEvent.java +++ b/zeppelin-interpreter/src/main/java/org/apache/zeppelin/interpreter/thrift/RemoteInterpreterEvent.java @@ -51,7 +51,7 @@ import org.slf4j.LoggerFactory; @SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"}) -@Generated(value = "Autogenerated by Thrift Compiler (0.9.2)", date = "2016-11-29") +@Generated(value = "Autogenerated by Thrift Compiler (0.9.2)", date = "2017-1-25") public class RemoteInterpreterEvent implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("RemoteInterpreterEvent"); diff --git a/zeppelin-interpreter/src/main/java/org/apache/zeppelin/interpreter/thrift/RemoteInterpreterEventType.java b/zeppelin-interpreter/src/main/java/org/apache/zeppelin/interpreter/thrift/RemoteInterpreterEventType.java index fc20cd91acb..7ca406c6709 100644 --- a/zeppelin-interpreter/src/main/java/org/apache/zeppelin/interpreter/thrift/RemoteInterpreterEventType.java +++ b/zeppelin-interpreter/src/main/java/org/apache/zeppelin/interpreter/thrift/RemoteInterpreterEventType.java @@ -42,7 +42,8 @@ public enum RemoteInterpreterEventType implements org.apache.thrift.TEnum { ANGULAR_REGISTRY_PUSH(11), APP_STATUS_UPDATE(12), META_INFOS(13), - REMOTE_ZEPPELIN_SERVER_RESOURCE(14); + REMOTE_ZEPPELIN_SERVER_RESOURCE(14), + RESOURCE_INVOKE_METHOD(15); private final int value; @@ -91,6 +92,8 @@ public static RemoteInterpreterEventType findByValue(int value) { return META_INFOS; case 14: return REMOTE_ZEPPELIN_SERVER_RESOURCE; + case 15: + return RESOURCE_INVOKE_METHOD; default: return null; } diff --git a/zeppelin-interpreter/src/main/java/org/apache/zeppelin/interpreter/thrift/RemoteInterpreterResult.java b/zeppelin-interpreter/src/main/java/org/apache/zeppelin/interpreter/thrift/RemoteInterpreterResult.java index ce15084c69a..4929efab7bb 100644 --- a/zeppelin-interpreter/src/main/java/org/apache/zeppelin/interpreter/thrift/RemoteInterpreterResult.java +++ b/zeppelin-interpreter/src/main/java/org/apache/zeppelin/interpreter/thrift/RemoteInterpreterResult.java @@ -51,7 +51,7 @@ import org.slf4j.LoggerFactory; @SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"}) -@Generated(value = "Autogenerated by Thrift Compiler (0.9.2)", date = "2016-11-29") +@Generated(value = "Autogenerated by Thrift Compiler (0.9.2)", date = "2017-1-25") public class RemoteInterpreterResult implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("RemoteInterpreterResult"); diff --git a/zeppelin-interpreter/src/main/java/org/apache/zeppelin/interpreter/thrift/RemoteInterpreterResultMessage.java b/zeppelin-interpreter/src/main/java/org/apache/zeppelin/interpreter/thrift/RemoteInterpreterResultMessage.java index c55c72e6100..eb1261e9742 100644 --- a/zeppelin-interpreter/src/main/java/org/apache/zeppelin/interpreter/thrift/RemoteInterpreterResultMessage.java +++ b/zeppelin-interpreter/src/main/java/org/apache/zeppelin/interpreter/thrift/RemoteInterpreterResultMessage.java @@ -51,7 +51,7 @@ import org.slf4j.LoggerFactory; @SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"}) -@Generated(value = "Autogenerated by Thrift Compiler (0.9.2)", date = "2016-11-29") +@Generated(value = "Autogenerated by Thrift Compiler (0.9.2)", date = "2017-1-25") public class RemoteInterpreterResultMessage implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("RemoteInterpreterResultMessage"); diff --git a/zeppelin-interpreter/src/main/java/org/apache/zeppelin/interpreter/thrift/RemoteInterpreterService.java b/zeppelin-interpreter/src/main/java/org/apache/zeppelin/interpreter/thrift/RemoteInterpreterService.java index feaebccd381..7b2a76e6128 100644 --- a/zeppelin-interpreter/src/main/java/org/apache/zeppelin/interpreter/thrift/RemoteInterpreterService.java +++ b/zeppelin-interpreter/src/main/java/org/apache/zeppelin/interpreter/thrift/RemoteInterpreterService.java @@ -51,7 +51,7 @@ import org.slf4j.LoggerFactory; @SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"}) -@Generated(value = "Autogenerated by Thrift Compiler (0.9.2)", date = "2016-11-29") +@Generated(value = "Autogenerated by Thrift Compiler (0.9.2)", date = "2017-1-25") public class RemoteInterpreterService { public interface Iface { @@ -82,12 +82,16 @@ public interface Iface { public void resourceResponseGet(String resourceId, ByteBuffer object) throws org.apache.thrift.TException; + public void resourceResponseInvokeMethod(String invokeMessage, ByteBuffer object) throws org.apache.thrift.TException; + public List resourcePoolGetAll() throws org.apache.thrift.TException; public ByteBuffer resourceGet(String sessionKey, String paragraphId, String resourceName) throws org.apache.thrift.TException; public boolean resourceRemove(String sessionKey, String paragraphId, String resourceName) throws org.apache.thrift.TException; + public ByteBuffer resourceInvokeMethod(String sessionKey, String paragraphId, String resourceName, String invokeMessage) throws org.apache.thrift.TException; + public void angularObjectUpdate(String name, String sessionKey, String paragraphId, String object) throws org.apache.thrift.TException; public void angularObjectAdd(String name, String sessionKey, String paragraphId, String object) throws org.apache.thrift.TException; @@ -134,12 +138,16 @@ public interface AsyncIface { public void resourceResponseGet(String resourceId, ByteBuffer object, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; + public void resourceResponseInvokeMethod(String invokeMessage, ByteBuffer object, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; + public void resourcePoolGetAll(org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; public void resourceGet(String sessionKey, String paragraphId, String resourceName, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; public void resourceRemove(String sessionKey, String paragraphId, String resourceName, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; + public void resourceInvokeMethod(String sessionKey, String paragraphId, String resourceName, String invokeMessage, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; + public void angularObjectUpdate(String name, String sessionKey, String paragraphId, String object, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; public void angularObjectAdd(String name, String sessionKey, String paragraphId, String object, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; @@ -473,6 +481,27 @@ public void recv_resourceResponseGet() throws org.apache.thrift.TException return; } + public void resourceResponseInvokeMethod(String invokeMessage, ByteBuffer object) throws org.apache.thrift.TException + { + send_resourceResponseInvokeMethod(invokeMessage, object); + recv_resourceResponseInvokeMethod(); + } + + public void send_resourceResponseInvokeMethod(String invokeMessage, ByteBuffer object) throws org.apache.thrift.TException + { + resourceResponseInvokeMethod_args args = new resourceResponseInvokeMethod_args(); + args.setInvokeMessage(invokeMessage); + args.setObject(object); + sendBase("resourceResponseInvokeMethod", args); + } + + public void recv_resourceResponseInvokeMethod() throws org.apache.thrift.TException + { + resourceResponseInvokeMethod_result result = new resourceResponseInvokeMethod_result(); + receiveBase(result, "resourceResponseInvokeMethod"); + return; + } + public List resourcePoolGetAll() throws org.apache.thrift.TException { send_resourcePoolGetAll(); @@ -545,6 +574,32 @@ public boolean recv_resourceRemove() throws org.apache.thrift.TException throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "resourceRemove failed: unknown result"); } + public ByteBuffer resourceInvokeMethod(String sessionKey, String paragraphId, String resourceName, String invokeMessage) throws org.apache.thrift.TException + { + send_resourceInvokeMethod(sessionKey, paragraphId, resourceName, invokeMessage); + return recv_resourceInvokeMethod(); + } + + public void send_resourceInvokeMethod(String sessionKey, String paragraphId, String resourceName, String invokeMessage) throws org.apache.thrift.TException + { + resourceInvokeMethod_args args = new resourceInvokeMethod_args(); + args.setSessionKey(sessionKey); + args.setParagraphId(paragraphId); + args.setResourceName(resourceName); + args.setInvokeMessage(invokeMessage); + sendBase("resourceInvokeMethod", args); + } + + public ByteBuffer recv_resourceInvokeMethod() throws org.apache.thrift.TException + { + resourceInvokeMethod_result result = new resourceInvokeMethod_result(); + receiveBase(result, "resourceInvokeMethod"); + if (result.isSetSuccess()) { + return result.success; + } + throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "resourceInvokeMethod failed: unknown result"); + } + public void angularObjectUpdate(String name, String sessionKey, String paragraphId, String object) throws org.apache.thrift.TException { send_angularObjectUpdate(name, sessionKey, paragraphId, object); @@ -1210,6 +1265,41 @@ public void getResult() throws org.apache.thrift.TException { } } + public void resourceResponseInvokeMethod(String invokeMessage, ByteBuffer object, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { + checkReady(); + resourceResponseInvokeMethod_call method_call = new resourceResponseInvokeMethod_call(invokeMessage, object, resultHandler, this, ___protocolFactory, ___transport); + this.___currentMethod = method_call; + ___manager.call(method_call); + } + + public static class resourceResponseInvokeMethod_call extends org.apache.thrift.async.TAsyncMethodCall { + private String invokeMessage; + private ByteBuffer object; + public resourceResponseInvokeMethod_call(String invokeMessage, ByteBuffer object, org.apache.thrift.async.AsyncMethodCallback resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException { + super(client, protocolFactory, transport, resultHandler, false); + this.invokeMessage = invokeMessage; + this.object = object; + } + + public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException { + prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("resourceResponseInvokeMethod", org.apache.thrift.protocol.TMessageType.CALL, 0)); + resourceResponseInvokeMethod_args args = new resourceResponseInvokeMethod_args(); + args.setInvokeMessage(invokeMessage); + args.setObject(object); + args.write(prot); + prot.writeMessageEnd(); + } + + public void getResult() throws org.apache.thrift.TException { + if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) { + throw new IllegalStateException("Method call not finished!"); + } + org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array()); + org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport); + (new Client(prot)).recv_resourceResponseInvokeMethod(); + } + } + public void resourcePoolGetAll(org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { checkReady(); resourcePoolGetAll_call method_call = new resourcePoolGetAll_call(resultHandler, this, ___protocolFactory, ___transport); @@ -1315,6 +1405,47 @@ public boolean getResult() throws org.apache.thrift.TException { } } + public void resourceInvokeMethod(String sessionKey, String paragraphId, String resourceName, String invokeMessage, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { + checkReady(); + resourceInvokeMethod_call method_call = new resourceInvokeMethod_call(sessionKey, paragraphId, resourceName, invokeMessage, resultHandler, this, ___protocolFactory, ___transport); + this.___currentMethod = method_call; + ___manager.call(method_call); + } + + public static class resourceInvokeMethod_call extends org.apache.thrift.async.TAsyncMethodCall { + private String sessionKey; + private String paragraphId; + private String resourceName; + private String invokeMessage; + public resourceInvokeMethod_call(String sessionKey, String paragraphId, String resourceName, String invokeMessage, org.apache.thrift.async.AsyncMethodCallback resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException { + super(client, protocolFactory, transport, resultHandler, false); + this.sessionKey = sessionKey; + this.paragraphId = paragraphId; + this.resourceName = resourceName; + this.invokeMessage = invokeMessage; + } + + public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException { + prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("resourceInvokeMethod", org.apache.thrift.protocol.TMessageType.CALL, 0)); + resourceInvokeMethod_args args = new resourceInvokeMethod_args(); + args.setSessionKey(sessionKey); + args.setParagraphId(paragraphId); + args.setResourceName(resourceName); + args.setInvokeMessage(invokeMessage); + args.write(prot); + prot.writeMessageEnd(); + } + + public ByteBuffer getResult() throws org.apache.thrift.TException { + if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) { + throw new IllegalStateException("Method call not finished!"); + } + org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array()); + org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport); + return (new Client(prot)).recv_resourceInvokeMethod(); + } + } + public void angularObjectUpdate(String name, String sessionKey, String paragraphId, String object, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { checkReady(); angularObjectUpdate_call method_call = new angularObjectUpdate_call(name, sessionKey, paragraphId, object, resultHandler, this, ___protocolFactory, ___transport); @@ -1630,9 +1761,11 @@ protected Processor(I iface, Map extends org.apache.thrift.ProcessFunction { + public resourceResponseInvokeMethod() { + super("resourceResponseInvokeMethod"); + } + + public resourceResponseInvokeMethod_args getEmptyArgsInstance() { + return new resourceResponseInvokeMethod_args(); + } + + protected boolean isOneway() { + return false; + } + + public resourceResponseInvokeMethod_result getResult(I iface, resourceResponseInvokeMethod_args args) throws org.apache.thrift.TException { + resourceResponseInvokeMethod_result result = new resourceResponseInvokeMethod_result(); + iface.resourceResponseInvokeMethod(args.invokeMessage, args.object); + return result; + } + } + public static class resourcePoolGetAll extends org.apache.thrift.ProcessFunction { public resourcePoolGetAll() { super("resourcePoolGetAll"); @@ -1966,6 +2119,26 @@ public resourceRemove_result getResult(I iface, resourceRemove_args args) throws } } + public static class resourceInvokeMethod extends org.apache.thrift.ProcessFunction { + public resourceInvokeMethod() { + super("resourceInvokeMethod"); + } + + public resourceInvokeMethod_args getEmptyArgsInstance() { + return new resourceInvokeMethod_args(); + } + + protected boolean isOneway() { + return false; + } + + public resourceInvokeMethod_result getResult(I iface, resourceInvokeMethod_args args) throws org.apache.thrift.TException { + resourceInvokeMethod_result result = new resourceInvokeMethod_result(); + result.success = iface.resourceInvokeMethod(args.sessionKey, args.paragraphId, args.resourceName, args.invokeMessage); + return result; + } + } + public static class angularObjectUpdate extends org.apache.thrift.ProcessFunction { public angularObjectUpdate() { super("angularObjectUpdate"); @@ -2152,9 +2325,11 @@ protected AsyncProcessor(I iface, Map extends org.apache.thrift.AsyncProcessFunction { + public resourceResponseInvokeMethod() { + super("resourceResponseInvokeMethod"); + } + + public resourceResponseInvokeMethod_args getEmptyArgsInstance() { + return new resourceResponseInvokeMethod_args(); + } + + public AsyncMethodCallback getResultHandler(final AsyncFrameBuffer fb, final int seqid) { + final org.apache.thrift.AsyncProcessFunction fcall = this; + return new AsyncMethodCallback() { + public void onComplete(Void o) { + resourceResponseInvokeMethod_result result = new resourceResponseInvokeMethod_result(); + try { + fcall.sendResponse(fb,result, org.apache.thrift.protocol.TMessageType.REPLY,seqid); + return; + } catch (Exception e) { + LOGGER.error("Exception writing to internal frame buffer", e); + } + fb.close(); + } + public void onError(Exception e) { + byte msgType = org.apache.thrift.protocol.TMessageType.REPLY; + org.apache.thrift.TBase msg; + resourceResponseInvokeMethod_result result = new resourceResponseInvokeMethod_result(); + { + msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION; + msg = (org.apache.thrift.TBase)new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage()); + } + try { + fcall.sendResponse(fb,msg,msgType,seqid); + return; + } catch (Exception ex) { + LOGGER.error("Exception writing to internal frame buffer", ex); + } + fb.close(); + } + }; + } + + protected boolean isOneway() { + return false; + } + + public void start(I iface, resourceResponseInvokeMethod_args args, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws TException { + iface.resourceResponseInvokeMethod(args.invokeMessage, args.object,resultHandler); + } + } + public static class resourcePoolGetAll extends org.apache.thrift.AsyncProcessFunction> { public resourcePoolGetAll() { super("resourcePoolGetAll"); @@ -2977,6 +3202,57 @@ public void start(I iface, resourceRemove_args args, org.apache.thrift.async.Asy } } + public static class resourceInvokeMethod extends org.apache.thrift.AsyncProcessFunction { + public resourceInvokeMethod() { + super("resourceInvokeMethod"); + } + + public resourceInvokeMethod_args getEmptyArgsInstance() { + return new resourceInvokeMethod_args(); + } + + public AsyncMethodCallback getResultHandler(final AsyncFrameBuffer fb, final int seqid) { + final org.apache.thrift.AsyncProcessFunction fcall = this; + return new AsyncMethodCallback() { + public void onComplete(ByteBuffer o) { + resourceInvokeMethod_result result = new resourceInvokeMethod_result(); + result.success = o; + try { + fcall.sendResponse(fb,result, org.apache.thrift.protocol.TMessageType.REPLY,seqid); + return; + } catch (Exception e) { + LOGGER.error("Exception writing to internal frame buffer", e); + } + fb.close(); + } + public void onError(Exception e) { + byte msgType = org.apache.thrift.protocol.TMessageType.REPLY; + org.apache.thrift.TBase msg; + resourceInvokeMethod_result result = new resourceInvokeMethod_result(); + { + msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION; + msg = (org.apache.thrift.TBase)new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage()); + } + try { + fcall.sendResponse(fb,msg,msgType,seqid); + return; + } catch (Exception ex) { + LOGGER.error("Exception writing to internal frame buffer", ex); + } + fb.close(); + } + }; + } + + protected boolean isOneway() { + return false; + } + + public void start(I iface, resourceInvokeMethod_args args, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws TException { + iface.resourceInvokeMethod(args.sessionKey, args.paragraphId, args.resourceName, args.invokeMessage,resultHandler); + } + } + public static class angularObjectUpdate extends org.apache.thrift.AsyncProcessFunction { public angularObjectUpdate() { super("angularObjectUpdate"); @@ -13934,20 +14210,25 @@ public void read(org.apache.thrift.protocol.TProtocol prot, resourceResponseGet_ } - public static class resourcePoolGetAll_args implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("resourcePoolGetAll_args"); + public static class resourceResponseInvokeMethod_args implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("resourceResponseInvokeMethod_args"); + private static final org.apache.thrift.protocol.TField INVOKE_MESSAGE_FIELD_DESC = new org.apache.thrift.protocol.TField("invokeMessage", org.apache.thrift.protocol.TType.STRING, (short)1); + private static final org.apache.thrift.protocol.TField OBJECT_FIELD_DESC = new org.apache.thrift.protocol.TField("object", org.apache.thrift.protocol.TType.STRING, (short)2); private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); static { - schemes.put(StandardScheme.class, new resourcePoolGetAll_argsStandardSchemeFactory()); - schemes.put(TupleScheme.class, new resourcePoolGetAll_argsTupleSchemeFactory()); + schemes.put(StandardScheme.class, new resourceResponseInvokeMethod_argsStandardSchemeFactory()); + schemes.put(TupleScheme.class, new resourceResponseInvokeMethod_argsTupleSchemeFactory()); } + public String invokeMessage; // required + public ByteBuffer object; // 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 { -; + INVOKE_MESSAGE((short)1, "invokeMessage"), + OBJECT((short)2, "object"); private static final Map byName = new HashMap(); @@ -13962,6 +14243,10 @@ public enum _Fields implements org.apache.thrift.TFieldIdEnum { */ public static _Fields findByThriftId(int fieldId) { switch(fieldId) { + case 1: // INVOKE_MESSAGE + return INVOKE_MESSAGE; + case 2: // OBJECT + return OBJECT; default: return null; } @@ -14000,83 +14285,1684 @@ 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.INVOKE_MESSAGE, new org.apache.thrift.meta_data.FieldMetaData("invokeMessage", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); + tmpMap.put(_Fields.OBJECT, new org.apache.thrift.meta_data.FieldMetaData("object", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING , true))); metaDataMap = Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(resourcePoolGetAll_args.class, metaDataMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(resourceResponseInvokeMethod_args.class, metaDataMap); } - public resourcePoolGetAll_args() { + public resourceResponseInvokeMethod_args() { + } + + public resourceResponseInvokeMethod_args( + String invokeMessage, + ByteBuffer object) + { + this(); + this.invokeMessage = invokeMessage; + this.object = org.apache.thrift.TBaseHelper.copyBinary(object); } /** * Performs a deep copy on other. */ - public resourcePoolGetAll_args(resourcePoolGetAll_args other) { + public resourceResponseInvokeMethod_args(resourceResponseInvokeMethod_args other) { + if (other.isSetInvokeMessage()) { + this.invokeMessage = other.invokeMessage; + } + if (other.isSetObject()) { + this.object = org.apache.thrift.TBaseHelper.copyBinary(other.object); + } } - public resourcePoolGetAll_args deepCopy() { - return new resourcePoolGetAll_args(this); + public resourceResponseInvokeMethod_args deepCopy() { + return new resourceResponseInvokeMethod_args(this); } @Override public void clear() { + this.invokeMessage = null; + this.object = null; } - public void setFieldValue(_Fields field, Object value) { - switch (field) { - } + public String getInvokeMessage() { + return this.invokeMessage; } - public Object getFieldValue(_Fields field) { - switch (field) { - } - throw new IllegalStateException(); + public resourceResponseInvokeMethod_args setInvokeMessage(String invokeMessage) { + this.invokeMessage = invokeMessage; + return this; } - /** 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) { - } - throw new IllegalStateException(); + public void unsetInvokeMessage() { + this.invokeMessage = null; } - @Override - public boolean equals(Object that) { - if (that == null) - return false; - if (that instanceof resourcePoolGetAll_args) - return this.equals((resourcePoolGetAll_args)that); - return false; + /** Returns true if field invokeMessage is set (has been assigned a value) and false otherwise */ + public boolean isSetInvokeMessage() { + return this.invokeMessage != null; } - public boolean equals(resourcePoolGetAll_args that) { - if (that == null) - return false; - - return true; + public void setInvokeMessageIsSet(boolean value) { + if (!value) { + this.invokeMessage = null; + } } - @Override + public byte[] getObject() { + setObject(org.apache.thrift.TBaseHelper.rightSize(object)); + return object == null ? null : object.array(); + } + + public ByteBuffer bufferForObject() { + return org.apache.thrift.TBaseHelper.copyBinary(object); + } + + public resourceResponseInvokeMethod_args setObject(byte[] object) { + this.object = object == null ? (ByteBuffer)null : ByteBuffer.wrap(Arrays.copyOf(object, object.length)); + return this; + } + + public resourceResponseInvokeMethod_args setObject(ByteBuffer object) { + this.object = org.apache.thrift.TBaseHelper.copyBinary(object); + return this; + } + + public void unsetObject() { + this.object = null; + } + + /** Returns true if field object is set (has been assigned a value) and false otherwise */ + public boolean isSetObject() { + return this.object != null; + } + + public void setObjectIsSet(boolean value) { + if (!value) { + this.object = null; + } + } + + public void setFieldValue(_Fields field, Object value) { + switch (field) { + case INVOKE_MESSAGE: + if (value == null) { + unsetInvokeMessage(); + } else { + setInvokeMessage((String)value); + } + break; + + case OBJECT: + if (value == null) { + unsetObject(); + } else { + setObject((ByteBuffer)value); + } + break; + + } + } + + public Object getFieldValue(_Fields field) { + switch (field) { + case INVOKE_MESSAGE: + return getInvokeMessage(); + + case OBJECT: + return getObject(); + + } + 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 INVOKE_MESSAGE: + return isSetInvokeMessage(); + case OBJECT: + return isSetObject(); + } + throw new IllegalStateException(); + } + + @Override + public boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof resourceResponseInvokeMethod_args) + return this.equals((resourceResponseInvokeMethod_args)that); + return false; + } + + public boolean equals(resourceResponseInvokeMethod_args that) { + if (that == null) + return false; + + boolean this_present_invokeMessage = true && this.isSetInvokeMessage(); + boolean that_present_invokeMessage = true && that.isSetInvokeMessage(); + if (this_present_invokeMessage || that_present_invokeMessage) { + if (!(this_present_invokeMessage && that_present_invokeMessage)) + return false; + if (!this.invokeMessage.equals(that.invokeMessage)) + return false; + } + + boolean this_present_object = true && this.isSetObject(); + boolean that_present_object = true && that.isSetObject(); + if (this_present_object || that_present_object) { + if (!(this_present_object && that_present_object)) + return false; + if (!this.object.equals(that.object)) + return false; + } + + return true; + } + + @Override + public int hashCode() { + List list = new ArrayList(); + + boolean present_invokeMessage = true && (isSetInvokeMessage()); + list.add(present_invokeMessage); + if (present_invokeMessage) + list.add(invokeMessage); + + boolean present_object = true && (isSetObject()); + list.add(present_object); + if (present_object) + list.add(object); + + return list.hashCode(); + } + + @Override + public int compareTo(resourceResponseInvokeMethod_args other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + lastComparison = Boolean.valueOf(isSetInvokeMessage()).compareTo(other.isSetInvokeMessage()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetInvokeMessage()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.invokeMessage, other.invokeMessage); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetObject()).compareTo(other.isSetObject()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetObject()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.object, other.object); + 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("resourceResponseInvokeMethod_args("); + boolean first = true; + + sb.append("invokeMessage:"); + if (this.invokeMessage == null) { + sb.append("null"); + } else { + sb.append(this.invokeMessage); + } + first = false; + if (!first) sb.append(", "); + sb.append("object:"); + if (this.object == null) { + sb.append("null"); + } else { + org.apache.thrift.TBaseHelper.toString(this.object, sb); + } + 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 resourceResponseInvokeMethod_argsStandardSchemeFactory implements SchemeFactory { + public resourceResponseInvokeMethod_argsStandardScheme getScheme() { + return new resourceResponseInvokeMethod_argsStandardScheme(); + } + } + + private static class resourceResponseInvokeMethod_argsStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, resourceResponseInvokeMethod_args 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: // INVOKE_MESSAGE + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.invokeMessage = iprot.readString(); + struct.setInvokeMessageIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 2: // OBJECT + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.object = iprot.readBinary(); + struct.setObjectIsSet(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, resourceResponseInvokeMethod_args struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.invokeMessage != null) { + oprot.writeFieldBegin(INVOKE_MESSAGE_FIELD_DESC); + oprot.writeString(struct.invokeMessage); + oprot.writeFieldEnd(); + } + if (struct.object != null) { + oprot.writeFieldBegin(OBJECT_FIELD_DESC); + oprot.writeBinary(struct.object); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class resourceResponseInvokeMethod_argsTupleSchemeFactory implements SchemeFactory { + public resourceResponseInvokeMethod_argsTupleScheme getScheme() { + return new resourceResponseInvokeMethod_argsTupleScheme(); + } + } + + private static class resourceResponseInvokeMethod_argsTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, resourceResponseInvokeMethod_args struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + BitSet optionals = new BitSet(); + if (struct.isSetInvokeMessage()) { + optionals.set(0); + } + if (struct.isSetObject()) { + optionals.set(1); + } + oprot.writeBitSet(optionals, 2); + if (struct.isSetInvokeMessage()) { + oprot.writeString(struct.invokeMessage); + } + if (struct.isSetObject()) { + oprot.writeBinary(struct.object); + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, resourceResponseInvokeMethod_args struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(2); + if (incoming.get(0)) { + struct.invokeMessage = iprot.readString(); + struct.setInvokeMessageIsSet(true); + } + if (incoming.get(1)) { + struct.object = iprot.readBinary(); + struct.setObjectIsSet(true); + } + } + } + + } + + public static class resourceResponseInvokeMethod_result implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("resourceResponseInvokeMethod_result"); + + + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new resourceResponseInvokeMethod_resultStandardSchemeFactory()); + schemes.put(TupleScheme.class, new resourceResponseInvokeMethod_resultTupleSchemeFactory()); + } + + + /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ + public enum _Fields implements org.apache.thrift.TFieldIdEnum { +; + + private static final Map byName = new HashMap(); + + 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) { + 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; + } + } + 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); + metaDataMap = Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(resourceResponseInvokeMethod_result.class, metaDataMap); + } + + public resourceResponseInvokeMethod_result() { + } + + /** + * Performs a deep copy on other. + */ + public resourceResponseInvokeMethod_result(resourceResponseInvokeMethod_result other) { + } + + public resourceResponseInvokeMethod_result deepCopy() { + return new resourceResponseInvokeMethod_result(this); + } + + @Override + public void clear() { + } + + public void setFieldValue(_Fields field, Object value) { + switch (field) { + } + } + + public Object getFieldValue(_Fields field) { + switch (field) { + } + 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) { + } + throw new IllegalStateException(); + } + + @Override + public boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof resourceResponseInvokeMethod_result) + return this.equals((resourceResponseInvokeMethod_result)that); + return false; + } + + public boolean equals(resourceResponseInvokeMethod_result that) { + if (that == null) + return false; + + return true; + } + + @Override + public int hashCode() { + List list = new ArrayList(); + + return list.hashCode(); + } + + @Override + public int compareTo(resourceResponseInvokeMethod_result other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + 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("resourceResponseInvokeMethod_result("); + boolean first = true; + + 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 resourceResponseInvokeMethod_resultStandardSchemeFactory implements SchemeFactory { + public resourceResponseInvokeMethod_resultStandardScheme getScheme() { + return new resourceResponseInvokeMethod_resultStandardScheme(); + } + } + + private static class resourceResponseInvokeMethod_resultStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, resourceResponseInvokeMethod_result 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) { + 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, resourceResponseInvokeMethod_result struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class resourceResponseInvokeMethod_resultTupleSchemeFactory implements SchemeFactory { + public resourceResponseInvokeMethod_resultTupleScheme getScheme() { + return new resourceResponseInvokeMethod_resultTupleScheme(); + } + } + + private static class resourceResponseInvokeMethod_resultTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, resourceResponseInvokeMethod_result struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, resourceResponseInvokeMethod_result struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + } + } + + } + + public static class resourcePoolGetAll_args implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("resourcePoolGetAll_args"); + + + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new resourcePoolGetAll_argsStandardSchemeFactory()); + schemes.put(TupleScheme.class, new resourcePoolGetAll_argsTupleSchemeFactory()); + } + + + /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ + public enum _Fields implements org.apache.thrift.TFieldIdEnum { +; + + private static final Map byName = new HashMap(); + + 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) { + 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; + } + } + 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); + metaDataMap = Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(resourcePoolGetAll_args.class, metaDataMap); + } + + public resourcePoolGetAll_args() { + } + + /** + * Performs a deep copy on other. + */ + public resourcePoolGetAll_args(resourcePoolGetAll_args other) { + } + + public resourcePoolGetAll_args deepCopy() { + return new resourcePoolGetAll_args(this); + } + + @Override + public void clear() { + } + + public void setFieldValue(_Fields field, Object value) { + switch (field) { + } + } + + public Object getFieldValue(_Fields field) { + switch (field) { + } + 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) { + } + throw new IllegalStateException(); + } + + @Override + public boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof resourcePoolGetAll_args) + return this.equals((resourcePoolGetAll_args)that); + return false; + } + + public boolean equals(resourcePoolGetAll_args that) { + if (that == null) + return false; + + return true; + } + + @Override + public int hashCode() { + List list = new ArrayList(); + + return list.hashCode(); + } + + @Override + public int compareTo(resourcePoolGetAll_args other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + 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("resourcePoolGetAll_args("); + boolean first = true; + + 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 resourcePoolGetAll_argsStandardSchemeFactory implements SchemeFactory { + public resourcePoolGetAll_argsStandardScheme getScheme() { + return new resourcePoolGetAll_argsStandardScheme(); + } + } + + private static class resourcePoolGetAll_argsStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, resourcePoolGetAll_args 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) { + 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, resourcePoolGetAll_args struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class resourcePoolGetAll_argsTupleSchemeFactory implements SchemeFactory { + public resourcePoolGetAll_argsTupleScheme getScheme() { + return new resourcePoolGetAll_argsTupleScheme(); + } + } + + private static class resourcePoolGetAll_argsTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, resourcePoolGetAll_args struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, resourcePoolGetAll_args struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + } + } + + } + + public static class resourcePoolGetAll_result implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("resourcePoolGetAll_result"); + + private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.LIST, (short)0); + + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new resourcePoolGetAll_resultStandardSchemeFactory()); + schemes.put(TupleScheme.class, new resourcePoolGetAll_resultTupleSchemeFactory()); + } + + public List success; // 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 { + SUCCESS((short)0, "success"); + + private static final Map byName = new HashMap(); + + 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 0: // SUCCESS + return SUCCESS; + 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.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)))); + metaDataMap = Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(resourcePoolGetAll_result.class, metaDataMap); + } + + public resourcePoolGetAll_result() { + } + + public resourcePoolGetAll_result( + List success) + { + this(); + this.success = success; + } + + /** + * Performs a deep copy on other. + */ + public resourcePoolGetAll_result(resourcePoolGetAll_result other) { + if (other.isSetSuccess()) { + List __this__success = new ArrayList(other.success); + this.success = __this__success; + } + } + + public resourcePoolGetAll_result deepCopy() { + return new resourcePoolGetAll_result(this); + } + + @Override + public void clear() { + this.success = null; + } + + public int getSuccessSize() { + return (this.success == null) ? 0 : this.success.size(); + } + + public java.util.Iterator getSuccessIterator() { + return (this.success == null) ? null : this.success.iterator(); + } + + public void addToSuccess(String elem) { + if (this.success == null) { + this.success = new ArrayList(); + } + this.success.add(elem); + } + + public List getSuccess() { + return this.success; + } + + public resourcePoolGetAll_result setSuccess(List success) { + this.success = success; + return this; + } + + public void unsetSuccess() { + this.success = null; + } + + /** Returns true if field success is set (has been assigned a value) and false otherwise */ + public boolean isSetSuccess() { + return this.success != null; + } + + public void setSuccessIsSet(boolean value) { + if (!value) { + this.success = null; + } + } + + public void setFieldValue(_Fields field, Object value) { + switch (field) { + case SUCCESS: + if (value == null) { + unsetSuccess(); + } else { + setSuccess((List)value); + } + break; + + } + } + + public Object getFieldValue(_Fields field) { + switch (field) { + case SUCCESS: + return getSuccess(); + + } + 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 SUCCESS: + return isSetSuccess(); + } + throw new IllegalStateException(); + } + + @Override + public boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof resourcePoolGetAll_result) + return this.equals((resourcePoolGetAll_result)that); + return false; + } + + public boolean equals(resourcePoolGetAll_result that) { + if (that == null) + return false; + + boolean this_present_success = true && this.isSetSuccess(); + boolean that_present_success = true && that.isSetSuccess(); + if (this_present_success || that_present_success) { + if (!(this_present_success && that_present_success)) + return false; + if (!this.success.equals(that.success)) + return false; + } + + return true; + } + + @Override + public int hashCode() { + List list = new ArrayList(); + + boolean present_success = true && (isSetSuccess()); + list.add(present_success); + if (present_success) + list.add(success); + + return list.hashCode(); + } + + @Override + public int compareTo(resourcePoolGetAll_result other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(other.isSetSuccess()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetSuccess()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, other.success); + 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("resourcePoolGetAll_result("); + boolean first = true; + + sb.append("success:"); + if (this.success == null) { + sb.append("null"); + } else { + sb.append(this.success); + } + 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 resourcePoolGetAll_resultStandardSchemeFactory implements SchemeFactory { + public resourcePoolGetAll_resultStandardScheme getScheme() { + return new resourcePoolGetAll_resultStandardScheme(); + } + } + + private static class resourcePoolGetAll_resultStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, resourcePoolGetAll_result 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 0: // SUCCESS + if (schemeField.type == org.apache.thrift.protocol.TType.LIST) { + { + org.apache.thrift.protocol.TList _list34 = iprot.readListBegin(); + struct.success = new ArrayList(_list34.size); + String _elem35; + for (int _i36 = 0; _i36 < _list34.size; ++_i36) + { + _elem35 = iprot.readString(); + struct.success.add(_elem35); + } + iprot.readListEnd(); + } + struct.setSuccessIsSet(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, resourcePoolGetAll_result struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.success != null) { + oprot.writeFieldBegin(SUCCESS_FIELD_DESC); + { + oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRING, struct.success.size())); + for (String _iter37 : struct.success) + { + oprot.writeString(_iter37); + } + oprot.writeListEnd(); + } + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class resourcePoolGetAll_resultTupleSchemeFactory implements SchemeFactory { + public resourcePoolGetAll_resultTupleScheme getScheme() { + return new resourcePoolGetAll_resultTupleScheme(); + } + } + + private static class resourcePoolGetAll_resultTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, resourcePoolGetAll_result struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + BitSet optionals = new BitSet(); + if (struct.isSetSuccess()) { + optionals.set(0); + } + oprot.writeBitSet(optionals, 1); + if (struct.isSetSuccess()) { + { + oprot.writeI32(struct.success.size()); + for (String _iter38 : struct.success) + { + oprot.writeString(_iter38); + } + } + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, resourcePoolGetAll_result struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(1); + if (incoming.get(0)) { + { + org.apache.thrift.protocol.TList _list39 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRING, iprot.readI32()); + struct.success = new ArrayList(_list39.size); + String _elem40; + for (int _i41 = 0; _i41 < _list39.size; ++_i41) + { + _elem40 = iprot.readString(); + struct.success.add(_elem40); + } + } + struct.setSuccessIsSet(true); + } + } + } + + } + + public static class resourceGet_args implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("resourceGet_args"); + + private static final org.apache.thrift.protocol.TField SESSION_KEY_FIELD_DESC = new org.apache.thrift.protocol.TField("sessionKey", org.apache.thrift.protocol.TType.STRING, (short)1); + private static final org.apache.thrift.protocol.TField PARAGRAPH_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("paragraphId", org.apache.thrift.protocol.TType.STRING, (short)2); + private static final org.apache.thrift.protocol.TField RESOURCE_NAME_FIELD_DESC = new org.apache.thrift.protocol.TField("resourceName", org.apache.thrift.protocol.TType.STRING, (short)3); + + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new resourceGet_argsStandardSchemeFactory()); + schemes.put(TupleScheme.class, new resourceGet_argsTupleSchemeFactory()); + } + + public String sessionKey; // required + public String paragraphId; // required + public String resourceName; // 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 { + SESSION_KEY((short)1, "sessionKey"), + PARAGRAPH_ID((short)2, "paragraphId"), + RESOURCE_NAME((short)3, "resourceName"); + + private static final Map byName = new HashMap(); + + 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: // SESSION_KEY + return SESSION_KEY; + case 2: // PARAGRAPH_ID + return PARAGRAPH_ID; + case 3: // RESOURCE_NAME + return RESOURCE_NAME; + 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.SESSION_KEY, new org.apache.thrift.meta_data.FieldMetaData("sessionKey", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); + tmpMap.put(_Fields.PARAGRAPH_ID, new org.apache.thrift.meta_data.FieldMetaData("paragraphId", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); + tmpMap.put(_Fields.RESOURCE_NAME, new org.apache.thrift.meta_data.FieldMetaData("resourceName", 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(resourceGet_args.class, metaDataMap); + } + + public resourceGet_args() { + } + + public resourceGet_args( + String sessionKey, + String paragraphId, + String resourceName) + { + this(); + this.sessionKey = sessionKey; + this.paragraphId = paragraphId; + this.resourceName = resourceName; + } + + /** + * Performs a deep copy on other. + */ + public resourceGet_args(resourceGet_args other) { + if (other.isSetSessionKey()) { + this.sessionKey = other.sessionKey; + } + if (other.isSetParagraphId()) { + this.paragraphId = other.paragraphId; + } + if (other.isSetResourceName()) { + this.resourceName = other.resourceName; + } + } + + public resourceGet_args deepCopy() { + return new resourceGet_args(this); + } + + @Override + public void clear() { + this.sessionKey = null; + this.paragraphId = null; + this.resourceName = null; + } + + public String getSessionKey() { + return this.sessionKey; + } + + public resourceGet_args setSessionKey(String sessionKey) { + this.sessionKey = sessionKey; + return this; + } + + public void unsetSessionKey() { + this.sessionKey = null; + } + + /** Returns true if field sessionKey is set (has been assigned a value) and false otherwise */ + public boolean isSetSessionKey() { + return this.sessionKey != null; + } + + public void setSessionKeyIsSet(boolean value) { + if (!value) { + this.sessionKey = null; + } + } + + public String getParagraphId() { + return this.paragraphId; + } + + public resourceGet_args setParagraphId(String paragraphId) { + this.paragraphId = paragraphId; + return this; + } + + public void unsetParagraphId() { + this.paragraphId = null; + } + + /** Returns true if field paragraphId is set (has been assigned a value) and false otherwise */ + public boolean isSetParagraphId() { + return this.paragraphId != null; + } + + public void setParagraphIdIsSet(boolean value) { + if (!value) { + this.paragraphId = null; + } + } + + public String getResourceName() { + return this.resourceName; + } + + public resourceGet_args setResourceName(String resourceName) { + this.resourceName = resourceName; + return this; + } + + public void unsetResourceName() { + this.resourceName = null; + } + + /** Returns true if field resourceName is set (has been assigned a value) and false otherwise */ + public boolean isSetResourceName() { + return this.resourceName != null; + } + + public void setResourceNameIsSet(boolean value) { + if (!value) { + this.resourceName = null; + } + } + + public void setFieldValue(_Fields field, Object value) { + switch (field) { + case SESSION_KEY: + if (value == null) { + unsetSessionKey(); + } else { + setSessionKey((String)value); + } + break; + + case PARAGRAPH_ID: + if (value == null) { + unsetParagraphId(); + } else { + setParagraphId((String)value); + } + break; + + case RESOURCE_NAME: + if (value == null) { + unsetResourceName(); + } else { + setResourceName((String)value); + } + break; + + } + } + + public Object getFieldValue(_Fields field) { + switch (field) { + case SESSION_KEY: + return getSessionKey(); + + case PARAGRAPH_ID: + return getParagraphId(); + + case RESOURCE_NAME: + return getResourceName(); + + } + 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 SESSION_KEY: + return isSetSessionKey(); + case PARAGRAPH_ID: + return isSetParagraphId(); + case RESOURCE_NAME: + return isSetResourceName(); + } + throw new IllegalStateException(); + } + + @Override + public boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof resourceGet_args) + return this.equals((resourceGet_args)that); + return false; + } + + public boolean equals(resourceGet_args that) { + if (that == null) + return false; + + boolean this_present_sessionKey = true && this.isSetSessionKey(); + boolean that_present_sessionKey = true && that.isSetSessionKey(); + if (this_present_sessionKey || that_present_sessionKey) { + if (!(this_present_sessionKey && that_present_sessionKey)) + return false; + if (!this.sessionKey.equals(that.sessionKey)) + return false; + } + + boolean this_present_paragraphId = true && this.isSetParagraphId(); + boolean that_present_paragraphId = true && that.isSetParagraphId(); + if (this_present_paragraphId || that_present_paragraphId) { + if (!(this_present_paragraphId && that_present_paragraphId)) + return false; + if (!this.paragraphId.equals(that.paragraphId)) + return false; + } + + boolean this_present_resourceName = true && this.isSetResourceName(); + boolean that_present_resourceName = true && that.isSetResourceName(); + if (this_present_resourceName || that_present_resourceName) { + if (!(this_present_resourceName && that_present_resourceName)) + return false; + if (!this.resourceName.equals(that.resourceName)) + return false; + } + + return true; + } + + @Override public int hashCode() { List list = new ArrayList(); + boolean present_sessionKey = true && (isSetSessionKey()); + list.add(present_sessionKey); + if (present_sessionKey) + list.add(sessionKey); + + boolean present_paragraphId = true && (isSetParagraphId()); + list.add(present_paragraphId); + if (present_paragraphId) + list.add(paragraphId); + + boolean present_resourceName = true && (isSetResourceName()); + list.add(present_resourceName); + if (present_resourceName) + list.add(resourceName); + return list.hashCode(); } @Override - public int compareTo(resourcePoolGetAll_args other) { + public int compareTo(resourceGet_args other) { if (!getClass().equals(other.getClass())) { return getClass().getName().compareTo(other.getClass().getName()); } int lastComparison = 0; + lastComparison = Boolean.valueOf(isSetSessionKey()).compareTo(other.isSetSessionKey()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetSessionKey()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.sessionKey, other.sessionKey); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetParagraphId()).compareTo(other.isSetParagraphId()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetParagraphId()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.paragraphId, other.paragraphId); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetResourceName()).compareTo(other.isSetResourceName()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetResourceName()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.resourceName, other.resourceName); + if (lastComparison != 0) { + return lastComparison; + } + } return 0; } @@ -14094,9 +15980,32 @@ public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache. @Override public String toString() { - StringBuilder sb = new StringBuilder("resourcePoolGetAll_args("); + StringBuilder sb = new StringBuilder("resourceGet_args("); boolean first = true; + sb.append("sessionKey:"); + if (this.sessionKey == null) { + sb.append("null"); + } else { + sb.append(this.sessionKey); + } + first = false; + if (!first) sb.append(", "); + sb.append("paragraphId:"); + if (this.paragraphId == null) { + sb.append("null"); + } else { + sb.append(this.paragraphId); + } + first = false; + if (!first) sb.append(", "); + sb.append("resourceName:"); + if (this.resourceName == null) { + sb.append("null"); + } else { + sb.append(this.resourceName); + } + first = false; sb.append(")"); return sb.toString(); } @@ -14122,15 +16031,15 @@ private void readObject(java.io.ObjectInputStream in) throws java.io.IOException } } - private static class resourcePoolGetAll_argsStandardSchemeFactory implements SchemeFactory { - public resourcePoolGetAll_argsStandardScheme getScheme() { - return new resourcePoolGetAll_argsStandardScheme(); + private static class resourceGet_argsStandardSchemeFactory implements SchemeFactory { + public resourceGet_argsStandardScheme getScheme() { + return new resourceGet_argsStandardScheme(); } } - private static class resourcePoolGetAll_argsStandardScheme extends StandardScheme { + private static class resourceGet_argsStandardScheme extends StandardScheme { - public void read(org.apache.thrift.protocol.TProtocol iprot, resourcePoolGetAll_args struct) throws org.apache.thrift.TException { + public void read(org.apache.thrift.protocol.TProtocol iprot, resourceGet_args struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TField schemeField; iprot.readStructBegin(); while (true) @@ -14140,6 +16049,30 @@ public void read(org.apache.thrift.protocol.TProtocol iprot, resourcePoolGetAll_ break; } switch (schemeField.id) { + case 1: // SESSION_KEY + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.sessionKey = iprot.readString(); + struct.setSessionKeyIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 2: // PARAGRAPH_ID + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.paragraphId = iprot.readString(); + struct.setParagraphIdIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 3: // RESOURCE_NAME + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.resourceName = iprot.readString(); + struct.setResourceNameIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; default: org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } @@ -14151,49 +16084,97 @@ public void read(org.apache.thrift.protocol.TProtocol iprot, resourcePoolGetAll_ struct.validate(); } - public void write(org.apache.thrift.protocol.TProtocol oprot, resourcePoolGetAll_args struct) throws org.apache.thrift.TException { + public void write(org.apache.thrift.protocol.TProtocol oprot, resourceGet_args struct) throws org.apache.thrift.TException { struct.validate(); oprot.writeStructBegin(STRUCT_DESC); + if (struct.sessionKey != null) { + oprot.writeFieldBegin(SESSION_KEY_FIELD_DESC); + oprot.writeString(struct.sessionKey); + oprot.writeFieldEnd(); + } + if (struct.paragraphId != null) { + oprot.writeFieldBegin(PARAGRAPH_ID_FIELD_DESC); + oprot.writeString(struct.paragraphId); + oprot.writeFieldEnd(); + } + if (struct.resourceName != null) { + oprot.writeFieldBegin(RESOURCE_NAME_FIELD_DESC); + oprot.writeString(struct.resourceName); + oprot.writeFieldEnd(); + } oprot.writeFieldStop(); oprot.writeStructEnd(); } } - private static class resourcePoolGetAll_argsTupleSchemeFactory implements SchemeFactory { - public resourcePoolGetAll_argsTupleScheme getScheme() { - return new resourcePoolGetAll_argsTupleScheme(); + private static class resourceGet_argsTupleSchemeFactory implements SchemeFactory { + public resourceGet_argsTupleScheme getScheme() { + return new resourceGet_argsTupleScheme(); } } - private static class resourcePoolGetAll_argsTupleScheme extends TupleScheme { + private static class resourceGet_argsTupleScheme extends TupleScheme { @Override - public void write(org.apache.thrift.protocol.TProtocol prot, resourcePoolGetAll_args struct) throws org.apache.thrift.TException { + public void write(org.apache.thrift.protocol.TProtocol prot, resourceGet_args struct) throws org.apache.thrift.TException { TTupleProtocol oprot = (TTupleProtocol) prot; + BitSet optionals = new BitSet(); + if (struct.isSetSessionKey()) { + optionals.set(0); + } + if (struct.isSetParagraphId()) { + optionals.set(1); + } + if (struct.isSetResourceName()) { + optionals.set(2); + } + oprot.writeBitSet(optionals, 3); + if (struct.isSetSessionKey()) { + oprot.writeString(struct.sessionKey); + } + if (struct.isSetParagraphId()) { + oprot.writeString(struct.paragraphId); + } + if (struct.isSetResourceName()) { + oprot.writeString(struct.resourceName); + } } @Override - public void read(org.apache.thrift.protocol.TProtocol prot, resourcePoolGetAll_args struct) throws org.apache.thrift.TException { + public void read(org.apache.thrift.protocol.TProtocol prot, resourceGet_args struct) throws org.apache.thrift.TException { TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(3); + if (incoming.get(0)) { + struct.sessionKey = iprot.readString(); + struct.setSessionKeyIsSet(true); + } + if (incoming.get(1)) { + struct.paragraphId = iprot.readString(); + struct.setParagraphIdIsSet(true); + } + if (incoming.get(2)) { + struct.resourceName = iprot.readString(); + struct.setResourceNameIsSet(true); + } } } } - public static class resourcePoolGetAll_result implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("resourcePoolGetAll_result"); + public static class resourceGet_result implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("resourceGet_result"); - private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.LIST, (short)0); + private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.STRING, (short)0); private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); static { - schemes.put(StandardScheme.class, new resourcePoolGetAll_resultStandardSchemeFactory()); - schemes.put(TupleScheme.class, new resourcePoolGetAll_resultTupleSchemeFactory()); + schemes.put(StandardScheme.class, new resourceGet_resultStandardSchemeFactory()); + schemes.put(TupleScheme.class, new resourceGet_resultTupleSchemeFactory()); } - public List success; // required + public ByteBuffer success; // 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 { @@ -14258,34 +16239,32 @@ public String getFieldName() { static { Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)))); + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING , true))); metaDataMap = Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(resourcePoolGetAll_result.class, metaDataMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(resourceGet_result.class, metaDataMap); } - public resourcePoolGetAll_result() { + public resourceGet_result() { } - public resourcePoolGetAll_result( - List success) + public resourceGet_result( + ByteBuffer success) { this(); - this.success = success; + this.success = org.apache.thrift.TBaseHelper.copyBinary(success); } /** * Performs a deep copy on other. */ - public resourcePoolGetAll_result(resourcePoolGetAll_result other) { + public resourceGet_result(resourceGet_result other) { if (other.isSetSuccess()) { - List __this__success = new ArrayList(other.success); - this.success = __this__success; + this.success = org.apache.thrift.TBaseHelper.copyBinary(other.success); } } - public resourcePoolGetAll_result deepCopy() { - return new resourcePoolGetAll_result(this); + public resourceGet_result deepCopy() { + return new resourceGet_result(this); } @Override @@ -14293,27 +16272,22 @@ public void clear() { this.success = null; } - public int getSuccessSize() { - return (this.success == null) ? 0 : this.success.size(); - } - - public java.util.Iterator getSuccessIterator() { - return (this.success == null) ? null : this.success.iterator(); + public byte[] getSuccess() { + setSuccess(org.apache.thrift.TBaseHelper.rightSize(success)); + return success == null ? null : success.array(); } - public void addToSuccess(String elem) { - if (this.success == null) { - this.success = new ArrayList(); - } - this.success.add(elem); + public ByteBuffer bufferForSuccess() { + return org.apache.thrift.TBaseHelper.copyBinary(success); } - public List getSuccess() { - return this.success; + public resourceGet_result setSuccess(byte[] success) { + this.success = success == null ? (ByteBuffer)null : ByteBuffer.wrap(Arrays.copyOf(success, success.length)); + return this; } - public resourcePoolGetAll_result setSuccess(List success) { - this.success = success; + public resourceGet_result setSuccess(ByteBuffer success) { + this.success = org.apache.thrift.TBaseHelper.copyBinary(success); return this; } @@ -14338,7 +16312,7 @@ public void setFieldValue(_Fields field, Object value) { if (value == null) { unsetSuccess(); } else { - setSuccess((List)value); + setSuccess((ByteBuffer)value); } break; @@ -14371,12 +16345,12 @@ public boolean isSet(_Fields field) { public boolean equals(Object that) { if (that == null) return false; - if (that instanceof resourcePoolGetAll_result) - return this.equals((resourcePoolGetAll_result)that); + if (that instanceof resourceGet_result) + return this.equals((resourceGet_result)that); return false; } - public boolean equals(resourcePoolGetAll_result that) { + public boolean equals(resourceGet_result that) { if (that == null) return false; @@ -14405,7 +16379,7 @@ public int hashCode() { } @Override - public int compareTo(resourcePoolGetAll_result other) { + public int compareTo(resourceGet_result other) { if (!getClass().equals(other.getClass())) { return getClass().getName().compareTo(other.getClass().getName()); } @@ -14439,14 +16413,14 @@ public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache. @Override public String toString() { - StringBuilder sb = new StringBuilder("resourcePoolGetAll_result("); + StringBuilder sb = new StringBuilder("resourceGet_result("); boolean first = true; sb.append("success:"); if (this.success == null) { sb.append("null"); } else { - sb.append(this.success); + org.apache.thrift.TBaseHelper.toString(this.success, sb); } first = false; sb.append(")"); @@ -14474,15 +16448,15 @@ private void readObject(java.io.ObjectInputStream in) throws java.io.IOException } } - private static class resourcePoolGetAll_resultStandardSchemeFactory implements SchemeFactory { - public resourcePoolGetAll_resultStandardScheme getScheme() { - return new resourcePoolGetAll_resultStandardScheme(); + private static class resourceGet_resultStandardSchemeFactory implements SchemeFactory { + public resourceGet_resultStandardScheme getScheme() { + return new resourceGet_resultStandardScheme(); } } - private static class resourcePoolGetAll_resultStandardScheme extends StandardScheme { + private static class resourceGet_resultStandardScheme extends StandardScheme { - public void read(org.apache.thrift.protocol.TProtocol iprot, resourcePoolGetAll_result struct) throws org.apache.thrift.TException { + public void read(org.apache.thrift.protocol.TProtocol iprot, resourceGet_result struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TField schemeField; iprot.readStructBegin(); while (true) @@ -14493,18 +16467,8 @@ public void read(org.apache.thrift.protocol.TProtocol iprot, resourcePoolGetAll_ } switch (schemeField.id) { case 0: // SUCCESS - if (schemeField.type == org.apache.thrift.protocol.TType.LIST) { - { - org.apache.thrift.protocol.TList _list34 = iprot.readListBegin(); - struct.success = new ArrayList(_list34.size); - String _elem35; - for (int _i36 = 0; _i36 < _list34.size; ++_i36) - { - _elem35 = iprot.readString(); - struct.success.add(_elem35); - } - iprot.readListEnd(); - } + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.success = iprot.readBinary(); struct.setSuccessIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); @@ -14521,20 +16485,13 @@ public void read(org.apache.thrift.protocol.TProtocol iprot, resourcePoolGetAll_ struct.validate(); } - public void write(org.apache.thrift.protocol.TProtocol oprot, resourcePoolGetAll_result struct) throws org.apache.thrift.TException { + public void write(org.apache.thrift.protocol.TProtocol oprot, resourceGet_result struct) throws org.apache.thrift.TException { struct.validate(); oprot.writeStructBegin(STRUCT_DESC); if (struct.success != null) { oprot.writeFieldBegin(SUCCESS_FIELD_DESC); - { - oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRING, struct.success.size())); - for (String _iter37 : struct.success) - { - oprot.writeString(_iter37); - } - oprot.writeListEnd(); - } + oprot.writeBinary(struct.success); oprot.writeFieldEnd(); } oprot.writeFieldStop(); @@ -14543,16 +16500,16 @@ public void write(org.apache.thrift.protocol.TProtocol oprot, resourcePoolGetAll } - private static class resourcePoolGetAll_resultTupleSchemeFactory implements SchemeFactory { - public resourcePoolGetAll_resultTupleScheme getScheme() { - return new resourcePoolGetAll_resultTupleScheme(); + private static class resourceGet_resultTupleSchemeFactory implements SchemeFactory { + public resourceGet_resultTupleScheme getScheme() { + return new resourceGet_resultTupleScheme(); } } - private static class resourcePoolGetAll_resultTupleScheme extends TupleScheme { + private static class resourceGet_resultTupleScheme extends TupleScheme { @Override - public void write(org.apache.thrift.protocol.TProtocol prot, resourcePoolGetAll_result struct) throws org.apache.thrift.TException { + public void write(org.apache.thrift.protocol.TProtocol prot, resourceGet_result struct) throws org.apache.thrift.TException { TTupleProtocol oprot = (TTupleProtocol) prot; BitSet optionals = new BitSet(); if (struct.isSetSuccess()) { @@ -14560,31 +16517,16 @@ public void write(org.apache.thrift.protocol.TProtocol prot, resourcePoolGetAll_ } oprot.writeBitSet(optionals, 1); if (struct.isSetSuccess()) { - { - oprot.writeI32(struct.success.size()); - for (String _iter38 : struct.success) - { - oprot.writeString(_iter38); - } - } + oprot.writeBinary(struct.success); } } @Override - public void read(org.apache.thrift.protocol.TProtocol prot, resourcePoolGetAll_result struct) throws org.apache.thrift.TException { + public void read(org.apache.thrift.protocol.TProtocol prot, resourceGet_result struct) throws org.apache.thrift.TException { TTupleProtocol iprot = (TTupleProtocol) prot; BitSet incoming = iprot.readBitSet(1); if (incoming.get(0)) { - { - org.apache.thrift.protocol.TList _list39 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRING, iprot.readI32()); - struct.success = new ArrayList(_list39.size); - String _elem40; - for (int _i41 = 0; _i41 < _list39.size; ++_i41) - { - _elem40 = iprot.readString(); - struct.success.add(_elem40); - } - } + struct.success = iprot.readBinary(); struct.setSuccessIsSet(true); } } @@ -14592,8 +16534,8 @@ public void read(org.apache.thrift.protocol.TProtocol prot, resourcePoolGetAll_r } - public static class resourceGet_args implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("resourceGet_args"); + public static class resourceRemove_args implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("resourceRemove_args"); private static final org.apache.thrift.protocol.TField SESSION_KEY_FIELD_DESC = new org.apache.thrift.protocol.TField("sessionKey", org.apache.thrift.protocol.TType.STRING, (short)1); private static final org.apache.thrift.protocol.TField PARAGRAPH_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("paragraphId", org.apache.thrift.protocol.TType.STRING, (short)2); @@ -14601,8 +16543,8 @@ public static class resourceGet_args implements org.apache.thrift.TBase, SchemeFactory> schemes = new HashMap, SchemeFactory>(); static { - schemes.put(StandardScheme.class, new resourceGet_argsStandardSchemeFactory()); - schemes.put(TupleScheme.class, new resourceGet_argsTupleSchemeFactory()); + schemes.put(StandardScheme.class, new resourceRemove_argsStandardSchemeFactory()); + schemes.put(TupleScheme.class, new resourceRemove_argsTupleSchemeFactory()); } public String sessionKey; // required @@ -14684,13 +16626,13 @@ public String getFieldName() { tmpMap.put(_Fields.RESOURCE_NAME, new org.apache.thrift.meta_data.FieldMetaData("resourceName", 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(resourceGet_args.class, metaDataMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(resourceRemove_args.class, metaDataMap); } - public resourceGet_args() { + public resourceRemove_args() { } - public resourceGet_args( + public resourceRemove_args( String sessionKey, String paragraphId, String resourceName) @@ -14704,7 +16646,7 @@ public resourceGet_args( /** * Performs a deep copy on other. */ - public resourceGet_args(resourceGet_args other) { + public resourceRemove_args(resourceRemove_args other) { if (other.isSetSessionKey()) { this.sessionKey = other.sessionKey; } @@ -14716,8 +16658,8 @@ public resourceGet_args(resourceGet_args other) { } } - public resourceGet_args deepCopy() { - return new resourceGet_args(this); + public resourceRemove_args deepCopy() { + return new resourceRemove_args(this); } @Override @@ -14731,7 +16673,7 @@ public String getSessionKey() { return this.sessionKey; } - public resourceGet_args setSessionKey(String sessionKey) { + public resourceRemove_args setSessionKey(String sessionKey) { this.sessionKey = sessionKey; return this; } @@ -14755,7 +16697,7 @@ public String getParagraphId() { return this.paragraphId; } - public resourceGet_args setParagraphId(String paragraphId) { + public resourceRemove_args setParagraphId(String paragraphId) { this.paragraphId = paragraphId; return this; } @@ -14779,7 +16721,7 @@ public String getResourceName() { return this.resourceName; } - public resourceGet_args setResourceName(String resourceName) { + public resourceRemove_args setResourceName(String resourceName) { this.resourceName = resourceName; return this; } @@ -14864,12 +16806,12 @@ public boolean isSet(_Fields field) { public boolean equals(Object that) { if (that == null) return false; - if (that instanceof resourceGet_args) - return this.equals((resourceGet_args)that); + if (that instanceof resourceRemove_args) + return this.equals((resourceRemove_args)that); return false; } - public boolean equals(resourceGet_args that) { + public boolean equals(resourceRemove_args that) { if (that == null) return false; @@ -14926,7 +16868,7 @@ public int hashCode() { } @Override - public int compareTo(resourceGet_args other) { + public int compareTo(resourceRemove_args other) { if (!getClass().equals(other.getClass())) { return getClass().getName().compareTo(other.getClass().getName()); } @@ -14980,7 +16922,7 @@ public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache. @Override public String toString() { - StringBuilder sb = new StringBuilder("resourceGet_args("); + StringBuilder sb = new StringBuilder("resourceRemove_args("); boolean first = true; sb.append("sessionKey:"); @@ -15031,15 +16973,15 @@ private void readObject(java.io.ObjectInputStream in) throws java.io.IOException } } - private static class resourceGet_argsStandardSchemeFactory implements SchemeFactory { - public resourceGet_argsStandardScheme getScheme() { - return new resourceGet_argsStandardScheme(); + private static class resourceRemove_argsStandardSchemeFactory implements SchemeFactory { + public resourceRemove_argsStandardScheme getScheme() { + return new resourceRemove_argsStandardScheme(); } } - private static class resourceGet_argsStandardScheme extends StandardScheme { + private static class resourceRemove_argsStandardScheme extends StandardScheme { - public void read(org.apache.thrift.protocol.TProtocol iprot, resourceGet_args struct) throws org.apache.thrift.TException { + public void read(org.apache.thrift.protocol.TProtocol iprot, resourceRemove_args struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TField schemeField; iprot.readStructBegin(); while (true) @@ -15084,7 +17026,7 @@ public void read(org.apache.thrift.protocol.TProtocol iprot, resourceGet_args st struct.validate(); } - public void write(org.apache.thrift.protocol.TProtocol oprot, resourceGet_args struct) throws org.apache.thrift.TException { + public void write(org.apache.thrift.protocol.TProtocol oprot, resourceRemove_args struct) throws org.apache.thrift.TException { struct.validate(); oprot.writeStructBegin(STRUCT_DESC); @@ -15109,16 +17051,16 @@ public void write(org.apache.thrift.protocol.TProtocol oprot, resourceGet_args s } - private static class resourceGet_argsTupleSchemeFactory implements SchemeFactory { - public resourceGet_argsTupleScheme getScheme() { - return new resourceGet_argsTupleScheme(); + private static class resourceRemove_argsTupleSchemeFactory implements SchemeFactory { + public resourceRemove_argsTupleScheme getScheme() { + return new resourceRemove_argsTupleScheme(); } } - private static class resourceGet_argsTupleScheme extends TupleScheme { + private static class resourceRemove_argsTupleScheme extends TupleScheme { @Override - public void write(org.apache.thrift.protocol.TProtocol prot, resourceGet_args struct) throws org.apache.thrift.TException { + public void write(org.apache.thrift.protocol.TProtocol prot, resourceRemove_args struct) throws org.apache.thrift.TException { TTupleProtocol oprot = (TTupleProtocol) prot; BitSet optionals = new BitSet(); if (struct.isSetSessionKey()) { @@ -15143,7 +17085,7 @@ public void write(org.apache.thrift.protocol.TProtocol prot, resourceGet_args st } @Override - public void read(org.apache.thrift.protocol.TProtocol prot, resourceGet_args struct) throws org.apache.thrift.TException { + public void read(org.apache.thrift.protocol.TProtocol prot, resourceRemove_args struct) throws org.apache.thrift.TException { TTupleProtocol iprot = (TTupleProtocol) prot; BitSet incoming = iprot.readBitSet(3); if (incoming.get(0)) { @@ -15163,18 +17105,18 @@ public void read(org.apache.thrift.protocol.TProtocol prot, resourceGet_args str } - public static class resourceGet_result implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("resourceGet_result"); + public static class resourceRemove_result implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("resourceRemove_result"); - private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.STRING, (short)0); + private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.BOOL, (short)0); private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); static { - schemes.put(StandardScheme.class, new resourceGet_resultStandardSchemeFactory()); - schemes.put(TupleScheme.class, new resourceGet_resultTupleSchemeFactory()); + schemes.put(StandardScheme.class, new resourceRemove_resultStandardSchemeFactory()); + schemes.put(TupleScheme.class, new resourceRemove_resultTupleSchemeFactory()); } - public ByteBuffer success; // required + public boolean success; // 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 { @@ -15235,75 +17177,67 @@ public String getFieldName() { } // isset id assignments + private static final int __SUCCESS_ISSET_ID = 0; + private byte __isset_bitfield = 0; 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.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING , true))); + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BOOL))); metaDataMap = Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(resourceGet_result.class, metaDataMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(resourceRemove_result.class, metaDataMap); } - public resourceGet_result() { + public resourceRemove_result() { } - public resourceGet_result( - ByteBuffer success) + public resourceRemove_result( + boolean success) { this(); - this.success = org.apache.thrift.TBaseHelper.copyBinary(success); + this.success = success; + setSuccessIsSet(true); } /** * Performs a deep copy on other. */ - public resourceGet_result(resourceGet_result other) { - if (other.isSetSuccess()) { - this.success = org.apache.thrift.TBaseHelper.copyBinary(other.success); - } + public resourceRemove_result(resourceRemove_result other) { + __isset_bitfield = other.__isset_bitfield; + this.success = other.success; } - public resourceGet_result deepCopy() { - return new resourceGet_result(this); + public resourceRemove_result deepCopy() { + return new resourceRemove_result(this); } @Override public void clear() { - this.success = null; - } - - public byte[] getSuccess() { - setSuccess(org.apache.thrift.TBaseHelper.rightSize(success)); - return success == null ? null : success.array(); - } - - public ByteBuffer bufferForSuccess() { - return org.apache.thrift.TBaseHelper.copyBinary(success); + setSuccessIsSet(false); + this.success = false; } - public resourceGet_result setSuccess(byte[] success) { - this.success = success == null ? (ByteBuffer)null : ByteBuffer.wrap(Arrays.copyOf(success, success.length)); - return this; + public boolean isSuccess() { + return this.success; } - public resourceGet_result setSuccess(ByteBuffer success) { - this.success = org.apache.thrift.TBaseHelper.copyBinary(success); + public resourceRemove_result setSuccess(boolean success) { + this.success = success; + setSuccessIsSet(true); return this; } public void unsetSuccess() { - this.success = null; + __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __SUCCESS_ISSET_ID); } /** Returns true if field success is set (has been assigned a value) and false otherwise */ public boolean isSetSuccess() { - return this.success != null; + return EncodingUtils.testBit(__isset_bitfield, __SUCCESS_ISSET_ID); } public void setSuccessIsSet(boolean value) { - if (!value) { - this.success = null; - } + __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __SUCCESS_ISSET_ID, value); } public void setFieldValue(_Fields field, Object value) { @@ -15312,7 +17246,7 @@ public void setFieldValue(_Fields field, Object value) { if (value == null) { unsetSuccess(); } else { - setSuccess((ByteBuffer)value); + setSuccess((Boolean)value); } break; @@ -15322,7 +17256,7 @@ public void setFieldValue(_Fields field, Object value) { public Object getFieldValue(_Fields field) { switch (field) { case SUCCESS: - return getSuccess(); + return Boolean.valueOf(isSuccess()); } throw new IllegalStateException(); @@ -15345,21 +17279,21 @@ public boolean isSet(_Fields field) { public boolean equals(Object that) { if (that == null) return false; - if (that instanceof resourceGet_result) - return this.equals((resourceGet_result)that); + if (that instanceof resourceRemove_result) + return this.equals((resourceRemove_result)that); return false; } - public boolean equals(resourceGet_result that) { + public boolean equals(resourceRemove_result that) { if (that == null) return false; - boolean this_present_success = true && this.isSetSuccess(); - boolean that_present_success = true && that.isSetSuccess(); + boolean this_present_success = true; + boolean that_present_success = true; if (this_present_success || that_present_success) { if (!(this_present_success && that_present_success)) return false; - if (!this.success.equals(that.success)) + if (this.success != that.success) return false; } @@ -15370,7 +17304,7 @@ public boolean equals(resourceGet_result that) { public int hashCode() { List list = new ArrayList(); - boolean present_success = true && (isSetSuccess()); + boolean present_success = true; list.add(present_success); if (present_success) list.add(success); @@ -15379,7 +17313,7 @@ public int hashCode() { } @Override - public int compareTo(resourceGet_result other) { + public int compareTo(resourceRemove_result other) { if (!getClass().equals(other.getClass())) { return getClass().getName().compareTo(other.getClass().getName()); } @@ -15413,15 +17347,11 @@ public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache. @Override public String toString() { - StringBuilder sb = new StringBuilder("resourceGet_result("); + StringBuilder sb = new StringBuilder("resourceRemove_result("); boolean first = true; sb.append("success:"); - if (this.success == null) { - sb.append("null"); - } else { - org.apache.thrift.TBaseHelper.toString(this.success, sb); - } + sb.append(this.success); first = false; sb.append(")"); return sb.toString(); @@ -15442,21 +17372,23 @@ private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOExcept private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { try { + // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor. + __isset_bitfield = 0; read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); } catch (org.apache.thrift.TException te) { throw new java.io.IOException(te); } } - private static class resourceGet_resultStandardSchemeFactory implements SchemeFactory { - public resourceGet_resultStandardScheme getScheme() { - return new resourceGet_resultStandardScheme(); + private static class resourceRemove_resultStandardSchemeFactory implements SchemeFactory { + public resourceRemove_resultStandardScheme getScheme() { + return new resourceRemove_resultStandardScheme(); } } - private static class resourceGet_resultStandardScheme extends StandardScheme { + private static class resourceRemove_resultStandardScheme extends StandardScheme { - public void read(org.apache.thrift.protocol.TProtocol iprot, resourceGet_result struct) throws org.apache.thrift.TException { + public void read(org.apache.thrift.protocol.TProtocol iprot, resourceRemove_result struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TField schemeField; iprot.readStructBegin(); while (true) @@ -15467,8 +17399,8 @@ public void read(org.apache.thrift.protocol.TProtocol iprot, resourceGet_result } switch (schemeField.id) { case 0: // SUCCESS - if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { - struct.success = iprot.readBinary(); + if (schemeField.type == org.apache.thrift.protocol.TType.BOOL) { + struct.success = iprot.readBool(); struct.setSuccessIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); @@ -15485,13 +17417,13 @@ public void read(org.apache.thrift.protocol.TProtocol iprot, resourceGet_result struct.validate(); } - public void write(org.apache.thrift.protocol.TProtocol oprot, resourceGet_result struct) throws org.apache.thrift.TException { + public void write(org.apache.thrift.protocol.TProtocol oprot, resourceRemove_result struct) throws org.apache.thrift.TException { struct.validate(); oprot.writeStructBegin(STRUCT_DESC); - if (struct.success != null) { + if (struct.isSetSuccess()) { oprot.writeFieldBegin(SUCCESS_FIELD_DESC); - oprot.writeBinary(struct.success); + oprot.writeBool(struct.success); oprot.writeFieldEnd(); } oprot.writeFieldStop(); @@ -15500,16 +17432,16 @@ public void write(org.apache.thrift.protocol.TProtocol oprot, resourceGet_result } - private static class resourceGet_resultTupleSchemeFactory implements SchemeFactory { - public resourceGet_resultTupleScheme getScheme() { - return new resourceGet_resultTupleScheme(); + private static class resourceRemove_resultTupleSchemeFactory implements SchemeFactory { + public resourceRemove_resultTupleScheme getScheme() { + return new resourceRemove_resultTupleScheme(); } } - private static class resourceGet_resultTupleScheme extends TupleScheme { + private static class resourceRemove_resultTupleScheme extends TupleScheme { @Override - public void write(org.apache.thrift.protocol.TProtocol prot, resourceGet_result struct) throws org.apache.thrift.TException { + public void write(org.apache.thrift.protocol.TProtocol prot, resourceRemove_result struct) throws org.apache.thrift.TException { TTupleProtocol oprot = (TTupleProtocol) prot; BitSet optionals = new BitSet(); if (struct.isSetSuccess()) { @@ -15517,16 +17449,16 @@ public void write(org.apache.thrift.protocol.TProtocol prot, resourceGet_result } oprot.writeBitSet(optionals, 1); if (struct.isSetSuccess()) { - oprot.writeBinary(struct.success); + oprot.writeBool(struct.success); } } @Override - public void read(org.apache.thrift.protocol.TProtocol prot, resourceGet_result struct) throws org.apache.thrift.TException { + public void read(org.apache.thrift.protocol.TProtocol prot, resourceRemove_result struct) throws org.apache.thrift.TException { TTupleProtocol iprot = (TTupleProtocol) prot; BitSet incoming = iprot.readBitSet(1); if (incoming.get(0)) { - struct.success = iprot.readBinary(); + struct.success = iprot.readBool(); struct.setSuccessIsSet(true); } } @@ -15534,28 +17466,31 @@ public void read(org.apache.thrift.protocol.TProtocol prot, resourceGet_result s } - public static class resourceRemove_args implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("resourceRemove_args"); + public static class resourceInvokeMethod_args implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("resourceInvokeMethod_args"); private static final org.apache.thrift.protocol.TField SESSION_KEY_FIELD_DESC = new org.apache.thrift.protocol.TField("sessionKey", org.apache.thrift.protocol.TType.STRING, (short)1); private static final org.apache.thrift.protocol.TField PARAGRAPH_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("paragraphId", org.apache.thrift.protocol.TType.STRING, (short)2); private static final org.apache.thrift.protocol.TField RESOURCE_NAME_FIELD_DESC = new org.apache.thrift.protocol.TField("resourceName", org.apache.thrift.protocol.TType.STRING, (short)3); + private static final org.apache.thrift.protocol.TField INVOKE_MESSAGE_FIELD_DESC = new org.apache.thrift.protocol.TField("invokeMessage", org.apache.thrift.protocol.TType.STRING, (short)4); private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); static { - schemes.put(StandardScheme.class, new resourceRemove_argsStandardSchemeFactory()); - schemes.put(TupleScheme.class, new resourceRemove_argsTupleSchemeFactory()); + schemes.put(StandardScheme.class, new resourceInvokeMethod_argsStandardSchemeFactory()); + schemes.put(TupleScheme.class, new resourceInvokeMethod_argsTupleSchemeFactory()); } public String sessionKey; // required public String paragraphId; // required public String resourceName; // required + public String invokeMessage; // 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 { SESSION_KEY((short)1, "sessionKey"), PARAGRAPH_ID((short)2, "paragraphId"), - RESOURCE_NAME((short)3, "resourceName"); + RESOURCE_NAME((short)3, "resourceName"), + INVOKE_MESSAGE((short)4, "invokeMessage"); private static final Map byName = new HashMap(); @@ -15576,6 +17511,8 @@ public static _Fields findByThriftId(int fieldId) { return PARAGRAPH_ID; case 3: // RESOURCE_NAME return RESOURCE_NAME; + case 4: // INVOKE_MESSAGE + return INVOKE_MESSAGE; default: return null; } @@ -15625,28 +17562,32 @@ public String getFieldName() { new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); tmpMap.put(_Fields.RESOURCE_NAME, new org.apache.thrift.meta_data.FieldMetaData("resourceName", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); + tmpMap.put(_Fields.INVOKE_MESSAGE, new org.apache.thrift.meta_data.FieldMetaData("invokeMessage", 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(resourceRemove_args.class, metaDataMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(resourceInvokeMethod_args.class, metaDataMap); } - public resourceRemove_args() { + public resourceInvokeMethod_args() { } - public resourceRemove_args( + public resourceInvokeMethod_args( String sessionKey, String paragraphId, - String resourceName) + String resourceName, + String invokeMessage) { this(); this.sessionKey = sessionKey; this.paragraphId = paragraphId; this.resourceName = resourceName; + this.invokeMessage = invokeMessage; } /** * Performs a deep copy on other. */ - public resourceRemove_args(resourceRemove_args other) { + public resourceInvokeMethod_args(resourceInvokeMethod_args other) { if (other.isSetSessionKey()) { this.sessionKey = other.sessionKey; } @@ -15656,10 +17597,13 @@ public resourceRemove_args(resourceRemove_args other) { if (other.isSetResourceName()) { this.resourceName = other.resourceName; } + if (other.isSetInvokeMessage()) { + this.invokeMessage = other.invokeMessage; + } } - public resourceRemove_args deepCopy() { - return new resourceRemove_args(this); + public resourceInvokeMethod_args deepCopy() { + return new resourceInvokeMethod_args(this); } @Override @@ -15667,13 +17611,14 @@ public void clear() { this.sessionKey = null; this.paragraphId = null; this.resourceName = null; + this.invokeMessage = null; } public String getSessionKey() { return this.sessionKey; } - public resourceRemove_args setSessionKey(String sessionKey) { + public resourceInvokeMethod_args setSessionKey(String sessionKey) { this.sessionKey = sessionKey; return this; } @@ -15697,7 +17642,7 @@ public String getParagraphId() { return this.paragraphId; } - public resourceRemove_args setParagraphId(String paragraphId) { + public resourceInvokeMethod_args setParagraphId(String paragraphId) { this.paragraphId = paragraphId; return this; } @@ -15721,7 +17666,7 @@ public String getResourceName() { return this.resourceName; } - public resourceRemove_args setResourceName(String resourceName) { + public resourceInvokeMethod_args setResourceName(String resourceName) { this.resourceName = resourceName; return this; } @@ -15741,6 +17686,30 @@ public void setResourceNameIsSet(boolean value) { } } + public String getInvokeMessage() { + return this.invokeMessage; + } + + public resourceInvokeMethod_args setInvokeMessage(String invokeMessage) { + this.invokeMessage = invokeMessage; + return this; + } + + public void unsetInvokeMessage() { + this.invokeMessage = null; + } + + /** Returns true if field invokeMessage is set (has been assigned a value) and false otherwise */ + public boolean isSetInvokeMessage() { + return this.invokeMessage != null; + } + + public void setInvokeMessageIsSet(boolean value) { + if (!value) { + this.invokeMessage = null; + } + } + public void setFieldValue(_Fields field, Object value) { switch (field) { case SESSION_KEY: @@ -15767,6 +17736,14 @@ public void setFieldValue(_Fields field, Object value) { } break; + case INVOKE_MESSAGE: + if (value == null) { + unsetInvokeMessage(); + } else { + setInvokeMessage((String)value); + } + break; + } } @@ -15781,6 +17758,9 @@ public Object getFieldValue(_Fields field) { case RESOURCE_NAME: return getResourceName(); + case INVOKE_MESSAGE: + return getInvokeMessage(); + } throw new IllegalStateException(); } @@ -15798,6 +17778,8 @@ public boolean isSet(_Fields field) { return isSetParagraphId(); case RESOURCE_NAME: return isSetResourceName(); + case INVOKE_MESSAGE: + return isSetInvokeMessage(); } throw new IllegalStateException(); } @@ -15806,12 +17788,12 @@ public boolean isSet(_Fields field) { public boolean equals(Object that) { if (that == null) return false; - if (that instanceof resourceRemove_args) - return this.equals((resourceRemove_args)that); + if (that instanceof resourceInvokeMethod_args) + return this.equals((resourceInvokeMethod_args)that); return false; } - public boolean equals(resourceRemove_args that) { + public boolean equals(resourceInvokeMethod_args that) { if (that == null) return false; @@ -15842,6 +17824,15 @@ public boolean equals(resourceRemove_args that) { return false; } + boolean this_present_invokeMessage = true && this.isSetInvokeMessage(); + boolean that_present_invokeMessage = true && that.isSetInvokeMessage(); + if (this_present_invokeMessage || that_present_invokeMessage) { + if (!(this_present_invokeMessage && that_present_invokeMessage)) + return false; + if (!this.invokeMessage.equals(that.invokeMessage)) + return false; + } + return true; } @@ -15864,11 +17855,16 @@ public int hashCode() { if (present_resourceName) list.add(resourceName); + boolean present_invokeMessage = true && (isSetInvokeMessage()); + list.add(present_invokeMessage); + if (present_invokeMessage) + list.add(invokeMessage); + return list.hashCode(); } @Override - public int compareTo(resourceRemove_args other) { + public int compareTo(resourceInvokeMethod_args other) { if (!getClass().equals(other.getClass())) { return getClass().getName().compareTo(other.getClass().getName()); } @@ -15905,6 +17901,16 @@ public int compareTo(resourceRemove_args other) { return lastComparison; } } + lastComparison = Boolean.valueOf(isSetInvokeMessage()).compareTo(other.isSetInvokeMessage()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetInvokeMessage()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.invokeMessage, other.invokeMessage); + if (lastComparison != 0) { + return lastComparison; + } + } return 0; } @@ -15922,7 +17928,7 @@ public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache. @Override public String toString() { - StringBuilder sb = new StringBuilder("resourceRemove_args("); + StringBuilder sb = new StringBuilder("resourceInvokeMethod_args("); boolean first = true; sb.append("sessionKey:"); @@ -15948,6 +17954,14 @@ public String toString() { sb.append(this.resourceName); } first = false; + if (!first) sb.append(", "); + sb.append("invokeMessage:"); + if (this.invokeMessage == null) { + sb.append("null"); + } else { + sb.append(this.invokeMessage); + } + first = false; sb.append(")"); return sb.toString(); } @@ -15973,15 +17987,15 @@ private void readObject(java.io.ObjectInputStream in) throws java.io.IOException } } - private static class resourceRemove_argsStandardSchemeFactory implements SchemeFactory { - public resourceRemove_argsStandardScheme getScheme() { - return new resourceRemove_argsStandardScheme(); + private static class resourceInvokeMethod_argsStandardSchemeFactory implements SchemeFactory { + public resourceInvokeMethod_argsStandardScheme getScheme() { + return new resourceInvokeMethod_argsStandardScheme(); } } - private static class resourceRemove_argsStandardScheme extends StandardScheme { + private static class resourceInvokeMethod_argsStandardScheme extends StandardScheme { - public void read(org.apache.thrift.protocol.TProtocol iprot, resourceRemove_args struct) throws org.apache.thrift.TException { + public void read(org.apache.thrift.protocol.TProtocol iprot, resourceInvokeMethod_args struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TField schemeField; iprot.readStructBegin(); while (true) @@ -16015,6 +18029,14 @@ public void read(org.apache.thrift.protocol.TProtocol iprot, resourceRemove_args org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; + case 4: // INVOKE_MESSAGE + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.invokeMessage = iprot.readString(); + struct.setInvokeMessageIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; default: org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } @@ -16026,7 +18048,7 @@ public void read(org.apache.thrift.protocol.TProtocol iprot, resourceRemove_args struct.validate(); } - public void write(org.apache.thrift.protocol.TProtocol oprot, resourceRemove_args struct) throws org.apache.thrift.TException { + public void write(org.apache.thrift.protocol.TProtocol oprot, resourceInvokeMethod_args struct) throws org.apache.thrift.TException { struct.validate(); oprot.writeStructBegin(STRUCT_DESC); @@ -16045,22 +18067,27 @@ public void write(org.apache.thrift.protocol.TProtocol oprot, resourceRemove_arg oprot.writeString(struct.resourceName); oprot.writeFieldEnd(); } + if (struct.invokeMessage != null) { + oprot.writeFieldBegin(INVOKE_MESSAGE_FIELD_DESC); + oprot.writeString(struct.invokeMessage); + oprot.writeFieldEnd(); + } oprot.writeFieldStop(); oprot.writeStructEnd(); } } - private static class resourceRemove_argsTupleSchemeFactory implements SchemeFactory { - public resourceRemove_argsTupleScheme getScheme() { - return new resourceRemove_argsTupleScheme(); + private static class resourceInvokeMethod_argsTupleSchemeFactory implements SchemeFactory { + public resourceInvokeMethod_argsTupleScheme getScheme() { + return new resourceInvokeMethod_argsTupleScheme(); } } - private static class resourceRemove_argsTupleScheme extends TupleScheme { + private static class resourceInvokeMethod_argsTupleScheme extends TupleScheme { @Override - public void write(org.apache.thrift.protocol.TProtocol prot, resourceRemove_args struct) throws org.apache.thrift.TException { + public void write(org.apache.thrift.protocol.TProtocol prot, resourceInvokeMethod_args struct) throws org.apache.thrift.TException { TTupleProtocol oprot = (TTupleProtocol) prot; BitSet optionals = new BitSet(); if (struct.isSetSessionKey()) { @@ -16072,7 +18099,10 @@ public void write(org.apache.thrift.protocol.TProtocol prot, resourceRemove_args if (struct.isSetResourceName()) { optionals.set(2); } - oprot.writeBitSet(optionals, 3); + if (struct.isSetInvokeMessage()) { + optionals.set(3); + } + oprot.writeBitSet(optionals, 4); if (struct.isSetSessionKey()) { oprot.writeString(struct.sessionKey); } @@ -16082,12 +18112,15 @@ public void write(org.apache.thrift.protocol.TProtocol prot, resourceRemove_args if (struct.isSetResourceName()) { oprot.writeString(struct.resourceName); } + if (struct.isSetInvokeMessage()) { + oprot.writeString(struct.invokeMessage); + } } @Override - public void read(org.apache.thrift.protocol.TProtocol prot, resourceRemove_args struct) throws org.apache.thrift.TException { + public void read(org.apache.thrift.protocol.TProtocol prot, resourceInvokeMethod_args struct) throws org.apache.thrift.TException { TTupleProtocol iprot = (TTupleProtocol) prot; - BitSet incoming = iprot.readBitSet(3); + BitSet incoming = iprot.readBitSet(4); if (incoming.get(0)) { struct.sessionKey = iprot.readString(); struct.setSessionKeyIsSet(true); @@ -16100,23 +18133,27 @@ public void read(org.apache.thrift.protocol.TProtocol prot, resourceRemove_args struct.resourceName = iprot.readString(); struct.setResourceNameIsSet(true); } + if (incoming.get(3)) { + struct.invokeMessage = iprot.readString(); + struct.setInvokeMessageIsSet(true); + } } } } - public static class resourceRemove_result implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("resourceRemove_result"); + public static class resourceInvokeMethod_result implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("resourceInvokeMethod_result"); - private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.BOOL, (short)0); + private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.STRING, (short)0); private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); static { - schemes.put(StandardScheme.class, new resourceRemove_resultStandardSchemeFactory()); - schemes.put(TupleScheme.class, new resourceRemove_resultTupleSchemeFactory()); + schemes.put(StandardScheme.class, new resourceInvokeMethod_resultStandardSchemeFactory()); + schemes.put(TupleScheme.class, new resourceInvokeMethod_resultTupleSchemeFactory()); } - public boolean success; // required + public ByteBuffer success; // 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 { @@ -16177,67 +18214,75 @@ public String getFieldName() { } // isset id assignments - private static final int __SUCCESS_ISSET_ID = 0; - private byte __isset_bitfield = 0; 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.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BOOL))); + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING , true))); metaDataMap = Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(resourceRemove_result.class, metaDataMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(resourceInvokeMethod_result.class, metaDataMap); } - public resourceRemove_result() { + public resourceInvokeMethod_result() { } - public resourceRemove_result( - boolean success) + public resourceInvokeMethod_result( + ByteBuffer success) { this(); - this.success = success; - setSuccessIsSet(true); + this.success = org.apache.thrift.TBaseHelper.copyBinary(success); } /** * Performs a deep copy on other. */ - public resourceRemove_result(resourceRemove_result other) { - __isset_bitfield = other.__isset_bitfield; - this.success = other.success; + public resourceInvokeMethod_result(resourceInvokeMethod_result other) { + if (other.isSetSuccess()) { + this.success = org.apache.thrift.TBaseHelper.copyBinary(other.success); + } } - public resourceRemove_result deepCopy() { - return new resourceRemove_result(this); + public resourceInvokeMethod_result deepCopy() { + return new resourceInvokeMethod_result(this); } @Override public void clear() { - setSuccessIsSet(false); - this.success = false; + this.success = null; } - public boolean isSuccess() { - return this.success; + public byte[] getSuccess() { + setSuccess(org.apache.thrift.TBaseHelper.rightSize(success)); + return success == null ? null : success.array(); } - public resourceRemove_result setSuccess(boolean success) { - this.success = success; - setSuccessIsSet(true); + public ByteBuffer bufferForSuccess() { + return org.apache.thrift.TBaseHelper.copyBinary(success); + } + + public resourceInvokeMethod_result setSuccess(byte[] success) { + this.success = success == null ? (ByteBuffer)null : ByteBuffer.wrap(Arrays.copyOf(success, success.length)); + return this; + } + + public resourceInvokeMethod_result setSuccess(ByteBuffer success) { + this.success = org.apache.thrift.TBaseHelper.copyBinary(success); return this; } public void unsetSuccess() { - __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __SUCCESS_ISSET_ID); + this.success = null; } /** Returns true if field success is set (has been assigned a value) and false otherwise */ public boolean isSetSuccess() { - return EncodingUtils.testBit(__isset_bitfield, __SUCCESS_ISSET_ID); + return this.success != null; } public void setSuccessIsSet(boolean value) { - __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __SUCCESS_ISSET_ID, value); + if (!value) { + this.success = null; + } } public void setFieldValue(_Fields field, Object value) { @@ -16246,7 +18291,7 @@ public void setFieldValue(_Fields field, Object value) { if (value == null) { unsetSuccess(); } else { - setSuccess((Boolean)value); + setSuccess((ByteBuffer)value); } break; @@ -16256,7 +18301,7 @@ public void setFieldValue(_Fields field, Object value) { public Object getFieldValue(_Fields field) { switch (field) { case SUCCESS: - return Boolean.valueOf(isSuccess()); + return getSuccess(); } throw new IllegalStateException(); @@ -16279,21 +18324,21 @@ public boolean isSet(_Fields field) { public boolean equals(Object that) { if (that == null) return false; - if (that instanceof resourceRemove_result) - return this.equals((resourceRemove_result)that); + if (that instanceof resourceInvokeMethod_result) + return this.equals((resourceInvokeMethod_result)that); return false; } - public boolean equals(resourceRemove_result that) { + public boolean equals(resourceInvokeMethod_result that) { if (that == null) return false; - boolean this_present_success = true; - boolean that_present_success = true; + boolean this_present_success = true && this.isSetSuccess(); + boolean that_present_success = true && that.isSetSuccess(); if (this_present_success || that_present_success) { if (!(this_present_success && that_present_success)) return false; - if (this.success != that.success) + if (!this.success.equals(that.success)) return false; } @@ -16304,7 +18349,7 @@ public boolean equals(resourceRemove_result that) { public int hashCode() { List list = new ArrayList(); - boolean present_success = true; + boolean present_success = true && (isSetSuccess()); list.add(present_success); if (present_success) list.add(success); @@ -16313,7 +18358,7 @@ public int hashCode() { } @Override - public int compareTo(resourceRemove_result other) { + public int compareTo(resourceInvokeMethod_result other) { if (!getClass().equals(other.getClass())) { return getClass().getName().compareTo(other.getClass().getName()); } @@ -16347,11 +18392,15 @@ public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache. @Override public String toString() { - StringBuilder sb = new StringBuilder("resourceRemove_result("); + StringBuilder sb = new StringBuilder("resourceInvokeMethod_result("); boolean first = true; sb.append("success:"); - sb.append(this.success); + if (this.success == null) { + sb.append("null"); + } else { + org.apache.thrift.TBaseHelper.toString(this.success, sb); + } first = false; sb.append(")"); return sb.toString(); @@ -16372,23 +18421,21 @@ private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOExcept private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { try { - // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor. - __isset_bitfield = 0; read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); } catch (org.apache.thrift.TException te) { throw new java.io.IOException(te); } } - private static class resourceRemove_resultStandardSchemeFactory implements SchemeFactory { - public resourceRemove_resultStandardScheme getScheme() { - return new resourceRemove_resultStandardScheme(); + private static class resourceInvokeMethod_resultStandardSchemeFactory implements SchemeFactory { + public resourceInvokeMethod_resultStandardScheme getScheme() { + return new resourceInvokeMethod_resultStandardScheme(); } } - private static class resourceRemove_resultStandardScheme extends StandardScheme { + private static class resourceInvokeMethod_resultStandardScheme extends StandardScheme { - public void read(org.apache.thrift.protocol.TProtocol iprot, resourceRemove_result struct) throws org.apache.thrift.TException { + public void read(org.apache.thrift.protocol.TProtocol iprot, resourceInvokeMethod_result struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TField schemeField; iprot.readStructBegin(); while (true) @@ -16399,8 +18446,8 @@ public void read(org.apache.thrift.protocol.TProtocol iprot, resourceRemove_resu } switch (schemeField.id) { case 0: // SUCCESS - if (schemeField.type == org.apache.thrift.protocol.TType.BOOL) { - struct.success = iprot.readBool(); + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.success = iprot.readBinary(); struct.setSuccessIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); @@ -16417,13 +18464,13 @@ public void read(org.apache.thrift.protocol.TProtocol iprot, resourceRemove_resu struct.validate(); } - public void write(org.apache.thrift.protocol.TProtocol oprot, resourceRemove_result struct) throws org.apache.thrift.TException { + public void write(org.apache.thrift.protocol.TProtocol oprot, resourceInvokeMethod_result struct) throws org.apache.thrift.TException { struct.validate(); oprot.writeStructBegin(STRUCT_DESC); - if (struct.isSetSuccess()) { + if (struct.success != null) { oprot.writeFieldBegin(SUCCESS_FIELD_DESC); - oprot.writeBool(struct.success); + oprot.writeBinary(struct.success); oprot.writeFieldEnd(); } oprot.writeFieldStop(); @@ -16432,16 +18479,16 @@ public void write(org.apache.thrift.protocol.TProtocol oprot, resourceRemove_res } - private static class resourceRemove_resultTupleSchemeFactory implements SchemeFactory { - public resourceRemove_resultTupleScheme getScheme() { - return new resourceRemove_resultTupleScheme(); + private static class resourceInvokeMethod_resultTupleSchemeFactory implements SchemeFactory { + public resourceInvokeMethod_resultTupleScheme getScheme() { + return new resourceInvokeMethod_resultTupleScheme(); } } - private static class resourceRemove_resultTupleScheme extends TupleScheme { + private static class resourceInvokeMethod_resultTupleScheme extends TupleScheme { @Override - public void write(org.apache.thrift.protocol.TProtocol prot, resourceRemove_result struct) throws org.apache.thrift.TException { + public void write(org.apache.thrift.protocol.TProtocol prot, resourceInvokeMethod_result struct) throws org.apache.thrift.TException { TTupleProtocol oprot = (TTupleProtocol) prot; BitSet optionals = new BitSet(); if (struct.isSetSuccess()) { @@ -16449,16 +18496,16 @@ public void write(org.apache.thrift.protocol.TProtocol prot, resourceRemove_resu } oprot.writeBitSet(optionals, 1); if (struct.isSetSuccess()) { - oprot.writeBool(struct.success); + oprot.writeBinary(struct.success); } } @Override - public void read(org.apache.thrift.protocol.TProtocol prot, resourceRemove_result struct) throws org.apache.thrift.TException { + public void read(org.apache.thrift.protocol.TProtocol prot, resourceInvokeMethod_result struct) throws org.apache.thrift.TException { TTupleProtocol iprot = (TTupleProtocol) prot; BitSet incoming = iprot.readBitSet(1); if (incoming.get(0)) { - struct.success = iprot.readBool(); + struct.success = iprot.readBinary(); struct.setSuccessIsSet(true); } } diff --git a/zeppelin-interpreter/src/main/java/org/apache/zeppelin/interpreter/thrift/ZeppelinServerResourceParagraphRunner.java b/zeppelin-interpreter/src/main/java/org/apache/zeppelin/interpreter/thrift/ZeppelinServerResourceParagraphRunner.java index 197a1351440..74cb25d7d96 100644 --- a/zeppelin-interpreter/src/main/java/org/apache/zeppelin/interpreter/thrift/ZeppelinServerResourceParagraphRunner.java +++ b/zeppelin-interpreter/src/main/java/org/apache/zeppelin/interpreter/thrift/ZeppelinServerResourceParagraphRunner.java @@ -51,7 +51,7 @@ import org.slf4j.LoggerFactory; @SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"}) -@Generated(value = "Autogenerated by Thrift Compiler (0.9.2)", date = "2016-11-29") +@Generated(value = "Autogenerated by Thrift Compiler (0.9.2)", date = "2017-1-25") public class ZeppelinServerResourceParagraphRunner implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("ZeppelinServerResourceParagraphRunner"); diff --git a/zeppelin-interpreter/src/main/java/org/apache/zeppelin/resource/LocalResourcePool.java b/zeppelin-interpreter/src/main/java/org/apache/zeppelin/resource/LocalResourcePool.java index ef269e41a1d..5a0193c01cd 100644 --- a/zeppelin-interpreter/src/main/java/org/apache/zeppelin/resource/LocalResourcePool.java +++ b/zeppelin-interpreter/src/main/java/org/apache/zeppelin/resource/LocalResourcePool.java @@ -72,7 +72,7 @@ public ResourceSet getAll() { public void put(String name, Object object) { ResourceId resourceId = new ResourceId(resourcePoolId, name); - Resource resource = new Resource(resourceId, object); + Resource resource = new Resource(this, resourceId, object); resources.put(resourceId, resource); } @@ -80,7 +80,7 @@ public void put(String name, Object object) { public void put(String noteId, String paragraphId, String name, Object object) { ResourceId resourceId = new ResourceId(resourcePoolId, noteId, paragraphId, name); - Resource resource = new Resource(resourceId, object); + Resource resource = new Resource(this, resourceId, object); resources.put(resourceId, resource); } diff --git a/zeppelin-interpreter/src/main/java/org/apache/zeppelin/resource/RemoteResource.java b/zeppelin-interpreter/src/main/java/org/apache/zeppelin/resource/RemoteResource.java index 5a8a9ea11f3..63422311940 100644 --- a/zeppelin-interpreter/src/main/java/org/apache/zeppelin/resource/RemoteResource.java +++ b/zeppelin-interpreter/src/main/java/org/apache/zeppelin/resource/RemoteResource.java @@ -23,11 +23,11 @@ public class RemoteResource extends Resource { ResourcePoolConnector resourcePoolConnector; RemoteResource(ResourceId resourceId, Object r) { - super(resourceId, r); + super(null, resourceId, r); } RemoteResource(ResourceId resourceId, boolean serializable, String className) { - super(resourceId, serializable, className); + super(null, resourceId, serializable, className); } @Override @@ -52,4 +52,43 @@ public ResourcePoolConnector getResourcePoolConnector() { public void setResourcePoolConnector(ResourcePoolConnector resourcePoolConnector) { this.resourcePoolConnector = resourcePoolConnector; } + + /** + * Call a method of the object that this remote resource holds + * @param methodName name of method to call + * @param paramTypes method parameter types + * @param params method parameter values + * @return return value of the method. Null if return value is not serializable + */ + @Override + public Object invokeMethod( + String methodName, Class [] paramTypes, Object [] params) { + ResourceId resourceId = getResourceId(); + return resourcePoolConnector.invokeMethod( + resourceId, + methodName, + paramTypes, + params); + } + + /** + * Call a method of the object that this remote resource holds and save return value as a resource + * @param methodName name of method to call + * @param paramTypes method parameter types + * @param params method parameter values + * @param returnResourceName name of resource that return value will be saved + * @return Resource that holds return value. + */ + @Override + public Resource invokeMethod( + String methodName, Class [] paramTypes, Object [] params, String returnResourceName) { + ResourceId resourceId = getResourceId(); + Resource resource = resourcePoolConnector.invokeMethod( + resourceId, + methodName, + paramTypes, + params, + returnResourceName); + return resource; + } } diff --git a/zeppelin-interpreter/src/main/java/org/apache/zeppelin/resource/Resource.java b/zeppelin-interpreter/src/main/java/org/apache/zeppelin/resource/Resource.java index 6988b3ea762..a478c42ba0f 100644 --- a/zeppelin-interpreter/src/main/java/org/apache/zeppelin/resource/Resource.java +++ b/zeppelin-interpreter/src/main/java/org/apache/zeppelin/resource/Resource.java @@ -16,7 +16,11 @@ */ package org.apache.zeppelin.resource; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + import java.io.*; +import java.lang.reflect.Method; import java.nio.ByteBuffer; /** @@ -24,6 +28,7 @@ */ public class Resource { private final transient Object r; + private final transient LocalResourcePool pool; private final boolean serializable; private final ResourceId resourceId; private final String className; @@ -31,11 +36,13 @@ public class Resource { /** * Create local resource + * * @param resourceId - * @param r must not be null + * @param r must not be null */ - Resource(ResourceId resourceId, Object r) { + Resource(LocalResourcePool pool, ResourceId resourceId, Object r) { this.r = r; + this.pool = pool; this.resourceId = resourceId; this.serializable = r instanceof Serializable; this.className = r.getClass().getName(); @@ -43,10 +50,12 @@ public class Resource { /** * Create remote object + * * @param resourceId */ - Resource(ResourceId resourceId, boolean serializable, String className) { + Resource(LocalResourcePool pool, ResourceId resourceId, boolean serializable, String className) { this.r = null; + this.pool = pool; this.resourceId = resourceId; this.serializable = serializable; this.className = className; @@ -61,11 +70,10 @@ public String getClassName() { } /** - * * @return null when this is remote resource and not serializable. */ public Object get() { - if (isLocal() || isSerializable()){ + if (isLocal() || isSerializable()) { return r; } else { return null; @@ -78,6 +86,7 @@ public boolean isSerializable() { /** * if it is remote object + * * @return */ public boolean isRemote() { @@ -86,6 +95,7 @@ public boolean isRemote() { /** * Whether it is locally accessible or not + * * @return */ public boolean isLocal() { @@ -93,6 +103,65 @@ public boolean isLocal() { } + /** + * Call a method of the object that this resource holds + * @param methodName name of method to call + * @param paramTypes method parameter types + * @param params method parameter values + * @return return value of the method + */ + public Object invokeMethod( + String methodName, Class [] paramTypes, Object [] params) { + if (r != null) { + try { + Method method = r.getClass().getMethod( + methodName, + paramTypes); + Object ret = method.invoke(r, params); + return ret; + } catch (Exception e) { + logException(e); + return null; + } + } else { + return null; + } + } + + /** + * Call a method of the object that this resource holds and save return value as a resource + * @param methodName name of method to call + * @param paramTypes method parameter types + * @param params method parameter values + * @param returnResourceName name of resource that return value will be saved + * @return Resource that holds return value + */ + public Resource invokeMethod( + String methodName, Class [] paramTypes, Object [] params, String returnResourceName) { + if (r != null) { + try { + Method method = r.getClass().getMethod( + methodName, + paramTypes); + Object ret = method.invoke(r, params); + pool.put( + resourceId.getNoteId(), + resourceId.getParagraphId(), + returnResourceName, + ret + ); + return pool.get( + resourceId.getNoteId(), + resourceId.getParagraphId(), + returnResourceName); + } catch (Exception e) { + logException(e); + return null; + } + } else { + return null; + } + } public static ByteBuffer serializeObject(Object o) throws IOException { if (o == null || !(o instanceof Serializable)) { @@ -129,4 +198,8 @@ public static Object deserializeObject(ByteBuffer buf) return object; } + private void logException(Exception e) { + Logger logger = LoggerFactory.getLogger(Resource.class); + logger.error(e.getMessage(), e); + } } diff --git a/zeppelin-interpreter/src/main/java/org/apache/zeppelin/resource/ResourcePoolConnector.java b/zeppelin-interpreter/src/main/java/org/apache/zeppelin/resource/ResourcePoolConnector.java index af343db6b14..f270d920681 100644 --- a/zeppelin-interpreter/src/main/java/org/apache/zeppelin/resource/ResourcePoolConnector.java +++ b/zeppelin-interpreter/src/main/java/org/apache/zeppelin/resource/ResourcePoolConnector.java @@ -31,4 +31,24 @@ public interface ResourcePoolConnector { * @return */ public Object readResource(ResourceId id); + + /** + * Invoke method of Resource and get return + * @return + */ + public Object invokeMethod( + ResourceId id, + String methodName, + Class[] paramTypes, + Object[] params); + + /** + * Invoke method, put result into resource pool and return + */ + public Resource invokeMethod( + ResourceId id, + String methodName, + Class[] paramTypes, + Object[] params, + String returnResourceName); } diff --git a/zeppelin-interpreter/src/main/thrift/RemoteInterpreterService.thrift b/zeppelin-interpreter/src/main/thrift/RemoteInterpreterService.thrift index 50a5eb7f2e3..08a15ad9702 100644 --- a/zeppelin-interpreter/src/main/thrift/RemoteInterpreterService.thrift +++ b/zeppelin-interpreter/src/main/thrift/RemoteInterpreterService.thrift @@ -55,7 +55,8 @@ enum RemoteInterpreterEventType { ANGULAR_REGISTRY_PUSH = 11, APP_STATUS_UPDATE = 12, META_INFOS = 13, - REMOTE_ZEPPELIN_SERVER_RESOURCE = 14 + REMOTE_ZEPPELIN_SERVER_RESOURCE = 14, + RESOURCE_INVOKE_METHOD = 15 } @@ -105,12 +106,16 @@ service RemoteInterpreterService { void resourcePoolResponseGetAll(1: list resources); // as a response, ZeppelinServer send serialized value of resource void resourceResponseGet(1: string resourceId, 2: binary object); + // as a response, ZeppelinServer send return object + void resourceResponseInvokeMethod(1: string invokeMessage, 2: binary object); // get all resources in the interpreter process list resourcePoolGetAll(); // get value of resource binary resourceGet(1: string sessionKey, 2: string paragraphId, 3: string resourceName); // remove resource bool resourceRemove(1: string sessionKey, 2: string paragraphId, 3:string resourceName); + // invoke method on resource + binary resourceInvokeMethod(1: string sessionKey, 2: string paragraphId, 3:string resourceName, 4:string invokeMessage); void angularObjectUpdate(1: string name, 2: string sessionKey, 3: string paragraphId, 4: string object); diff --git a/zeppelin-interpreter/src/test/java/org/apache/zeppelin/interpreter/remote/mock/MockInterpreterResourcePool.java b/zeppelin-interpreter/src/test/java/org/apache/zeppelin/interpreter/remote/mock/MockInterpreterResourcePool.java index e49306d22a7..80ac5555baa 100644 --- a/zeppelin-interpreter/src/test/java/org/apache/zeppelin/interpreter/remote/mock/MockInterpreterResourcePool.java +++ b/zeppelin-interpreter/src/test/java/org/apache/zeppelin/interpreter/remote/mock/MockInterpreterResourcePool.java @@ -68,7 +68,7 @@ public InterpreterResult interpret(String st, InterpreterContext context) { String name = null; if (stmt.length >= 2) { String[] npn = stmt[1].split(":"); - if (npn.length == 3) { + if (npn.length >= 3) { noteId = npn[0]; paragraphId = npn[1]; name = npn[2]; @@ -77,7 +77,7 @@ public InterpreterResult interpret(String st, InterpreterContext context) { } } String value = null; - if (stmt.length == 3) { + if (stmt.length >= 3) { value = stmt[2]; } @@ -96,6 +96,14 @@ public InterpreterResult interpret(String st, InterpreterContext context) { ret = resourcePool.remove(noteId, paragraphId, name); } else if (cmd.equals("getAll")) { ret = resourcePool.getAll(); + } else if (cmd.equals("invoke")) { + Resource resource = resourcePool.get(noteId, paragraphId, name); + if (stmt.length >=4) { + Resource res = resource.invokeMethod(value, null, null, stmt[3]); + ret = res.get(); + } else { + ret = resource.invokeMethod(value, null, null); + } } try { diff --git a/zeppelin-interpreter/src/test/java/org/apache/zeppelin/resource/DistributedResourcePoolTest.java b/zeppelin-interpreter/src/test/java/org/apache/zeppelin/resource/DistributedResourcePoolTest.java index 80950439115..363ccf627bb 100644 --- a/zeppelin-interpreter/src/test/java/org/apache/zeppelin/resource/DistributedResourcePoolTest.java +++ b/zeppelin-interpreter/src/test/java/org/apache/zeppelin/resource/DistributedResourcePoolTest.java @@ -190,6 +190,17 @@ public Object readResource(ResourceId id) { } return null; } + + @Override + public Object invokeMethod(ResourceId id, String methodName, Class[] paramTypes, Object[] params) { + return null; + } + + @Override + public Resource invokeMethod(ResourceId id, String methodName, Class[] paramTypes, Object[] + params, String returnResourceName) { + return null; + } }); assertEquals(0, pool1.getAll().size()); @@ -249,4 +260,44 @@ public void testResourcePoolUtils() { String.class)); } + + @Test + public void testResourceInvokeMethod() { + Gson gson = new Gson(); + InterpreterResult ret; + intp1.interpret("put key1 hey", context); + intp2.interpret("put key2 world", context); + + // invoke method in local resource pool + ret = intp1.interpret("invoke key1 length", context); + assertEquals("3", ret.message().get(0).getData()); + + // invoke method in remote resource pool + ret = intp1.interpret("invoke key2 length", context); + assertEquals("5", ret.message().get(0).getData()); + + // make sure no resources are automatically created + ret = intp1.interpret("getAll", context); + assertEquals(2, gson.fromJson(ret.message().get(0).getData(), ResourceSet.class).size()); + + // invoke method in local resource pool and save result + ret = intp1.interpret("invoke key1 length ret1", context); + assertEquals("3", ret.message().get(0).getData()); + + ret = intp1.interpret("getAll", context); + assertEquals(3, gson.fromJson(ret.message().get(0).getData(), ResourceSet.class).size()); + + ret = intp1.interpret("get ret1", context); + assertEquals("3", gson.fromJson(ret.message().get(0).getData(), String.class)); + + // invoke method in remote resource pool and save result + ret = intp1.interpret("invoke key2 length ret2", context); + assertEquals("5", ret.message().get(0).getData()); + + ret = intp1.interpret("getAll", context); + assertEquals(4, gson.fromJson(ret.message().get(0).getData(), ResourceSet.class).size()); + + ret = intp1.interpret("get ret2", context); + assertEquals("5", gson.fromJson(ret.message().get(0).getData(), String.class)); + } } diff --git a/zeppelin-interpreter/src/test/java/org/apache/zeppelin/resource/ResourceSetTest.java b/zeppelin-interpreter/src/test/java/org/apache/zeppelin/resource/ResourceSetTest.java index ca645250e24..cc1cad19119 100644 --- a/zeppelin-interpreter/src/test/java/org/apache/zeppelin/resource/ResourceSetTest.java +++ b/zeppelin-interpreter/src/test/java/org/apache/zeppelin/resource/ResourceSetTest.java @@ -29,8 +29,8 @@ public class ResourceSetTest { public void testFilterByName() { ResourceSet set = new ResourceSet(); - set.add(new Resource(new ResourceId("poo1", "resource1"), "value1")); - set.add(new Resource(new ResourceId("poo1", "resource2"), new Integer(2))); + set.add(new Resource(null, new ResourceId("poo1", "resource1"), "value1")); + set.add(new Resource(null, new ResourceId("poo1", "resource2"), new Integer(2))); assertEquals(2, set.filterByNameRegex(".*").size()); assertEquals(1, set.filterByNameRegex("resource1").size()); assertEquals(1, set.filterByNameRegex("resource2").size()); @@ -42,8 +42,8 @@ public void testFilterByName() { public void testFilterByClassName() { ResourceSet set = new ResourceSet(); - set.add(new Resource(new ResourceId("poo1", "resource1"), "value1")); - set.add(new Resource(new ResourceId("poo1", "resource2"), new Integer(2))); + set.add(new Resource(null, new ResourceId("poo1", "resource1"), "value1")); + set.add(new Resource(null, new ResourceId("poo1", "resource2"), new Integer(2))); assertEquals(1, set.filterByClassnameRegex(".*String").size()); assertEquals(1, set.filterByClassnameRegex(String.class.getName()).size());