http://git-wip-us.apache.org/repos/asf/zeppelin/blob/0d746fa2/zeppelin-interpreter/src/main/java/org/apache/zeppelin/interpreter/thrift/RemoteInterpreterContext.java ---------------------------------------------------------------------- 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 96e201a..f1f36fc 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 @@ -1,89 +1,73 @@ /** - * 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 + * 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 * - * <p>http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * - * <p>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 + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and * limitations under the License. */ /** * Autogenerated by Thrift Compiler (0.9.2) * - * <p>DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING - * - * @generated + * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING + * @generated */ package org.apache.zeppelin.interpreter.thrift; -import java.util.ArrayList; -import java.util.BitSet; -import java.util.Collections; -import java.util.EnumMap; -import java.util.EnumSet; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import javax.annotation.Generated; -import org.apache.thrift.protocol.TTupleProtocol; import org.apache.thrift.scheme.IScheme; import org.apache.thrift.scheme.SchemeFactory; import org.apache.thrift.scheme.StandardScheme; + import org.apache.thrift.scheme.TupleScheme; +import org.apache.thrift.protocol.TTupleProtocol; +import org.apache.thrift.protocol.TProtocolException; +import org.apache.thrift.EncodingUtils; +import org.apache.thrift.TException; +import org.apache.thrift.async.AsyncMethodCallback; import org.apache.thrift.server.AbstractNonblockingServer.*; +import java.util.List; +import java.util.ArrayList; +import java.util.Map; +import java.util.HashMap; +import java.util.EnumMap; +import java.util.Set; +import java.util.HashSet; +import java.util.EnumSet; +import java.util.Collections; +import java.util.BitSet; +import java.nio.ByteBuffer; +import java.util.Arrays; +import javax.annotation.Generated; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; @SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"}) @Generated(value = "Autogenerated by Thrift Compiler (0.9.2)", date = "2018-8-9") -public class RemoteInterpreterContext - implements org.apache.thrift.TBase<RemoteInterpreterContext, RemoteInterpreterContext._Fields>, - java.io.Serializable, - Cloneable, - Comparable<RemoteInterpreterContext> { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = - new org.apache.thrift.protocol.TStruct("RemoteInterpreterContext"); - - private static final org.apache.thrift.protocol.TField NOTE_ID_FIELD_DESC = - new org.apache.thrift.protocol.TField( - "noteId", org.apache.thrift.protocol.TType.STRING, (short) 1); - private static final org.apache.thrift.protocol.TField NOTE_NAME_FIELD_DESC = - new org.apache.thrift.protocol.TField( - "noteName", org.apache.thrift.protocol.TType.STRING, (short) 2); - 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) 3); - private static final org.apache.thrift.protocol.TField REPL_NAME_FIELD_DESC = - new org.apache.thrift.protocol.TField( - "replName", org.apache.thrift.protocol.TType.STRING, (short) 4); - private static final org.apache.thrift.protocol.TField PARAGRAPH_TITLE_FIELD_DESC = - new org.apache.thrift.protocol.TField( - "paragraphTitle", org.apache.thrift.protocol.TType.STRING, (short) 5); - private static final org.apache.thrift.protocol.TField PARAGRAPH_TEXT_FIELD_DESC = - new org.apache.thrift.protocol.TField( - "paragraphText", org.apache.thrift.protocol.TType.STRING, (short) 6); - private static final org.apache.thrift.protocol.TField AUTHENTICATION_INFO_FIELD_DESC = - new org.apache.thrift.protocol.TField( - "authenticationInfo", org.apache.thrift.protocol.TType.STRING, (short) 7); - private static final org.apache.thrift.protocol.TField CONFIG_FIELD_DESC = - new org.apache.thrift.protocol.TField( - "config", org.apache.thrift.protocol.TType.STRING, (short) 8); - private static final org.apache.thrift.protocol.TField GUI_FIELD_DESC = - new org.apache.thrift.protocol.TField( - "gui", org.apache.thrift.protocol.TType.STRING, (short) 9); - private static final org.apache.thrift.protocol.TField NOTE_GUI_FIELD_DESC = - new org.apache.thrift.protocol.TField( - "noteGui", org.apache.thrift.protocol.TType.STRING, (short) 10); - private static final org.apache.thrift.protocol.TField LOCAL_PROPERTIES_FIELD_DESC = - new org.apache.thrift.protocol.TField( - "localProperties", org.apache.thrift.protocol.TType.MAP, (short) 11); - - private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = - new HashMap<Class<? extends IScheme>, SchemeFactory>(); - +public class RemoteInterpreterContext implements org.apache.thrift.TBase<RemoteInterpreterContext, RemoteInterpreterContext._Fields>, java.io.Serializable, Cloneable, Comparable<RemoteInterpreterContext> { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("RemoteInterpreterContext"); + + private static final org.apache.thrift.protocol.TField NOTE_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("noteId", org.apache.thrift.protocol.TType.STRING, (short)1); + private static final org.apache.thrift.protocol.TField NOTE_NAME_FIELD_DESC = new org.apache.thrift.protocol.TField("noteName", org.apache.thrift.protocol.TType.STRING, (short)2); + 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)3); + private static final org.apache.thrift.protocol.TField REPL_NAME_FIELD_DESC = new org.apache.thrift.protocol.TField("replName", org.apache.thrift.protocol.TType.STRING, (short)4); + private static final org.apache.thrift.protocol.TField PARAGRAPH_TITLE_FIELD_DESC = new org.apache.thrift.protocol.TField("paragraphTitle", org.apache.thrift.protocol.TType.STRING, (short)5); + private static final org.apache.thrift.protocol.TField PARAGRAPH_TEXT_FIELD_DESC = new org.apache.thrift.protocol.TField("paragraphText", org.apache.thrift.protocol.TType.STRING, (short)6); + private static final org.apache.thrift.protocol.TField AUTHENTICATION_INFO_FIELD_DESC = new org.apache.thrift.protocol.TField("authenticationInfo", org.apache.thrift.protocol.TType.STRING, (short)7); + private static final org.apache.thrift.protocol.TField CONFIG_FIELD_DESC = new org.apache.thrift.protocol.TField("config", org.apache.thrift.protocol.TType.STRING, (short)8); + private static final org.apache.thrift.protocol.TField GUI_FIELD_DESC = new org.apache.thrift.protocol.TField("gui", org.apache.thrift.protocol.TType.STRING, (short)9); + private static final org.apache.thrift.protocol.TField NOTE_GUI_FIELD_DESC = new org.apache.thrift.protocol.TField("noteGui", org.apache.thrift.protocol.TType.STRING, (short)10); + private static final org.apache.thrift.protocol.TField LOCAL_PROPERTIES_FIELD_DESC = new org.apache.thrift.protocol.TField("localProperties", org.apache.thrift.protocol.TType.MAP, (short)11); + + private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>(); static { schemes.put(StandardScheme.class, new RemoteInterpreterContextStandardSchemeFactory()); schemes.put(TupleScheme.class, new RemoteInterpreterContextTupleSchemeFactory()); @@ -99,24 +83,21 @@ public class RemoteInterpreterContext public String config; // required public String gui; // required public String noteGui; // required - public Map<String, String> localProperties; // required + public Map<String,String> localProperties; // required - /** - * The set of fields this struct contains, along with convenience methods for finding and - * manipulating them. - */ + /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ public enum _Fields implements org.apache.thrift.TFieldIdEnum { - NOTE_ID((short) 1, "noteId"), - NOTE_NAME((short) 2, "noteName"), - PARAGRAPH_ID((short) 3, "paragraphId"), - REPL_NAME((short) 4, "replName"), - PARAGRAPH_TITLE((short) 5, "paragraphTitle"), - PARAGRAPH_TEXT((short) 6, "paragraphText"), - AUTHENTICATION_INFO((short) 7, "authenticationInfo"), - CONFIG((short) 8, "config"), - GUI((short) 9, "gui"), - NOTE_GUI((short) 10, "noteGui"), - LOCAL_PROPERTIES((short) 11, "localProperties"); + NOTE_ID((short)1, "noteId"), + NOTE_NAME((short)2, "noteName"), + PARAGRAPH_ID((short)3, "paragraphId"), + REPL_NAME((short)4, "replName"), + PARAGRAPH_TITLE((short)5, "paragraphTitle"), + PARAGRAPH_TEXT((short)6, "paragraphText"), + AUTHENTICATION_INFO((short)7, "authenticationInfo"), + CONFIG((short)8, "config"), + GUI((short)9, "gui"), + NOTE_GUI((short)10, "noteGui"), + LOCAL_PROPERTIES((short)11, "localProperties"); private static final Map<String, _Fields> byName = new HashMap<String, _Fields>(); @@ -126,9 +107,11 @@ public class RemoteInterpreterContext } } - /** Find the _Fields constant that matches fieldId, or null if its not found. */ + /** + * Find the _Fields constant that matches fieldId, or null if its not found. + */ public static _Fields findByThriftId(int fieldId) { - switch (fieldId) { + switch(fieldId) { case 1: // NOTE_ID return NOTE_ID; case 2: // NOTE_NAME @@ -156,15 +139,19 @@ public class RemoteInterpreterContext } } - /** Find the _Fields constant that matches fieldId, throwing an exception if it is not found. */ + /** + * 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!"); + 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. */ + /** + * Find the _Fields constant that matches name, or null if its not found. + */ public static _Fields findByName(String name) { return byName.get(name); } @@ -188,110 +175,52 @@ public class RemoteInterpreterContext // 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.NOTE_ID, - new org.apache.thrift.meta_data.FieldMetaData( - "noteId", - org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.FieldValueMetaData( - org.apache.thrift.protocol.TType.STRING))); - tmpMap.put( - _Fields.NOTE_NAME, - new org.apache.thrift.meta_data.FieldMetaData( - "noteName", - 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.REPL_NAME, - new org.apache.thrift.meta_data.FieldMetaData( - "replName", - org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.FieldValueMetaData( - org.apache.thrift.protocol.TType.STRING))); - tmpMap.put( - _Fields.PARAGRAPH_TITLE, - new org.apache.thrift.meta_data.FieldMetaData( - "paragraphTitle", - org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.FieldValueMetaData( - org.apache.thrift.protocol.TType.STRING))); - tmpMap.put( - _Fields.PARAGRAPH_TEXT, - new org.apache.thrift.meta_data.FieldMetaData( - "paragraphText", - org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.FieldValueMetaData( - org.apache.thrift.protocol.TType.STRING))); - tmpMap.put( - _Fields.AUTHENTICATION_INFO, - new org.apache.thrift.meta_data.FieldMetaData( - "authenticationInfo", - org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.FieldValueMetaData( - org.apache.thrift.protocol.TType.STRING))); - tmpMap.put( - _Fields.CONFIG, - new org.apache.thrift.meta_data.FieldMetaData( - "config", - org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.FieldValueMetaData( - org.apache.thrift.protocol.TType.STRING))); - tmpMap.put( - _Fields.GUI, - new org.apache.thrift.meta_data.FieldMetaData( - "gui", - org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.FieldValueMetaData( - org.apache.thrift.protocol.TType.STRING))); - tmpMap.put( - _Fields.NOTE_GUI, - new org.apache.thrift.meta_data.FieldMetaData( - "noteGui", - org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.FieldValueMetaData( - org.apache.thrift.protocol.TType.STRING))); - tmpMap.put( - _Fields.LOCAL_PROPERTIES, - new org.apache.thrift.meta_data.FieldMetaData( - "localProperties", - org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.MapMetaData( - org.apache.thrift.protocol.TType.MAP, - 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)))); + Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); + tmpMap.put(_Fields.NOTE_ID, new org.apache.thrift.meta_data.FieldMetaData("noteId", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); + tmpMap.put(_Fields.NOTE_NAME, new org.apache.thrift.meta_data.FieldMetaData("noteName", 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.REPL_NAME, new org.apache.thrift.meta_data.FieldMetaData("replName", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); + tmpMap.put(_Fields.PARAGRAPH_TITLE, new org.apache.thrift.meta_data.FieldMetaData("paragraphTitle", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); + tmpMap.put(_Fields.PARAGRAPH_TEXT, new org.apache.thrift.meta_data.FieldMetaData("paragraphText", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); + tmpMap.put(_Fields.AUTHENTICATION_INFO, new org.apache.thrift.meta_data.FieldMetaData("authenticationInfo", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); + tmpMap.put(_Fields.CONFIG, new org.apache.thrift.meta_data.FieldMetaData("config", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); + tmpMap.put(_Fields.GUI, new org.apache.thrift.meta_data.FieldMetaData("gui", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); + tmpMap.put(_Fields.NOTE_GUI, new org.apache.thrift.meta_data.FieldMetaData("noteGui", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); + tmpMap.put(_Fields.LOCAL_PROPERTIES, new org.apache.thrift.meta_data.FieldMetaData("localProperties", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.MapMetaData(org.apache.thrift.protocol.TType.MAP, + 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)))); metaDataMap = Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap( - RemoteInterpreterContext.class, metaDataMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(RemoteInterpreterContext.class, metaDataMap); } - public RemoteInterpreterContext() {} + public RemoteInterpreterContext() { + } public RemoteInterpreterContext( - String noteId, - String noteName, - String paragraphId, - String replName, - String paragraphTitle, - String paragraphText, - String authenticationInfo, - String config, - String gui, - String noteGui, - Map<String, String> localProperties) { + String noteId, + String noteName, + String paragraphId, + String replName, + String paragraphTitle, + String paragraphText, + String authenticationInfo, + String config, + String gui, + String noteGui, + Map<String,String> localProperties) + { this(); this.noteId = noteId; this.noteName = noteName; @@ -306,7 +235,9 @@ public class RemoteInterpreterContext this.localProperties = localProperties; } - /** Performs a deep copy on <i>other</i>. */ + /** + * Performs a deep copy on <i>other</i>. + */ public RemoteInterpreterContext(RemoteInterpreterContext other) { if (other.isSetNoteId()) { this.noteId = other.noteId; @@ -339,8 +270,7 @@ public class RemoteInterpreterContext this.noteGui = other.noteGui; } if (other.isSetLocalProperties()) { - Map<String, String> __this__localProperties = - new HashMap<String, String>(other.localProperties); + Map<String,String> __this__localProperties = new HashMap<String,String>(other.localProperties); this.localProperties = __this__localProperties; } } @@ -521,9 +451,7 @@ public class RemoteInterpreterContext this.authenticationInfo = null; } - /** - * Returns true if field authenticationInfo is set (has been assigned a value) and false otherwise - */ + /** Returns true if field authenticationInfo is set (has been assigned a value) and false otherwise */ public boolean isSetAuthenticationInfo() { return this.authenticationInfo != null; } @@ -612,16 +540,16 @@ public class RemoteInterpreterContext public void putToLocalProperties(String key, String val) { if (this.localProperties == null) { - this.localProperties = new HashMap<String, String>(); + this.localProperties = new HashMap<String,String>(); } this.localProperties.put(key, val); } - public Map<String, String> getLocalProperties() { + public Map<String,String> getLocalProperties() { return this.localProperties; } - public RemoteInterpreterContext setLocalProperties(Map<String, String> localProperties) { + public RemoteInterpreterContext setLocalProperties(Map<String,String> localProperties) { this.localProperties = localProperties; return this; } @@ -630,9 +558,7 @@ public class RemoteInterpreterContext this.localProperties = null; } - /** - * Returns true if field localProperties is set (has been assigned a value) and false otherwise - */ + /** Returns true if field localProperties is set (has been assigned a value) and false otherwise */ public boolean isSetLocalProperties() { return this.localProperties != null; } @@ -645,256 +571,279 @@ public class RemoteInterpreterContext public void setFieldValue(_Fields field, Object value) { switch (field) { - case NOTE_ID: - if (value == null) { - unsetNoteId(); - } else { - setNoteId((String) value); - } - break; + case NOTE_ID: + if (value == null) { + unsetNoteId(); + } else { + setNoteId((String)value); + } + break; - case NOTE_NAME: - if (value == null) { - unsetNoteName(); - } else { - setNoteName((String) value); - } - break; + case NOTE_NAME: + if (value == null) { + unsetNoteName(); + } else { + setNoteName((String)value); + } + break; - case PARAGRAPH_ID: - if (value == null) { - unsetParagraphId(); - } else { - setParagraphId((String) value); - } - break; + case PARAGRAPH_ID: + if (value == null) { + unsetParagraphId(); + } else { + setParagraphId((String)value); + } + break; - case REPL_NAME: - if (value == null) { - unsetReplName(); - } else { - setReplName((String) value); - } - break; + case REPL_NAME: + if (value == null) { + unsetReplName(); + } else { + setReplName((String)value); + } + break; - case PARAGRAPH_TITLE: - if (value == null) { - unsetParagraphTitle(); - } else { - setParagraphTitle((String) value); - } - break; + case PARAGRAPH_TITLE: + if (value == null) { + unsetParagraphTitle(); + } else { + setParagraphTitle((String)value); + } + break; - case PARAGRAPH_TEXT: - if (value == null) { - unsetParagraphText(); - } else { - setParagraphText((String) value); - } - break; + case PARAGRAPH_TEXT: + if (value == null) { + unsetParagraphText(); + } else { + setParagraphText((String)value); + } + break; - case AUTHENTICATION_INFO: - if (value == null) { - unsetAuthenticationInfo(); - } else { - setAuthenticationInfo((String) value); - } - break; + case AUTHENTICATION_INFO: + if (value == null) { + unsetAuthenticationInfo(); + } else { + setAuthenticationInfo((String)value); + } + break; - case CONFIG: - if (value == null) { - unsetConfig(); - } else { - setConfig((String) value); - } - break; + case CONFIG: + if (value == null) { + unsetConfig(); + } else { + setConfig((String)value); + } + break; - case GUI: - if (value == null) { - unsetGui(); - } else { - setGui((String) value); - } - break; + case GUI: + if (value == null) { + unsetGui(); + } else { + setGui((String)value); + } + break; - case NOTE_GUI: - if (value == null) { - unsetNoteGui(); - } else { - setNoteGui((String) value); - } - break; + case NOTE_GUI: + if (value == null) { + unsetNoteGui(); + } else { + setNoteGui((String)value); + } + break; + + case LOCAL_PROPERTIES: + if (value == null) { + unsetLocalProperties(); + } else { + setLocalProperties((Map<String,String>)value); + } + break; - case LOCAL_PROPERTIES: - if (value == null) { - unsetLocalProperties(); - } else { - setLocalProperties((Map<String, String>) value); - } - break; } } public Object getFieldValue(_Fields field) { switch (field) { - case NOTE_ID: - return getNoteId(); + case NOTE_ID: + return getNoteId(); + + case NOTE_NAME: + return getNoteName(); - case NOTE_NAME: - return getNoteName(); + case PARAGRAPH_ID: + return getParagraphId(); - case PARAGRAPH_ID: - return getParagraphId(); + case REPL_NAME: + return getReplName(); - case REPL_NAME: - return getReplName(); + case PARAGRAPH_TITLE: + return getParagraphTitle(); - case PARAGRAPH_TITLE: - return getParagraphTitle(); + case PARAGRAPH_TEXT: + return getParagraphText(); - case PARAGRAPH_TEXT: - return getParagraphText(); + case AUTHENTICATION_INFO: + return getAuthenticationInfo(); - case AUTHENTICATION_INFO: - return getAuthenticationInfo(); + case CONFIG: + return getConfig(); - case CONFIG: - return getConfig(); + case GUI: + return getGui(); - case GUI: - return getGui(); + case NOTE_GUI: + return getNoteGui(); - case NOTE_GUI: - return getNoteGui(); + case LOCAL_PROPERTIES: + return getLocalProperties(); - case LOCAL_PROPERTIES: - return getLocalProperties(); } throw new IllegalStateException(); } - /** - * Returns true if field corresponding to fieldID is set (has been assigned a value) and false - * otherwise - */ + /** 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 NOTE_ID: - return isSetNoteId(); - case NOTE_NAME: - return isSetNoteName(); - case PARAGRAPH_ID: - return isSetParagraphId(); - case REPL_NAME: - return isSetReplName(); - case PARAGRAPH_TITLE: - return isSetParagraphTitle(); - case PARAGRAPH_TEXT: - return isSetParagraphText(); - case AUTHENTICATION_INFO: - return isSetAuthenticationInfo(); - case CONFIG: - return isSetConfig(); - case GUI: - return isSetGui(); - case NOTE_GUI: - return isSetNoteGui(); - case LOCAL_PROPERTIES: - return isSetLocalProperties(); + case NOTE_ID: + return isSetNoteId(); + case NOTE_NAME: + return isSetNoteName(); + case PARAGRAPH_ID: + return isSetParagraphId(); + case REPL_NAME: + return isSetReplName(); + case PARAGRAPH_TITLE: + return isSetParagraphTitle(); + case PARAGRAPH_TEXT: + return isSetParagraphText(); + case AUTHENTICATION_INFO: + return isSetAuthenticationInfo(); + case CONFIG: + return isSetConfig(); + case GUI: + return isSetGui(); + case NOTE_GUI: + return isSetNoteGui(); + case LOCAL_PROPERTIES: + return isSetLocalProperties(); } throw new IllegalStateException(); } @Override public boolean equals(Object that) { - if (that == null) return false; + if (that == null) + return false; if (that instanceof RemoteInterpreterContext) - return this.equals((RemoteInterpreterContext) that); + return this.equals((RemoteInterpreterContext)that); return false; } public boolean equals(RemoteInterpreterContext that) { - if (that == null) return false; + if (that == null) + return false; boolean this_present_noteId = true && this.isSetNoteId(); boolean that_present_noteId = true && that.isSetNoteId(); if (this_present_noteId || that_present_noteId) { - if (!(this_present_noteId && that_present_noteId)) return false; - if (!this.noteId.equals(that.noteId)) return false; + if (!(this_present_noteId && that_present_noteId)) + return false; + if (!this.noteId.equals(that.noteId)) + return false; } boolean this_present_noteName = true && this.isSetNoteName(); boolean that_present_noteName = true && that.isSetNoteName(); if (this_present_noteName || that_present_noteName) { - if (!(this_present_noteName && that_present_noteName)) return false; - if (!this.noteName.equals(that.noteName)) return false; + if (!(this_present_noteName && that_present_noteName)) + return false; + if (!this.noteName.equals(that.noteName)) + 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; + if (!(this_present_paragraphId && that_present_paragraphId)) + return false; + if (!this.paragraphId.equals(that.paragraphId)) + return false; } boolean this_present_replName = true && this.isSetReplName(); boolean that_present_replName = true && that.isSetReplName(); if (this_present_replName || that_present_replName) { - if (!(this_present_replName && that_present_replName)) return false; - if (!this.replName.equals(that.replName)) return false; + if (!(this_present_replName && that_present_replName)) + return false; + if (!this.replName.equals(that.replName)) + return false; } boolean this_present_paragraphTitle = true && this.isSetParagraphTitle(); boolean that_present_paragraphTitle = true && that.isSetParagraphTitle(); if (this_present_paragraphTitle || that_present_paragraphTitle) { - if (!(this_present_paragraphTitle && that_present_paragraphTitle)) return false; - if (!this.paragraphTitle.equals(that.paragraphTitle)) return false; + if (!(this_present_paragraphTitle && that_present_paragraphTitle)) + return false; + if (!this.paragraphTitle.equals(that.paragraphTitle)) + return false; } boolean this_present_paragraphText = true && this.isSetParagraphText(); boolean that_present_paragraphText = true && that.isSetParagraphText(); if (this_present_paragraphText || that_present_paragraphText) { - if (!(this_present_paragraphText && that_present_paragraphText)) return false; - if (!this.paragraphText.equals(that.paragraphText)) return false; + if (!(this_present_paragraphText && that_present_paragraphText)) + return false; + if (!this.paragraphText.equals(that.paragraphText)) + return false; } boolean this_present_authenticationInfo = true && this.isSetAuthenticationInfo(); boolean that_present_authenticationInfo = true && that.isSetAuthenticationInfo(); if (this_present_authenticationInfo || that_present_authenticationInfo) { - if (!(this_present_authenticationInfo && that_present_authenticationInfo)) return false; - if (!this.authenticationInfo.equals(that.authenticationInfo)) return false; + if (!(this_present_authenticationInfo && that_present_authenticationInfo)) + return false; + if (!this.authenticationInfo.equals(that.authenticationInfo)) + return false; } boolean this_present_config = true && this.isSetConfig(); boolean that_present_config = true && that.isSetConfig(); if (this_present_config || that_present_config) { - if (!(this_present_config && that_present_config)) return false; - if (!this.config.equals(that.config)) return false; + if (!(this_present_config && that_present_config)) + return false; + if (!this.config.equals(that.config)) + return false; } boolean this_present_gui = true && this.isSetGui(); boolean that_present_gui = true && that.isSetGui(); if (this_present_gui || that_present_gui) { - if (!(this_present_gui && that_present_gui)) return false; - if (!this.gui.equals(that.gui)) return false; + if (!(this_present_gui && that_present_gui)) + return false; + if (!this.gui.equals(that.gui)) + return false; } boolean this_present_noteGui = true && this.isSetNoteGui(); boolean that_present_noteGui = true && that.isSetNoteGui(); if (this_present_noteGui || that_present_noteGui) { - if (!(this_present_noteGui && that_present_noteGui)) return false; - if (!this.noteGui.equals(that.noteGui)) return false; + if (!(this_present_noteGui && that_present_noteGui)) + return false; + if (!this.noteGui.equals(that.noteGui)) + return false; } boolean this_present_localProperties = true && this.isSetLocalProperties(); boolean that_present_localProperties = true && that.isSetLocalProperties(); if (this_present_localProperties || that_present_localProperties) { - if (!(this_present_localProperties && that_present_localProperties)) return false; - if (!this.localProperties.equals(that.localProperties)) return false; + if (!(this_present_localProperties && that_present_localProperties)) + return false; + if (!this.localProperties.equals(that.localProperties)) + return false; } return true; @@ -906,47 +855,58 @@ public class RemoteInterpreterContext boolean present_noteId = true && (isSetNoteId()); list.add(present_noteId); - if (present_noteId) list.add(noteId); + if (present_noteId) + list.add(noteId); boolean present_noteName = true && (isSetNoteName()); list.add(present_noteName); - if (present_noteName) list.add(noteName); + if (present_noteName) + list.add(noteName); boolean present_paragraphId = true && (isSetParagraphId()); list.add(present_paragraphId); - if (present_paragraphId) list.add(paragraphId); + if (present_paragraphId) + list.add(paragraphId); boolean present_replName = true && (isSetReplName()); list.add(present_replName); - if (present_replName) list.add(replName); + if (present_replName) + list.add(replName); boolean present_paragraphTitle = true && (isSetParagraphTitle()); list.add(present_paragraphTitle); - if (present_paragraphTitle) list.add(paragraphTitle); + if (present_paragraphTitle) + list.add(paragraphTitle); boolean present_paragraphText = true && (isSetParagraphText()); list.add(present_paragraphText); - if (present_paragraphText) list.add(paragraphText); + if (present_paragraphText) + list.add(paragraphText); boolean present_authenticationInfo = true && (isSetAuthenticationInfo()); list.add(present_authenticationInfo); - if (present_authenticationInfo) list.add(authenticationInfo); + if (present_authenticationInfo) + list.add(authenticationInfo); boolean present_config = true && (isSetConfig()); list.add(present_config); - if (present_config) list.add(config); + if (present_config) + list.add(config); boolean present_gui = true && (isSetGui()); list.add(present_gui); - if (present_gui) list.add(gui); + if (present_gui) + list.add(gui); boolean present_noteGui = true && (isSetNoteGui()); list.add(present_noteGui); - if (present_noteGui) list.add(noteGui); + if (present_noteGui) + list.add(noteGui); boolean present_localProperties = true && (isSetLocalProperties()); list.add(present_localProperties); - if (present_localProperties) list.add(localProperties); + if (present_localProperties) + list.add(localProperties); return list.hashCode(); } @@ -1004,8 +964,7 @@ public class RemoteInterpreterContext return lastComparison; } if (isSetParagraphTitle()) { - lastComparison = - org.apache.thrift.TBaseHelper.compareTo(this.paragraphTitle, other.paragraphTitle); + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.paragraphTitle, other.paragraphTitle); if (lastComparison != 0) { return lastComparison; } @@ -1015,21 +974,17 @@ public class RemoteInterpreterContext return lastComparison; } if (isSetParagraphText()) { - lastComparison = - org.apache.thrift.TBaseHelper.compareTo(this.paragraphText, other.paragraphText); + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.paragraphText, other.paragraphText); if (lastComparison != 0) { return lastComparison; } } - lastComparison = - Boolean.valueOf(isSetAuthenticationInfo()).compareTo(other.isSetAuthenticationInfo()); + lastComparison = Boolean.valueOf(isSetAuthenticationInfo()).compareTo(other.isSetAuthenticationInfo()); if (lastComparison != 0) { return lastComparison; } if (isSetAuthenticationInfo()) { - lastComparison = - org.apache.thrift.TBaseHelper.compareTo( - this.authenticationInfo, other.authenticationInfo); + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.authenticationInfo, other.authenticationInfo); if (lastComparison != 0) { return lastComparison; } @@ -1064,14 +1019,12 @@ public class RemoteInterpreterContext return lastComparison; } } - lastComparison = - Boolean.valueOf(isSetLocalProperties()).compareTo(other.isSetLocalProperties()); + lastComparison = Boolean.valueOf(isSetLocalProperties()).compareTo(other.isSetLocalProperties()); if (lastComparison != 0) { return lastComparison; } if (isSetLocalProperties()) { - lastComparison = - org.apache.thrift.TBaseHelper.compareTo(this.localProperties, other.localProperties); + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.localProperties, other.localProperties); if (lastComparison != 0) { return lastComparison; } @@ -1087,8 +1040,7 @@ public class RemoteInterpreterContext schemes.get(iprot.getScheme()).getScheme().read(iprot, this); } - public void write(org.apache.thrift.protocol.TProtocol oprot) - throws org.apache.thrift.TException { + public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { schemes.get(oprot.getScheme()).getScheme().write(oprot, this); } @@ -1195,20 +1147,15 @@ public class RemoteInterpreterContext 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))); + 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 { + 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))); + 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); } @@ -1220,16 +1167,15 @@ public class RemoteInterpreterContext } } - private static class RemoteInterpreterContextStandardScheme - extends StandardScheme<RemoteInterpreterContext> { + private static class RemoteInterpreterContextStandardScheme extends StandardScheme<RemoteInterpreterContext> { - public void read(org.apache.thrift.protocol.TProtocol iprot, RemoteInterpreterContext struct) - throws org.apache.thrift.TException { + public void read(org.apache.thrift.protocol.TProtocol iprot, RemoteInterpreterContext struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TField schemeField; iprot.readStructBegin(); - while (true) { + while (true) + { schemeField = iprot.readFieldBegin(); - if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { + if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { break; } switch (schemeField.id) { @@ -1237,7 +1183,7 @@ public class RemoteInterpreterContext if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { struct.noteId = iprot.readString(); struct.setNoteIdIsSet(true); - } else { + } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; @@ -1245,7 +1191,7 @@ public class RemoteInterpreterContext if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { struct.noteName = iprot.readString(); struct.setNoteNameIsSet(true); - } else { + } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; @@ -1253,7 +1199,7 @@ public class RemoteInterpreterContext if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { struct.paragraphId = iprot.readString(); struct.setParagraphIdIsSet(true); - } else { + } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; @@ -1261,7 +1207,7 @@ public class RemoteInterpreterContext if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { struct.replName = iprot.readString(); struct.setReplNameIsSet(true); - } else { + } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; @@ -1269,7 +1215,7 @@ public class RemoteInterpreterContext if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { struct.paragraphTitle = iprot.readString(); struct.setParagraphTitleIsSet(true); - } else { + } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; @@ -1277,7 +1223,7 @@ public class RemoteInterpreterContext if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { struct.paragraphText = iprot.readString(); struct.setParagraphTextIsSet(true); - } else { + } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; @@ -1285,7 +1231,7 @@ public class RemoteInterpreterContext if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { struct.authenticationInfo = iprot.readString(); struct.setAuthenticationInfoIsSet(true); - } else { + } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; @@ -1293,7 +1239,7 @@ public class RemoteInterpreterContext if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { struct.config = iprot.readString(); struct.setConfigIsSet(true); - } else { + } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; @@ -1301,7 +1247,7 @@ public class RemoteInterpreterContext if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { struct.gui = iprot.readString(); struct.setGuiIsSet(true); - } else { + } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; @@ -1309,7 +1255,7 @@ public class RemoteInterpreterContext if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { struct.noteGui = iprot.readString(); struct.setNoteGuiIsSet(true); - } else { + } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; @@ -1317,10 +1263,11 @@ public class RemoteInterpreterContext if (schemeField.type == org.apache.thrift.protocol.TType.MAP) { { org.apache.thrift.protocol.TMap _map0 = iprot.readMapBegin(); - struct.localProperties = new HashMap<String, String>(2 * _map0.size); + struct.localProperties = new HashMap<String,String>(2*_map0.size); String _key1; String _val2; - for (int _i3 = 0; _i3 < _map0.size; ++_i3) { + for (int _i3 = 0; _i3 < _map0.size; ++_i3) + { _key1 = iprot.readString(); _val2 = iprot.readString(); struct.localProperties.put(_key1, _val2); @@ -1328,7 +1275,7 @@ public class RemoteInterpreterContext iprot.readMapEnd(); } struct.setLocalPropertiesIsSet(true); - } else { + } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; @@ -1343,8 +1290,7 @@ public class RemoteInterpreterContext struct.validate(); } - public void write(org.apache.thrift.protocol.TProtocol oprot, RemoteInterpreterContext struct) - throws org.apache.thrift.TException { + public void write(org.apache.thrift.protocol.TProtocol oprot, RemoteInterpreterContext struct) throws org.apache.thrift.TException { struct.validate(); oprot.writeStructBegin(STRUCT_DESC); @@ -1401,12 +1347,9 @@ public class RemoteInterpreterContext if (struct.localProperties != null) { oprot.writeFieldBegin(LOCAL_PROPERTIES_FIELD_DESC); { - oprot.writeMapBegin( - new org.apache.thrift.protocol.TMap( - org.apache.thrift.protocol.TType.STRING, - org.apache.thrift.protocol.TType.STRING, - struct.localProperties.size())); - for (Map.Entry<String, String> _iter4 : struct.localProperties.entrySet()) { + oprot.writeMapBegin(new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.STRING, struct.localProperties.size())); + for (Map.Entry<String, String> _iter4 : struct.localProperties.entrySet()) + { oprot.writeString(_iter4.getKey()); oprot.writeString(_iter4.getValue()); } @@ -1417,6 +1360,7 @@ public class RemoteInterpreterContext oprot.writeFieldStop(); oprot.writeStructEnd(); } + } private static class RemoteInterpreterContextTupleSchemeFactory implements SchemeFactory { @@ -1425,12 +1369,10 @@ public class RemoteInterpreterContext } } - private static class RemoteInterpreterContextTupleScheme - extends TupleScheme<RemoteInterpreterContext> { + private static class RemoteInterpreterContextTupleScheme extends TupleScheme<RemoteInterpreterContext> { @Override - public void write(org.apache.thrift.protocol.TProtocol prot, RemoteInterpreterContext struct) - throws org.apache.thrift.TException { + public void write(org.apache.thrift.protocol.TProtocol prot, RemoteInterpreterContext struct) throws org.apache.thrift.TException { TTupleProtocol oprot = (TTupleProtocol) prot; BitSet optionals = new BitSet(); if (struct.isSetNoteId()) { @@ -1500,7 +1442,8 @@ public class RemoteInterpreterContext if (struct.isSetLocalProperties()) { { oprot.writeI32(struct.localProperties.size()); - for (Map.Entry<String, String> _iter5 : struct.localProperties.entrySet()) { + for (Map.Entry<String, String> _iter5 : struct.localProperties.entrySet()) + { oprot.writeString(_iter5.getKey()); oprot.writeString(_iter5.getValue()); } @@ -1509,8 +1452,7 @@ public class RemoteInterpreterContext } @Override - public void read(org.apache.thrift.protocol.TProtocol prot, RemoteInterpreterContext struct) - throws org.apache.thrift.TException { + public void read(org.apache.thrift.protocol.TProtocol prot, RemoteInterpreterContext struct) throws org.apache.thrift.TException { TTupleProtocol iprot = (TTupleProtocol) prot; BitSet incoming = iprot.readBitSet(11); if (incoming.get(0)) { @@ -1555,15 +1497,12 @@ public class RemoteInterpreterContext } if (incoming.get(10)) { { - org.apache.thrift.protocol.TMap _map6 = - new org.apache.thrift.protocol.TMap( - org.apache.thrift.protocol.TType.STRING, - org.apache.thrift.protocol.TType.STRING, - iprot.readI32()); - struct.localProperties = new HashMap<String, String>(2 * _map6.size); + org.apache.thrift.protocol.TMap _map6 = new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.STRING, iprot.readI32()); + struct.localProperties = new HashMap<String,String>(2*_map6.size); String _key7; String _val8; - for (int _i9 = 0; _i9 < _map6.size; ++_i9) { + for (int _i9 = 0; _i9 < _map6.size; ++_i9) + { _key7 = iprot.readString(); _val8 = iprot.readString(); struct.localProperties.put(_key7, _val8); @@ -1573,4 +1512,6 @@ public class RemoteInterpreterContext } } } + } +
http://git-wip-us.apache.org/repos/asf/zeppelin/blob/0d746fa2/zeppelin-interpreter/src/main/java/org/apache/zeppelin/interpreter/thrift/RemoteInterpreterEvent.java ---------------------------------------------------------------------- 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 729ae1e..c8bfa44 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 @@ -1,80 +1,84 @@ /** - * 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 + * 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 * - * <p>http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * - * <p>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 + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and * limitations under the License. */ /** * Autogenerated by Thrift Compiler (0.9.2) * - * <p>DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING - * - * @generated + * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING + * @generated */ package org.apache.zeppelin.interpreter.thrift; -import java.util.ArrayList; -import java.util.BitSet; -import java.util.Collections; -import java.util.EnumMap; -import java.util.EnumSet; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import javax.annotation.Generated; -import org.apache.thrift.protocol.TTupleProtocol; import org.apache.thrift.scheme.IScheme; import org.apache.thrift.scheme.SchemeFactory; import org.apache.thrift.scheme.StandardScheme; + import org.apache.thrift.scheme.TupleScheme; +import org.apache.thrift.protocol.TTupleProtocol; +import org.apache.thrift.protocol.TProtocolException; +import org.apache.thrift.EncodingUtils; +import org.apache.thrift.TException; +import org.apache.thrift.async.AsyncMethodCallback; import org.apache.thrift.server.AbstractNonblockingServer.*; +import java.util.List; +import java.util.ArrayList; +import java.util.Map; +import java.util.HashMap; +import java.util.EnumMap; +import java.util.Set; +import java.util.HashSet; +import java.util.EnumSet; +import java.util.Collections; +import java.util.BitSet; +import java.nio.ByteBuffer; +import java.util.Arrays; +import javax.annotation.Generated; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; @SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"}) @Generated(value = "Autogenerated by Thrift Compiler (0.9.2)", date = "2018-8-9") -public class RemoteInterpreterEvent - implements org.apache.thrift.TBase<RemoteInterpreterEvent, RemoteInterpreterEvent._Fields>, - java.io.Serializable, - Cloneable, - Comparable<RemoteInterpreterEvent> { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = - new org.apache.thrift.protocol.TStruct("RemoteInterpreterEvent"); - - private static final org.apache.thrift.protocol.TField TYPE_FIELD_DESC = - new org.apache.thrift.protocol.TField( - "type", org.apache.thrift.protocol.TType.I32, (short) 1); - private static final org.apache.thrift.protocol.TField DATA_FIELD_DESC = - new org.apache.thrift.protocol.TField( - "data", org.apache.thrift.protocol.TType.STRING, (short) 2); - - private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = - new HashMap<Class<? extends IScheme>, SchemeFactory>(); +public class RemoteInterpreterEvent implements org.apache.thrift.TBase<RemoteInterpreterEvent, RemoteInterpreterEvent._Fields>, java.io.Serializable, Cloneable, Comparable<RemoteInterpreterEvent> { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("RemoteInterpreterEvent"); + + private static final org.apache.thrift.protocol.TField TYPE_FIELD_DESC = new org.apache.thrift.protocol.TField("type", org.apache.thrift.protocol.TType.I32, (short)1); + private static final org.apache.thrift.protocol.TField DATA_FIELD_DESC = new org.apache.thrift.protocol.TField("data", org.apache.thrift.protocol.TType.STRING, (short)2); + private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>(); static { schemes.put(StandardScheme.class, new RemoteInterpreterEventStandardSchemeFactory()); schemes.put(TupleScheme.class, new RemoteInterpreterEventTupleSchemeFactory()); } - /** @see RemoteInterpreterEventType */ + /** + * + * @see RemoteInterpreterEventType + */ public RemoteInterpreterEventType type; // required - public String data; // required - /** - * The set of fields this struct contains, along with convenience methods for finding and - * manipulating them. - */ + /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ public enum _Fields implements org.apache.thrift.TFieldIdEnum { - /** @see RemoteInterpreterEventType */ - TYPE((short) 1, "type"), - DATA((short) 2, "data"); + /** + * + * @see RemoteInterpreterEventType + */ + TYPE((short)1, "type"), + DATA((short)2, "data"); private static final Map<String, _Fields> byName = new HashMap<String, _Fields>(); @@ -84,9 +88,11 @@ public class RemoteInterpreterEvent } } - /** Find the _Fields constant that matches fieldId, or null if its not found. */ + /** + * Find the _Fields constant that matches fieldId, or null if its not found. + */ public static _Fields findByThriftId(int fieldId) { - switch (fieldId) { + switch(fieldId) { case 1: // TYPE return TYPE; case 2: // DATA @@ -96,15 +102,19 @@ public class RemoteInterpreterEvent } } - /** Find the _Fields constant that matches fieldId, throwing an exception if it is not found. */ + /** + * 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!"); + 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. */ + /** + * Find the _Fields constant that matches name, or null if its not found. + */ public static _Fields findByName(String name) { return byName.get(name); } @@ -128,38 +138,31 @@ public class RemoteInterpreterEvent // 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.TYPE, - new org.apache.thrift.meta_data.FieldMetaData( - "type", - org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.EnumMetaData( - org.apache.thrift.protocol.TType.ENUM, RemoteInterpreterEventType.class))); - tmpMap.put( - _Fields.DATA, - new org.apache.thrift.meta_data.FieldMetaData( - "data", - org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.FieldValueMetaData( - org.apache.thrift.protocol.TType.STRING))); + Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); + tmpMap.put(_Fields.TYPE, new org.apache.thrift.meta_data.FieldMetaData("type", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.EnumMetaData(org.apache.thrift.protocol.TType.ENUM, RemoteInterpreterEventType.class))); + tmpMap.put(_Fields.DATA, new org.apache.thrift.meta_data.FieldMetaData("data", 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( - RemoteInterpreterEvent.class, metaDataMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(RemoteInterpreterEvent.class, metaDataMap); } - public RemoteInterpreterEvent() {} + public RemoteInterpreterEvent() { + } - public RemoteInterpreterEvent(RemoteInterpreterEventType type, String data) { + public RemoteInterpreterEvent( + RemoteInterpreterEventType type, + String data) + { this(); this.type = type; this.data = data; } - /** Performs a deep copy on <i>other</i>. */ + /** + * Performs a deep copy on <i>other</i>. + */ public RemoteInterpreterEvent(RemoteInterpreterEvent other) { if (other.isSetType()) { this.type = other.type; @@ -179,12 +182,18 @@ public class RemoteInterpreterEvent this.data = null; } - /** @see RemoteInterpreterEventType */ + /** + * + * @see RemoteInterpreterEventType + */ public RemoteInterpreterEventType getType() { return this.type; } - /** @see RemoteInterpreterEventType */ + /** + * + * @see RemoteInterpreterEventType + */ public RemoteInterpreterEvent setType(RemoteInterpreterEventType type) { this.type = type; return this; @@ -231,75 +240,81 @@ public class RemoteInterpreterEvent public void setFieldValue(_Fields field, Object value) { switch (field) { - case TYPE: - if (value == null) { - unsetType(); - } else { - setType((RemoteInterpreterEventType) value); - } - break; + case TYPE: + if (value == null) { + unsetType(); + } else { + setType((RemoteInterpreterEventType)value); + } + break; + + case DATA: + if (value == null) { + unsetData(); + } else { + setData((String)value); + } + break; - case DATA: - if (value == null) { - unsetData(); - } else { - setData((String) value); - } - break; } } public Object getFieldValue(_Fields field) { switch (field) { - case TYPE: - return getType(); + case TYPE: + return getType(); + + case DATA: + return getData(); - case DATA: - return getData(); } throw new IllegalStateException(); } - /** - * Returns true if field corresponding to fieldID is set (has been assigned a value) and false - * otherwise - */ + /** 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 TYPE: - return isSetType(); - case DATA: - return isSetData(); + case TYPE: + return isSetType(); + case DATA: + return isSetData(); } throw new IllegalStateException(); } @Override public boolean equals(Object that) { - if (that == null) return false; - if (that instanceof RemoteInterpreterEvent) return this.equals((RemoteInterpreterEvent) that); + if (that == null) + return false; + if (that instanceof RemoteInterpreterEvent) + return this.equals((RemoteInterpreterEvent)that); return false; } public boolean equals(RemoteInterpreterEvent that) { - if (that == null) return false; + if (that == null) + return false; boolean this_present_type = true && this.isSetType(); boolean that_present_type = true && that.isSetType(); if (this_present_type || that_present_type) { - if (!(this_present_type && that_present_type)) return false; - if (!this.type.equals(that.type)) return false; + if (!(this_present_type && that_present_type)) + return false; + if (!this.type.equals(that.type)) + return false; } boolean this_present_data = true && this.isSetData(); boolean that_present_data = true && that.isSetData(); if (this_present_data || that_present_data) { - if (!(this_present_data && that_present_data)) return false; - if (!this.data.equals(that.data)) return false; + if (!(this_present_data && that_present_data)) + return false; + if (!this.data.equals(that.data)) + return false; } return true; @@ -311,11 +326,13 @@ public class RemoteInterpreterEvent boolean present_type = true && (isSetType()); list.add(present_type); - if (present_type) list.add(type.getValue()); + if (present_type) + list.add(type.getValue()); boolean present_data = true && (isSetData()); list.add(present_data); - if (present_data) list.add(data); + if (present_data) + list.add(data); return list.hashCode(); } @@ -359,8 +376,7 @@ public class RemoteInterpreterEvent schemes.get(iprot.getScheme()).getScheme().read(iprot, this); } - public void write(org.apache.thrift.protocol.TProtocol oprot) - throws org.apache.thrift.TException { + public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { schemes.get(oprot.getScheme()).getScheme().write(oprot, this); } @@ -395,20 +411,15 @@ public class RemoteInterpreterEvent 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))); + 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 { + 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))); + 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); } @@ -420,26 +431,23 @@ public class RemoteInterpreterEvent } } - private static class RemoteInterpreterEventStandardScheme - extends StandardScheme<RemoteInterpreterEvent> { + private static class RemoteInterpreterEventStandardScheme extends StandardScheme<RemoteInterpreterEvent> { - public void read(org.apache.thrift.protocol.TProtocol iprot, RemoteInterpreterEvent struct) - throws org.apache.thrift.TException { + public void read(org.apache.thrift.protocol.TProtocol iprot, RemoteInterpreterEvent struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TField schemeField; iprot.readStructBegin(); - while (true) { + while (true) + { schemeField = iprot.readFieldBegin(); - if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { + if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { break; } switch (schemeField.id) { case 1: // TYPE if (schemeField.type == org.apache.thrift.protocol.TType.I32) { - struct.type = - org.apache.zeppelin.interpreter.thrift.RemoteInterpreterEventType.findByValue( - iprot.readI32()); + struct.type = org.apache.zeppelin.interpreter.thrift.RemoteInterpreterEventType.findByValue(iprot.readI32()); struct.setTypeIsSet(true); - } else { + } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; @@ -447,7 +455,7 @@ public class RemoteInterpreterEvent if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { struct.data = iprot.readString(); struct.setDataIsSet(true); - } else { + } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; @@ -462,8 +470,7 @@ public class RemoteInterpreterEvent struct.validate(); } - public void write(org.apache.thrift.protocol.TProtocol oprot, RemoteInterpreterEvent struct) - throws org.apache.thrift.TException { + public void write(org.apache.thrift.protocol.TProtocol oprot, RemoteInterpreterEvent struct) throws org.apache.thrift.TException { struct.validate(); oprot.writeStructBegin(STRUCT_DESC); @@ -480,6 +487,7 @@ public class RemoteInterpreterEvent oprot.writeFieldStop(); oprot.writeStructEnd(); } + } private static class RemoteInterpreterEventTupleSchemeFactory implements SchemeFactory { @@ -488,12 +496,10 @@ public class RemoteInterpreterEvent } } - private static class RemoteInterpreterEventTupleScheme - extends TupleScheme<RemoteInterpreterEvent> { + private static class RemoteInterpreterEventTupleScheme extends TupleScheme<RemoteInterpreterEvent> { @Override - public void write(org.apache.thrift.protocol.TProtocol prot, RemoteInterpreterEvent struct) - throws org.apache.thrift.TException { + public void write(org.apache.thrift.protocol.TProtocol prot, RemoteInterpreterEvent struct) throws org.apache.thrift.TException { TTupleProtocol oprot = (TTupleProtocol) prot; BitSet optionals = new BitSet(); if (struct.isSetType()) { @@ -512,14 +518,11 @@ public class RemoteInterpreterEvent } @Override - public void read(org.apache.thrift.protocol.TProtocol prot, RemoteInterpreterEvent struct) - throws org.apache.thrift.TException { + public void read(org.apache.thrift.protocol.TProtocol prot, RemoteInterpreterEvent struct) throws org.apache.thrift.TException { TTupleProtocol iprot = (TTupleProtocol) prot; BitSet incoming = iprot.readBitSet(2); if (incoming.get(0)) { - struct.type = - org.apache.zeppelin.interpreter.thrift.RemoteInterpreterEventType.findByValue( - iprot.readI32()); + struct.type = org.apache.zeppelin.interpreter.thrift.RemoteInterpreterEventType.findByValue(iprot.readI32()); struct.setTypeIsSet(true); } if (incoming.get(1)) { @@ -528,4 +531,6 @@ public class RemoteInterpreterEvent } } } + } +
