private TaskState(Task task, TExecTaskResult result) { task_ = task; handle_ = result.handle; schema_ = new Schema(result.schema); }
@Override public void readFields(DataInput in) throws IOException { schema_ = com.cloudera.recordservice.core.Schema.deserialize(in); }
@Override public void write(DataOutput out) throws IOException { schema_.serialize(out); } }
@Override public String toString() { return schema_.toString(); }
/** * Sets the schema for a path request. Invalid for non-path requests. */ public Request setSchema(Schema schema) { verifyPathRequest("setSchema()"); request_.path.setSchema(schema.toThrift()); return this; }
GetSchemaResult(TGetSchemaResult result) { schema = new Schema(result.schema); warnings = LogMessage.fromThrift(result.warnings); } }
/** * Deserializes Schema from 'in' */ public static Schema deserialize(DataInput in) throws IOException { int numCols = in.readInt(); List<ColumnDesc> cols = new ArrayList<ColumnDesc>(); for (int i = 0; i < numCols; ++i) { int nameLen = in.readInt(); byte[] nameBuffer = new byte[nameLen]; in.readFully(nameBuffer); Type typeId = Type.values()[in.readInt()]; int precision = in.readInt(); int scale = in.readInt(); int len = in.readInt(); TypeDesc t = new TypeDesc(typeId, len, precision, scale); cols.add(new ColumnDesc(new String(nameBuffer), t)); } boolean isCountStart = in.readBoolean(); return new Schema(cols, isCountStart); }
public PlanRequestResult(TPlanRequestResult result) { tasks = Task.fromThrift(result.tasks); schema = new Schema(result.schema); requestId = new UniqueId(result.request_id); hosts = NetworkAddress.fromThrift(result.hosts); warnings = LogMessage.fromThrift(result.warnings); } }